Docs › Reference

REST API reference

Personal access tokens, the endpoints and the error answers.

Tokens

Create a token under Account → Access tokens and tick the API scope (and write if the token may change things). Tokens can expire, and every use is recorded. Passwords never work on the API.

Send the token as a bearer token:

curl -H "Authorization: Bearer gdp_…" https://git.example.com/api/v1/user

Basic sign-in with the token as the password also works, for tools that only support that. Each token may make 600 requests a minute by default (an administrator can change it); after that the answer is 429 with Retry-After. Repeated failed tokens from one address are blocked for a while.

Endpoints

Method and pathWhat it doesNeeds
GET /api/v1/healthIs the server upnothing
GET /api/v1/userThe token's userAPI scope
GET /api/v1/reposRepositories you can readAPI scope
GET /api/v1/repos/{name}One repositoryread access
GET /api/v1/repos/{name}/branchesBranchesread access
GET /api/v1/repos/{name}/contents?ref=&path=A file or a folder listing at a branch, tag or commitread access
GET /api/v1/repos/{name}/pullsPull requestsread access
GET /api/v1/repos/{name}/commits/{sha}/statusesStatus checks of a commitread access
POST /api/v1/repos/{name}/commits/{sha}/statusesReport a check from another toolwrite access and the write scope
GET /api/v1/audit?q=The latest audit entries and whether the chain is intactadministrators and auditors

Reporting a status check

POST /api/v1/repos/firmware/commits/3f2a…/statuses
{"context": "ci/hardware-test", "state": "success", "description": "42 boards passed", "target_url": "https://lab.example.com/run/77"}

state is pending, success, failure or error. A context can be made a required check on a protected branch.

Errors

Errors are JSON {"error": "…"}: 401 no or bad token, 403 the token or your access is not enough, 404 not found (also for repositories you can't see), 429 too many requests.

Webhooks

Repository webhooks send push, pull request and pipeline events as JSON, signed with your secret. Webhooks cannot be aimed at the server itself or at internal addresses you have not allowed.

Updated 24 Nov 2026 · Something missing? Ask in the community.