Skip to content

API Overview

Dojo exposes a full REST API at https://dojo.ninja/api/. All repository operations available in the CLI are also available via API, plus additional features like full-text search and tree browsing.

All API requests require authentication via either:

Automatically set via cookie when logged in at dojo.ninja.

Use a session token or API key in the Authorization header:

Terminal window
curl -H "Authorization: Bearer <token>" https://dojo.ninja/api/repos/owner/name

Create API keys with limited permissions for automation and agents:

Terminal window
curl -X POST https://dojo.ninja/api/keys \
-H "Authorization: Bearer <session-token>" \
-H "Content-Type: application/json" \
-d '{"name": "ci-bot", "scopes": ["repo:read", "workspace:write"]}'

Available scopes:

ScopeAccess
repo:readRead repository data, commits, refs
repo:writePush commits, update refs
workspace:readList and read workspaces
workspace:writeCreate, write, commit workspaces
stack:readList and view stacks
stack:writeSubmit and manage stacks
adminFull access including settings
https://dojo.ninja/api/repos/{owner}/{name}
MethodPathDescription
GET/api/repos/{owner}/{name}Repository info + refs
GET/api/repos/{owner}/{name}/logCommit log
GET/api/repos/{owner}/{name}/statsRepository statistics
GET/api/repos/{owner}/{name}/treeBrowse file tree
GET/api/repos/{owner}/{name}/searchFull-text search
GET/api/repos/{owner}/{name}/file/*Read file content
POST/api/repos/{owner}/{name}/workspacesCreate workspace
GET/api/repos/{owner}/{name}/stacksList stacks
POST/api/repos/{owner}/{name}/hooksCreate webhook
POST/api/keysCreate API key
GET/api/keysList your API keys
DELETE/api/keys/{keyId}Revoke an API key

All errors return JSON with an error field:

{
"error": "ref not found: nonexistent-branch"
}

HTTP status codes follow standard conventions: 400 for bad requests, 401 for unauthorized, 403 for forbidden, 404 for not found, 500 for server errors.

API keys and session tokens share the same rate limits. If you hit a rate limit, you’ll receive a 429 Too Many Requests response. Back off and retry with exponential backoff.