ListServicePrincipalKeys
    • Dark
      Light

    ListServicePrincipalKeys

    • Dark
      Light

    Article summary

    Get
    /v1/accounts/{accountId}/servicePrincipals/{servicePrincipalId}/keys

    Availability

    Early Access: July 1, 2026

    Early Access is gated; contact the Backblaze Sales team for access.

    Limited Availability: July 1, 2026

    This API is available only to customers with access to the Backblaze Enterprise Web Console. For more information, contact the Backblaze Sales team.

    List keys for a Service Principal

    Returns the keys belonging to a Service Principal. Use showDeleted=true to include deleted keys in the response.

    Security
    HTTP
    Type bearer

    Short-lived bearer token obtained from GET /orgs/v1/authorize. Sent as Authorization - Bearer .

    Path parameters
    accountId
    stringRequired

    The numeric identifier of the account. Valid account IDs match 9[0-4][0-9]{10}.

    Pattern^9[0-4][0-9]{10}$
    Example912345678901
    servicePrincipalId
    stringRequired

    The identifier of the service principal.

    Pattern^[a-z0-9_-]{8,64}$
    Examplesp-control-plane
    Query parameters
    showDeleted
    boolean

    If true, include resources in the DELETED state. Defaults to false.

    Defaultfalse
    pageSize
    integer

    Maximum number of items to return. Default 50, maximum 1000.

    Minimum1
    Maximum1000
    Default50
    pageToken
    string

    Opaque pagination token returned from a previous List response.

    Responses
    200

    The request succeeded.

    {
      "servicePrincipalKeys": [
        {
          "name": "accounts/942733365851/servicePrincipals/2/keys/019e6a8a-678e-7298-9167-4bd65df2f272",
          "displayName": "prod deployer",
          "expireTime": "2026-06-01",
          "createTime": "2026-04-22T20:03:47Z",
          "updateTime": "2026-04-22T20:03:47Z",
          "disabled": false,
          "etag": "BwXk9a2J8p0="
        }
      ],
      "nextPageToken": "eyJwYWdlIjoyfQ=="
    }
    Expand All
    object
    servicePrincipalKeys
    Array of object (ServicePrincipalKey)
    object
    name
    string

    Resource name in the form accounts//servicePrincipals//keys/.

    Exampleaccounts/912345678901/servicePrincipals/123/keys/019e6a8a-678e-7298-9167-4bd65df2f272
    displayName
    string
    Exampleprod deployer
    expireTime
    string (date-time)

    Absolute expiration timestamp. If absent, the key does not expire.

    Example2026-06-01T00:00:00Z
    createTime
    string (date-time)
    Example2026-04-22T20:03:47Z
    updateTime
    string (date-time)
    Example2026-04-22T20:03:47Z
    disabled
    boolean

    When true, the key cannot mint new bearer tokens. Outstanding tokens remain valid until they expire.

    Examplefalse
    etag
    string

    Opaque concurrency token.

    ExampleBwXk9a2J8p0=
    nextPageToken
    string | null

    Pagination token for the next page, or null if there are no more results.

    401

    The request was not authenticated.

    HTTP StatusCodeDescription
    401UNAUTHORIZEDMissing, expired, or invalid bearer token.
    Expand All
    object
    requestId
    string

    Opaque correlation identifier matching the Request-Id response header. Include in support requests.

    Example4bf92f3577b34da6a3ce929d0e0e4736
    error
    object
    code
    integer

    Numeric error code.

    Example10
    message
    string

    Human-readable description of the error.

    Exampleetag mismatch
    details
    object

    Reserved for structured, non-sensitive diagnostic information related to the error condition.

    403

    The caller is not authorized to perform this operation.

    HTTP StatusCodeDescription
    403FORBIDDENThe authenticated principal lacks permission for this action.
    Expand All
    object
    requestId
    string

    Opaque correlation identifier matching the Request-Id response header. Include in support requests.

    Example4bf92f3577b34da6a3ce929d0e0e4736
    error
    object
    code
    integer

    Numeric error code.

    Example10
    message
    string

    Human-readable description of the error.

    Exampleetag mismatch
    details
    object

    Reserved for structured, non-sensitive diagnostic information related to the error condition.

    404

    The requested resource was not found.

    HTTP StatusCodeDescription
    404NOT_FOUNDThe resource does not exist or has been purged.
    Expand All
    object
    requestId
    string

    Opaque correlation identifier matching the Request-Id response header. Include in support requests.

    Example4bf92f3577b34da6a3ce929d0e0e4736
    error
    object
    code
    integer

    Numeric error code.

    Example10
    message
    string

    Human-readable description of the error.

    Exampleetag mismatch
    details
    object

    Reserved for structured, non-sensitive diagnostic information related to the error condition.

    429

    The request was rate-limited.

    HTTP StatusCodeDescription
    429TOO_MANY_REQUESTSRate limit exceeded. Use exponential backoff.
    Expand All
    object
    requestId
    string

    Opaque correlation identifier matching the Request-Id response header. Include in support requests.

    Example4bf92f3577b34da6a3ce929d0e0e4736
    error
    object
    code
    integer

    Numeric error code.

    Example10
    message
    string

    Human-readable description of the error.

    Exampleetag mismatch
    details
    object

    Reserved for structured, non-sensitive diagnostic information related to the error condition.

    500

    The server encountered an unexpected condition.

    HTTP StatusCodeDescription
    500INTERNALUnexpected server error. Include the requestId when contacting support.
    Expand All
    object
    requestId
    string

    Opaque correlation identifier matching the Request-Id response header. Include in support requests.

    Example4bf92f3577b34da6a3ce929d0e0e4736
    error
    object
    code
    integer

    Numeric error code.

    Example10
    message
    string

    Human-readable description of the error.

    Exampleetag mismatch
    details
    object

    Reserved for structured, non-sensitive diagnostic information related to the error condition.


    Was this article helpful?