Skip to main content
Docs

APIKeyResource

Warning

API keys is currently in beta. The API may change before general availability.

An interface that describes an API key used to authenticate requests to your application's API endpoints on behalf of a user or organization.

Properties

  • Name
    id
    Type
    string
    Description

    The unique identifier of the API key.

  • Name
    type
    Type
    string
    Description

    The type of the API key. Currently always 'api_key'.

  • Name
    name
    Type
    string
    Description

    The API key's name.

  • Name
    subject
    Type
    string
    Description

    The user or organization ID that the API key is associated with.

  • Name
    scopes
    Type
    string[]
    Description

    An array of scopes that define what the API key can access.

  • Name
    claims
    Type
    Record<string, any> | null
    Description

    Custom claims associated with the API key.

  • Name
    revoked
    Type
    boolean
    Description

    A boolean indicating whether the API key has been revoked.

  • Name
    revocationReason
    Type
    string | null
    Description

    The reason for revoking the API key, if it has been revoked.

  • Name
    expired
    Type
    boolean
    Description

    A boolean indicating whether the API key has expired.

  • Name
    expiration
    Type
    Date | null
    Description

    The expiration date and time of the API key. null if the API key never expires.

  • Name
    createdBy
    Type
    string | null
    Description

    The user ID for the user creating the API key.

  • Name
    description
    Type
    string | null
    Description

    An optional description for the API key.

  • Name
    secret?
    Type
    string | undefined
    Description

    The API key secret. This property is only present in the response from create() and cannot be retrieved later.

  • Name
    lastUsedAt
    Type
    Date | null
    Description

    The date and time when the API key was last used to authenticate a request.

  • Name
    createdAt
    Type
    Date
    Description

    The date when the API key was created.

  • Name
    updatedAt
    Type
    Date
    Description

    The date when the API key was last updated.

Feedback

What did you think of this content?

Last updated on