Service accounts
/v1/service-accounts- post
/v1/service-accounts - DEL
/v1/service-accounts/{id} - post
/v1/service-accounts/{id}/keys - DEL
/v1/service-accounts/{id}/keys/{keyId} - post
/v1/service-accounts/{id}/keys/{keyId}/rotate
List service accounts
/v1/service-accountsParameters
limitcursor
Responses
200
serviceAccountsidnameownerUserIdteamIdcreatedBycreatedAtexpiresAtrevokedAtkeysidserviceAccountIdownerUserIdscopeteamId
prefixlabelcreatedBycreatedAtexpiresAtrevokedAtlastUsedAtrotatedFrom
nextCursor
429
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl "$NEXUS_URL/v1/service-accounts" \
-H "Authorization: Bearer $NEXUS_API_KEY"Create service account
post
/v1/service-accountsParameters
Idempotency-Key
Request body · application/json
nameownerUserIdteamexpiresAtdryRun
Responses
200
idnameownerUserIdteamIdcreatedBycreatedAtexpiresAtrevokedAtkeysidserviceAccountIdownerUserIdscopeteamId
prefixlabelcreatedBycreatedAtexpiresAtrevokedAtlastUsedAtrotatedFrom
dryRun
201
idnameownerUserIdteamIdcreatedBycreatedAtexpiresAtrevokedAtkeysidserviceAccountIdownerUserIdscopeteamId
prefixlabelcreatedBycreatedAtexpiresAtrevokedAtlastUsedAtrotatedFrom
dryRun
400
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 101 | service_account_limit | The 101st is a 409 `service_account_limit` |
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | Not valid: no name (1 to 64 characters), an `expiresAt` that is not a future time within 365 days (`invalid_expiry`), an owner who is not a member (`owner_not_a_member`) or a team that is not the organization's (`unknown_team`) | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X POST "$NEXUS_URL/v1/service-accounts" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "Platform",
"team": "platform",
"expiresAt": "2026-10-01T00:00:00Z"
}'Revoke service account
DEL
/v1/service-accounts/{id}Parameters
iddryRunIdempotency-Key
Responses
200
idalreadydryRunrevokedAtkeysRevoked
400
errormessagetypecodeparamnexusminimum
404
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | `dryRun` is not `1`, `true`, `0` or `false` | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such service account in this organization (`unknown_service_account`) | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X DELETE "$NEXUS_URL/v1/service-accounts/<id>" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Issue service account key
post
/v1/service-accounts/{id}/keysParameters
idIdempotency-Key
Request body · application/json
labelexpiresAt
Responses
201
idserviceAccountIdownerUserIdscopeteamId
prefixlabelcreatedBycreatedAtexpiresAtrevokedAtlastUsedAtrotatedFromtoken
400
errormessagetypecodeparamnexusminimum
404
errormessagetypecodeparamnexusminimum
409
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | No label (1 to 80 characters), or an `expiresAt` that is not a future time within the account's life (`invalid_expiry`) | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such service account in this organization (`unknown_service_account`) | |
| 409 | The account is revoked or expired, or holds 5 live keys | |
| 409 | service_account_key_limit | The sixth is a 409 `service_account_key_limit` |
| 409 | service_account_revoked | A revoked or expired account takes no key (409 `service_account_revoked`, `service_account_expired`) |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X POST "$NEXUS_URL/v1/service-accounts/<id>/keys" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"label": "CI",
"expiresAt": "2026-10-01T00:00:00Z"
}'Revoke service account key
DEL
/v1/service-accounts/{id}/keys/{keyId}Parameters
idkeyIdIdempotency-Key
Responses
200
idserviceAccountIdownerUserIdscopeteamId
prefixlabelcreatedBycreatedAtexpiresAtrevokedAtlastUsedAtrotatedFrom
404
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such key in this service account (`unknown_service_account_key`) | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X DELETE "$NEXUS_URL/v1/service-accounts/<id>/keys/<keyId>" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Rotate service account key
post
/v1/service-accounts/{id}/keys/{keyId}/rotateParameters
idkeyIdIdempotency-Key
Request body (optional) · application/json
labelexpiresAt
Responses
200
idserviceAccountIdownerUserIdscopeteamId
prefixlabelcreatedBycreatedAtexpiresAtrevokedAtlastUsedAtrotatedFromtoken
400
errormessagetypecodeparamnexusminimum
404
errormessagetypecodeparamnexusminimum
409
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | A label that is not 1 to 80 characters, or an `expiresAt` that is not a future time within the account's life (`invalid_expiry`) | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such key in this service account, or no such service account (`unknown_service_account_key`, `unknown_service_account`) | |
| 409 | The key is not live (`key_not_live`), or its account is revoked or expired | |
| 409 | key_not_live | A key that is revoked or expired does not rotate (409 `key_not_live`) |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X POST "$NEXUS_URL/v1/service-accounts/<id>/keys/<keyId>/rotate" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"label": "CI",
"expiresAt": "2026-10-01T00:00:00Z"
}'