API Keys

Replace an API key's scopes.

Changed on

Replaces the scopes on a key. The key value does not change. The new scopes must be a subset of those the calling key holds, and the calling key cannot change a key holding a scope it does not hold. The key making the request cannot change its own scopes. A caller can change its own user's keys; an administrator can change any user's. Recorded as an api_key_scopes_changed audit event with the scopes before and after and the calling user and API key. Requires the api-keys:write scope.

put/api/api-keys/{keyId}/scopes

Request

  • Base URL
    / (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    /api/api-keys/{keyId}/scopes
  • Auth
    HTTP bearer

Path parameters

keyIdstring required

Headers

Authorizationstring required

Request body

scopesstring[]

Response

The scopes were replaced.

bootstrapboolean
clientAddressstring

Session keys only: the address of the client that signed in, so a person can tell their sessions apart. Null for a long-lived key.

createdstring date-time
currentboolean

Whether this is the key making the request.

expiresAtstring date-time

Session keys only: when the key's maximum lifetime ends. Null for a long-lived key.

idstring
idleExpiresAtstring date-time

Session keys only: when the key expires unless it is used first. Null for a long-lived key.

lastUsedAtstring date-time

Session keys only: when the key was last used. Null for a long-lived key.

prefixstring
scopesstring[]
sessionboolean

Whether this is a session key, issued when a person signed in, rather than a long-lived key.

userAgentstring

Session keys only: the user agent of the client that signed in, such as a browser. Null for a long-lived key, or when the client sent none.

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status