Skip to main content

API Authentication

All API requests must include a valid token in the Authorization header:
Authorization: Bearer jjhub_your_token_here

Generating Tokens

Via CLI:
jjhub auth token create --name "My Token" --scopes "repo:read,repo:write"
Via API:
curl -X POST https://api.jjhub.tech/api/tokens \
  -H "Authorization: Bearer jjhub_existing_token" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Token", "scopes": ["repo:read", "repo:write"]}'

Token Format

All tokens are prefixed with jjhub_ and are SHA-256 hashed before storage. Tokens are shown once at creation time.

Error Responses

{
  "message": "Unauthorized",
  "errors": []
}
HTTP 401 is returned for missing or invalid tokens. HTTP 403 is returned for insufficient scope.