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 path | What it does | Needs |
|---|---|---|
GET /api/v1/health | Is the server up | nothing |
GET /api/v1/user | The token's user | API scope |
GET /api/v1/repos | Repositories you can read | API scope |
GET /api/v1/repos/{name} | One repository | read access |
GET /api/v1/repos/{name}/branches | Branches | read access |
GET /api/v1/repos/{name}/contents?ref=&path= | A file or a folder listing at a branch, tag or commit | read access |
GET /api/v1/repos/{name}/pulls | Pull requests | read access |
GET /api/v1/repos/{name}/commits/{sha}/statuses | Status checks of a commit | read access |
POST /api/v1/repos/{name}/commits/{sha}/statuses | Report a check from another tool | write access and the write scope |
GET /api/v1/audit?q= | The latest audit entries and whether the chain is intact | administrators 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.