Skip to content

Service accounts and keys ​

Service accounts for CI and automation, their keys, policies, delegations and audit.

Operations of this group with their access rule, retry rule, parameters and answers. Every request carries a key: Authorization: Bearer <key> (see Authentication).

Operations ​

List service accounts ​

GET HEAD /api/v1/service-accounts

Access: Service administration permission service-account.read · Retry: Safe to repeat (read)

Lists the service accounts the caller may see, ordered by ID, 50 per page, each with name, enabled flag, revision, policy bindings and creation time; continue with after set to next. The bootstrap key sees all of them, a delegate only the targets where its delegation includes service-account.read; without that the list is empty rather than refused.

Parameters

NameInTypeRequiredRules
afterquerystring (uuid)no—

Response 200

FieldTypeRequiredRules
itemsarray of objectyesup to 50 items
items[].idstring (uuid)yes—
items[].namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
items[].enabledbooleanyes—
items[].revisionintegeryes1–2147483647
items[].bindingsarray of objectyesup to 64 items
items[].bindings[].resourceobjectyes—
items[].bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
items[].createdAtstring (date-time)yes—
nextstring (uuid)yesmay be null

Responses: 200, 400, 401, 403, 404, 409, 422, 503, 507

Example

bash
curl -X GET "$ARKVORY_URL/api/v1/service-accounts" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Create a service account ​

POST /api/v1/service-accounts

Access: Bootstrap key (installation recovery key) · Retry: Do not repeat automatically

Creates a machine identity for CI or an application with name (3–64 letters, digits or _.-) and its policy bindings: for each repository, the exact actions its keys may use (such as upload.create or content.read). Answers 201 with the account; then issue a key with issueServiceKey. A taken name is a 409 already_exists.

Request body (application/json)

FieldTypeRequiredRules
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read

Response 201

FieldTypeRequiredRules
idstring (uuid)yes—
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
enabledbooleanyes—
revisionintegeryes1–2147483647
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
createdAtstring (date-time)yes—

Responses: 201, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

Example

bash
curl -X POST "$ARKVORY_URL/api/v1/service-accounts" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"<name>","bindings":[]}'

Get a service account ​

GET HEAD /api/v1/service-accounts/{id}

Access: Service administration permission service-account.read · Retry: Safe to repeat (read)

Returns the account's name, enabled flag, revision, policy bindings and creation time. For a delegate, an account it was not assigned answers 404 and a missing action on an assigned one 403.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—

Response 200

FieldTypeRequiredRules
idstring (uuid)yes—
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
enabledbooleanyes—
revisionintegeryes1–2147483647
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
createdAtstring (date-time)yes—

Responses: 200, 400, 401, 403, 404, 409, 422, 503, 507

Example

bash
curl -X GET "$ARKVORY_URL/api/v1/service-accounts/$ID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Enable or disable a service account ​

PATCH /api/v1/service-accounts/{id}

Access: Service administration permission service-account.manage · Retry: Repeat only with the expected revision (compare-and-swap)

Sets enabled; expectedRevision must be the current revision, otherwise 409 revision_mismatch. Only this flag changes here (the name cannot). Disabling blocks every key of the account from the next request; enabling restores the keys that are neither expired nor revoked. A delegate may do it only when the whole current policy lies within its ceiling.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—

Request body (application/json)

FieldTypeRequiredRules
expectedRevisionintegeryes1–2147483646
enabledbooleanyes—

Response 200

FieldTypeRequiredRules
idstring (uuid)yes—
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
enabledbooleanyes—
revisionintegeryes1–2147483647
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
createdAtstring (date-time)yes—

Responses: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

Example

bash
curl -X PATCH "$ARKVORY_URL/api/v1/service-accounts/$ID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":1,"enabled":false}'

Get the policy of a service account ​

GET HEAD /api/v1/service-accounts/{id}/policy

Access: Service administration permission policy.read · Retry: Safe to repeat (read)

Returns the account with its policy bindings and revision, like getServiceAccount, for a caller that holds policy.read. A key's effective permissions are the intersection of this policy and the key's own bindings, per repository and action.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—

Response 200

FieldTypeRequiredRules
idstring (uuid)yes—
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
enabledbooleanyes—
revisionintegeryes1–2147483647
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
createdAtstring (date-time)yes—

Responses: 200, 400, 401, 403, 404, 409, 422, 503, 507

Example

bash
curl -X GET "$ARKVORY_URL/api/v1/service-accounts/$ID/policy" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Replace the policy of a service account ​

PUT /api/v1/service-accounts/{id}/policy

Access: Service administration permission policy.manage · Retry: Repeat only with the expected revision (compare-and-swap)

Replaces the account's bindings (up to 64, each a repository with its exact actions); expectedRevision must be the current revision, otherwise 409 revision_mismatch. Every key follows the change from its next request: narrowing takes effect at once, widening never goes beyond a key's own bindings. A delegate needs both the current and the new policy to lie within its ceiling.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—

Request body (application/json)

FieldTypeRequiredRules
expectedRevisionintegeryes1–2147483646
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read

Response 200

FieldTypeRequiredRules
idstring (uuid)yes—
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
enabledbooleanyes—
revisionintegeryes1–2147483647
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
createdAtstring (date-time)yes—

Responses: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

Example

bash
curl -X PUT "$ARKVORY_URL/api/v1/service-accounts/$ID/policy" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":1,"bindings":[]}'

List the keys of a service account ​

GET HEAD /api/v1/service-accounts/{id}/keys

Access: Service administration permission credential.read · Retry: Safe to repeat (read)

Lists key metadata of the account ordered by ID, 50 per page: name, state (pending, active, revoked), bindings, creation, expiry, activation deadline and the key it was rotated from; never secrets or hashes. Continue with after set to next. Expiry does not change state, so compare expiresAt with the current time.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—
afterquerystring (uuid)no—

Response 200

FieldTypeRequiredRules
itemsarray of objectyesup to 50 items
items[].idstring (uuid)yes—
items[].accountIdstring (uuid)yes—
items[].namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
items[].statestringyesone of pending, active, revoked
items[].bindingsarray of objectyesup to 64 items
items[].bindings[].resourceobjectyes—
items[].bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
items[].createdAtstring (date-time)yes—
items[].expiresAtstring (date-time)yes—
items[].activationExpiresAtstring (date-time)yes—
items[].rotatedFromstring (uuid)yesmay be null
nextstring (uuid)yesmay be null

Responses: 200, 400, 401, 403, 404, 409, 422, 503, 507

Example

bash
curl -X GET "$ARKVORY_URL/api/v1/service-accounts/$ID/keys" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Issue a key for a service account ​

POST /api/v1/service-accounts/{id}/keys

Access: Service administration permission credential.manage · Retry: Safe to repeat with the same Idempotency-Key

Issues a pending key with name, bindings (effective only where the account policy allows them too) and optional expiresAt (UTC; 90 days by default, at most 365, and for a delegate never beyond its own key). The first answer is 201 with key and the secret, shown only this once; a repeat with the same Idempotency-Key and body is 200 with the metadata only, a different body a 409. The holder must call activateServiceKey with the secret within 15 minutes; if the secret was lost, revoke the key and issue a new one under a new Idempotency-Key.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—
Idempotency-Keyheaderstringyesup to 128 characters

Request body (application/json)

FieldTypeRequiredRules
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
expiresAtstring (date-time)no—

Response 200

FieldTypeRequiredRules
keyobjectyes—
key.idstring (uuid)yes—
key.accountIdstring (uuid)yes—
key.namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
key.statestringyesone of pending, active, revoked
key.bindingsarray of objectyesup to 64 items
key.bindings[].resourceobjectyes—
key.bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
key.createdAtstring (date-time)yes—
key.expiresAtstring (date-time)yes—
key.activationExpiresAtstring (date-time)yes—
key.rotatedFromstring (uuid)yesmay be null
secretstringno—

Responses: 200, 201, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

Example

bash
curl -X POST "$ARKVORY_URL/api/v1/service-accounts/$ID/keys" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"<name>","bindings":[]}'

Read the audit of a service account ​

GET HEAD /api/v1/service-accounts/{id}/audit

Access: Service administration permission service-audit.read · Retry: Safe to repeat (read)

Returns, oldest first, up to 100 events of the account after the sequence after (default 0): account, policy and key changes such as issue, rotation, activation and revocation, each with actor, action, key and time. To read further, pass the last sequence as after; there is no next field. Only the newest 100 000 events of the server are kept.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—
afterquerystringnoa whole number in decimal digits, sent as a string

Response 200

FieldTypeRequiredRules
itemsarray of objectyesup to 100 items
items[].sequencestringyes—
items[].actorstringyes—
items[].actionstringyes—
items[].accountIdstring (uuid)yes—
items[].keyIdstring (uuid)yesmay be null
items[].occurredAtstring (date-time)yes—

Responses: 200, 400, 401, 403, 404, 409, 422, 503, 507

Example

bash
curl -X GET "$ARKVORY_URL/api/v1/service-accounts/$ID/audit" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Get a key ​

GET HEAD /api/v1/api-keys/{id}

Access: Service administration permission credential.read · Retry: Safe to repeat (read)

Returns the metadata of one managed key: its account, name, state, bindings, creation, expiry, activation deadline and the key it was rotated from; never the secret or its hash.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—

Response 200

FieldTypeRequiredRules
idstring (uuid)yes—
accountIdstring (uuid)yes—
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
statestringyesone of pending, active, revoked
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
createdAtstring (date-time)yes—
expiresAtstring (date-time)yes—
activationExpiresAtstring (date-time)yes—
rotatedFromstring (uuid)yesmay be null

Responses: 200, 400, 401, 403, 404, 409, 422, 503, 507

Example

bash
curl -X GET "$ARKVORY_URL/api/v1/api-keys/$ID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Rotate a key ​

POST /api/v1/api-keys/{id}/rotate

Access: Service administration permission credential.manage · Retry: Safe to repeat with the same Idempotency-Key

Issues a pending successor of key id for the same account with the same or narrower bindings, answering like issueServiceKey: 201 with the one-time secret, 200 with metadata only on a repeat with the same Idempotency-Key. Once the successor is activated, the old key stays valid for at most 24 more hours; revoke it explicitly when the new one works, but only after the jobs it started have finished. Delegations held by an operator key are not copied to its successor.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—
Idempotency-Keyheaderstringyesup to 128 characters

Request body (application/json)

FieldTypeRequiredRules
namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
bindingsarray of objectyesup to 64 items
bindings[].resourceobjectyes—
bindings[].resource.kindstringyesone of repository
bindings[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
expiresAtstring (date-time)no—

Response 200

FieldTypeRequiredRules
keyobjectyes—
key.idstring (uuid)yes—
key.accountIdstring (uuid)yes—
key.namestringyesmatches ^[a-zA-Z0-9_.-]{3,64}$
key.statestringyesone of pending, active, revoked
key.bindingsarray of objectyesup to 64 items
key.bindings[].resourceobjectyes—
key.bindings[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read
key.createdAtstring (date-time)yes—
key.expiresAtstring (date-time)yes—
key.activationExpiresAtstring (date-time)yes—
key.rotatedFromstring (uuid)yesmay be null
secretstringno—

Responses: 200, 201, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

Example

bash
curl -X POST "$ARKVORY_URL/api/v1/api-keys/$ID/rotate" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":"<name>","bindings":[]}'

Revoke a key ​

POST /api/v1/api-keys/{id}/revoke

Access: Service administration permission credential.manage · Retry: Safe to repeat: the same request has the same effect

Revokes the key for good: its next request fails, while a download already running is not cut off. Repeating succeeds with 204. Keys that a revoked operator key issued and that were already activated stay valid; revoke them separately.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—

Responses: 204, 400, 401, 403, 404, 405, 409, 422, 503, 507

Example

bash
curl -X POST "$ARKVORY_URL/api/v1/api-keys/$ID/revoke" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Activate a key ​

POST /api/v1/auth/activate-key

Access: The issued key, before or after activation · Retry: Safe to repeat: the same request has the same effect

Proves that the holder received a newly issued key: call it with that key as Authorization: Bearer within 15 minutes of issue, and the key becomes active (204). Repeating is safe and does not extend the expiry. Activating a rotated key cuts the remaining lifetime of the key it replaces to at most 24 hours.

Responses: 204, 400, 401, 403, 404, 405, 409, 422, 503, 507

Example

bash
curl -X POST "$ARKVORY_URL/api/v1/auth/activate-key" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

List the delegations of a key ​

GET HEAD /api/v1/api-keys/{id}/delegations

Access: Bootstrap key, or the key itself · Retry: Safe to repeat (read)

Returns the delegations held by operator key id, up to 64 including disabled ones: for each target account its revision, whether it is enabled, the administration actions (such as credential.manage) and the ceiling of repository bindings it may hand out. A delegate reads its own here (its key ID is credentialId in getOwnPermissions); another key's list is a 403.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—

Response 200

FieldTypeRequiredRules
itemsarray of objectyesup to 64 items
items[].keyIdstring (uuid)yes—
items[].targetAccountIdstring (uuid)yes—
items[].enabledbooleanyes—
items[].revisionintegeryes1–2147483647
items[].actionsarray of stringyesup to 7 items; no repeated items; each: one of service-account.read, service-account.manage, policy.read, policy.manage, credential.read, credential.manage, service-audit.read
items[].ceilingarray of objectyesup to 16 items
items[].ceiling[].resourceobjectyes—
items[].ceiling[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read

Responses: 200, 400, 401, 403, 404, 409, 422, 503, 507

Example

bash
curl -X GET "$ARKVORY_URL/api/v1/api-keys/$ID/delegations" \
  -H "Authorization: Bearer $ARKVORY_TOKEN"

Delegate the administration of a service account ​

PUT /api/v1/api-keys/{id}/delegations/{accountId}

Access: Bootstrap key (installation recovery key) · Retry: Repeat only with the expected revision (compare-and-swap)

Lets key id administer the service account accountId with the given actions (service-account.read, service-account.manage, policy.read, policy.manage, credential.read, credential.manage, service-audit.read) within ceiling, up to 16 repository bindings it may hand out; manage does not imply read. expectedRevision is 0 to create and the record's current revision to change or re-enable it, otherwise 409. The key must be active and issued by the bootstrap key, and an account cannot both hold delegations and be the target of one, so delegation never chains.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—
accountIdpathstring (uuid)yes—

Request body (application/json)

FieldTypeRequiredRules
expectedRevisionintegeryes0–2147483646
actionsarray of stringyes1–7 items; no repeated items; each: one of service-account.read, service-account.manage, policy.read, policy.manage, credential.read, credential.manage, service-audit.read
ceilingarray of objectyesup to 16 items
ceiling[].resourceobjectyes—
ceiling[].resource.kindstringyesone of repository
ceiling[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
ceiling[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read

Response 200

FieldTypeRequiredRules
keyIdstring (uuid)yes—
targetAccountIdstring (uuid)yes—
enabledbooleanyes—
revisionintegeryes1–2147483647
actionsarray of stringyesup to 7 items; no repeated items; each: one of service-account.read, service-account.manage, policy.read, policy.manage, credential.read, credential.manage, service-audit.read
ceilingarray of objectyesup to 16 items
ceiling[].resourceobjectyes—
ceiling[].resource.kindstringyesone of repository
ceiling[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
ceiling[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read

Responses: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

Example

bash
curl -X PUT "$ARKVORY_URL/api/v1/api-keys/$ID/delegations/$ACCOUNTID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":0,"actions":["service-account.read"],"ceiling":[]}'

Withdraw a delegation ​

DELETE /api/v1/api-keys/{id}/delegations/{accountId}

Access: Bootstrap key (installation recovery key) · Retry: Repeat only with the expected revision (compare-and-swap)

Disables the delegation of key id over accountId; the JSON body carries expectedRevision, the record's current revision. The record stays as a disabled entry without actions and with a higher revision, returned with 200; after a lost answer read it with listServiceDelegations instead of repeating, since the old revision is a 409. Keys the delegate already issued and activated keep working: revoke them or disable the account separately.

Parameters

NameInTypeRequiredRules
idpathstring (uuid)yes—
accountIdpathstring (uuid)yes—

Request body (application/json)

FieldTypeRequiredRules
expectedRevisionintegeryes1–2147483646

Response 200

FieldTypeRequiredRules
keyIdstring (uuid)yes—
targetAccountIdstring (uuid)yes—
enabledbooleanyes—
revisionintegeryes1–2147483647
actionsarray of stringyesup to 7 items; no repeated items; each: one of service-account.read, service-account.manage, policy.read, policy.manage, credential.read, credential.manage, service-audit.read
ceilingarray of objectyesup to 16 items
ceiling[].resourceobjectyes—
ceiling[].resource.kindstringyesone of repository
ceiling[].resource.idstringyesmatches ^[a-z0-9][a-z0-9_-]{0,63}$
ceiling[].actionsarray of stringyes1–24 items; no repeated items; each: one of repository.read, storage.read, storage.manage, diagnostics.read, artifact.read, artifact.list, artifact.delete, artifact.promote, content.read, upload.create, upload.read, upload.write, upload.complete, upload.cancel, job.read, package.read, package.publish, asset.read, asset.write, asset.restore, annotation.read, annotation.write, reference.write, audit.read

Responses: 200, 400, 401, 403, 404, 405, 409, 413, 415, 422, 503, 507

Example

bash
curl -X DELETE "$ARKVORY_URL/api/v1/api-keys/$ID/delegations/$ACCOUNTID" \
  -H "Authorization: Bearer $ARKVORY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"expectedRevision":1}'

Arkvory · ProAnimaStudio