Skip to Content
We are live but in Staging πŸŽ‰
API ReferenceOverview

API Reference

The REST control plane of the git gateway β€” everything except moving objects (that’s the git wire). All endpoints live under /api/v1 on the git host.

Conventions

Base URL

Host
Productionhttps://git.dodil.io

The same host serves the smart-HTTP wire (/{repo_id}.git) and this API (/api/v1/…).

Auth

Two interchangeable schemes on every endpoint:

# Bearer β€” a Dodil SSO JWT (the console adds x-organization-id for tenancy) curl -H "Authorization: Bearer $DODIL_TOKEN" \ https://git.dodil.io/api/v1/repos # Basic β€” a dk_ org API key as the password (username ignored) curl -u "user:$DK_KEY" https://git.dodil.io/api/v1/repos

401 means unauthenticated (missing/expired token); 403 means authenticated but not authorized (you lack the role) β€” retrying with the same credential yields the same 403.

Responses and errors

  • Handlers return the DTO directly β€” there is no {data, status} envelope. GET /api/v1/repos returns {"repos": […]}, a repo GET returns the repo object itself.
  • Field names are snake_case (repo_id, default_branch, head_sha).
  • Errors are mostly plain-text bodies (e.g. conflict: …) with the matching HTTP status; merge conflicts arrive as a typed JSON body. Read the status code first, then the body as the human-readable message.
  • Check logs are text/plain, and their live tail is text/event-stream β€” not JSON.

Addressing

Every repo-scoped path keys by the opaque repo_id (UUIDv7). Resolve a human address first when you only have a name:

curl -u "user:$DK_KEY" \ https://git.dodil.io/api/v1/orgs/{org_slug}/repos/{name} # β†’ the full repo object, including repo_id

Endpoint map

  • Repositories β€” repo CRUD, address resolution, visibility, default branch, branches, refs, tree/blob browsing, commits, diffs, branch protection, SSH keys.
  • Pull Requests β€” list/create/get/update, sha-pinned reviews, merge (three methods + optimistic concurrency), close, comments, PR diff.
  • Checks & CI Secrets β€” per-commit checks with the worst-of rollup, durable logs, the SSE live tail, and write-only CI secrets at org/repo/environment scope.

Not on this plane: API keys and per-repo access grants are IAM surfaces on the platform gateway (/v1/iam/orgs/{org_id}/api-keys, /v1/iam/orgs/{org_id}/permissions) β€” manage them from the console’s API Keys page and the IAM console. See Auth and Access.

See also