glab(1) glab(1) (NAME) glab-api - API (SYNOPSIS) glab api [flags] (DESCRIPTION) HTTP GitLab API . API graphql GitLab GraphQL API . : o GitLab REST API o GitLab GraphQL . gitlab.com . --hostname . (endpoint) : o :branch o :fullpath o :group o :id o :namespace o :repo o :user o :username HTTP GET POST . --method . --raw-field key=value JSON POST . --field --raw-field : o true false null JSON . o [ { JSON ( -F 'topics=["my-topic","GitLab"]'). JSON . : -F 'topics= ["a"]' . o :namespace :repo :branch JSON ( -F 'input={"projectPath":":fullpath"}'). o @ . (stdin) - . --raw-field JSON . JSON --input . --raw- field -f 'scopes=[api,read_api]' "[api,read_api]" . --raw- field . -F 'scopes=["api","read_api"]' . GraphQL query operationName GraphQL . multipart/form-data JSON --form . API . --form key=value . @ . - . --form --field --raw-field --input . --input . - . --field (query parameters) URL . --paginate . GraphQL: o $endCursor: String . o pageInfo{ hasNextPage, endCursor } (collection) . --output : o json (): JSON (Pretty-printed). JSON . o ndjson: JSON (Newline-delimited JSON) JSON Lines. . jq . ndjson ndjson JSON Lines . (OPTIONS) -F, --field=[] . HTTP POST . --form=[] (multipart form). @ . @- ( ). HTTP POST . -H, --header=[] HTTP. --hostname="" . gitlab.com . -i, --include[=false] HTTP . --input="" HTTP . -X, --method="GET" HTTP . --output="json" : json, ndjson. --paginate[=false] HTTP . -f, --raw-field=[] . --silent[=false] . (OPTIONS INHERITED FROM PARENT COMMANDS) -h, --help[=false] . (EXAMPLES) # :fullpath glab api projects/:fullpath/releases # (issues) URL glab api projects/gitlab-com%2Fwww-gitlab-com/issues # glab api --method POST projects/:fullpath/wikis/attachments --form "file=@./image.png" --form "branch=main" # HTTP . # --input JSON (stdin). echo '{"allowed_to_push":[{"user_id":1}]}' | GLAB_DEBUG_HTTP=1 glab api -X PATCH "projects/:fullpath/protected_branches/main" --input - # (issues) glab api issues --paginate # ndjson glab api issues --paginate --output ndjson # jq glab api issues --paginate --output ndjson | jq 'select(.state == "opened")' # GraphQL glab api graphql -f query="query { currentUser { username } }" # GraphQL glab api graphql -f query=' query { project(fullPath: "gitlab-org/gitlab-docs") { name forksCount statistics { wikiSize } issuesEnabled boards { nodes { id name } } } } ' # GraphQL endCursor glab api graphql --paginate -f query=' query($endCursor: String) { project(fullPath: "gitlab-org/graphql-sandbox") { name issues(first: 2, after: $endCursor) { edges { node { title } } pageInfo { endCursor hasNextPage } } } }' (SEE ALSO) glab(1) Auto generated by spf13/cobra Sep 2026 glab(1)