Skip to content

Authentication

Quantify issues access tokens under /oauth and expects those tokens on /v1 requests as bearer tokens.

  • Token endpoint: POST /oauth/token
  • Revocation endpoint: POST /oauth/revoke
  • Content type: application/x-www-form-urlencoded
  • Client authentication: HTTP Basic auth or form client_id plus client_secret
  • Do not send both client-authentication methods in the same request
ScopeDescription
issues:readRead issues, comments, activity, links, attachments, and agent threads
issues:writeCreate and update issues, comments, agent messages, and links
projects:readRead projects and project links
projects:writeCreate and update projects and project links
members:readRead workspace members
teams:readRead teams and configured SCM repository context
workspace:readRead workspace metadata and issue catalogs

Issues an access token.

Grant typeNotes
client_credentialsSupports optional scope
authorization_codeRequires code and redirect_uri; rejects scope
refresh_tokenRequires refresh_token; supports optional scope
FieldUsed byRequiredNotes
grant_typeallyesclient_credentials, authorization_code, or refresh_token
scopeclient credentials, refresh tokennoSpace-delimited scopes
codeauthorization codeyesAuthorization code to exchange
redirect_uriauthorization codeyesMust match the authorization flow
code_verifierauthorization codenoPKCE verifier
refresh_tokenrefresh tokenyesRefresh token to exchange
client_idallyes if not using Basic authClient identifier
client_secretallyes if not using Basic authClient secret
Terminal window
curl -X POST "$API_BASE_URL/oauth/token" \
-H "Authorization: Basic $(printf '%s:%s' "$CLIENT_ID" "$CLIENT_SECRET" | base64)" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "scope=issues:read projects:read teams:read"

Response 200 OK:

{
"access_token": "<access-token>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "issues:read projects:read teams:read"
}
Terminal window
curl -X POST "$API_BASE_URL/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=authorization_code" \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET" \
--data-urlencode "code=<authorization-code>" \
--data-urlencode "redirect_uri=https://app.example.com/oauth/callback" \
--data-urlencode "code_verifier=<pkce-verifier>"

Response 200 OK:

{
"access_token": "<access-token>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "issues:read issues:write",
"refresh_token": "<refresh-token>"
}
Terminal window
curl -X POST "$API_BASE_URL/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=refresh_token" \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET" \
--data-urlencode "refresh_token=<refresh-token>" \
--data-urlencode "scope=issues:read issues:write"

Response 200 OK:

{
"access_token": "<access-token>",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "issues:read issues:write",
"refresh_token": "<refresh-token>"
}
  • Responses send Cache-Control: no-store
  • Responses send Pragma: no-cache
  • refresh_token is omitted when not applicable
  • authorization_code requests must not include scope
StatuserrorMeaning
400invalid_requestMissing or malformed form input
400invalid_scopeRequested scope is invalid or not allowed
400invalid_grantAuthorization code or refresh token is invalid, expired, or unusable
400unsupported_grant_typeUnknown grant type
401invalid_clientClient authentication failed
429temporarily_unavailableOAuth rate limit exceeded
503temporarily_unavailableOAuth service temporarily unavailable

Example:

{
"error": "invalid_client",
"error_description": "Client authentication failed."
}

Revokes an access token or refresh token.

FieldRequiredNotes
tokenyesToken to revoke
token_type_hintnoOptional hint such as access_token or refresh_token
client_idyes if not using Basic authClient identifier
client_secretyes if not using Basic authClient secret
Terminal window
curl -X POST "$API_BASE_URL/oauth/revoke" \
-H "Authorization: Basic $(printf '%s:%s' "$CLIENT_ID" "$CLIENT_SECRET" | base64)" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "token=<refresh-token>" \
--data-urlencode "token_type_hint=refresh_token"

Response 200 OK with no body.

Terminal window
curl "$API_BASE_URL/v1/workspace" \
-H "Authorization: Bearer $ACCESS_TOKEN"
StatusCodeMeaning
401unauthorizedMissing bearer token
401invalid_tokenInvalid or expired token
403insufficient_scopeToken does not include the required scope

Example missing token:

{
"code": "unauthorized",
"message": "A bearer access token is required."
}