Skip to main content

Get API tokens by name

GET 

/api/admin/api-tokens/:name

Retrieves all API tokens that match a given token name. Because token names are not unique, this endpoint will always return a list. If no tokens with the provided name exist, the list will be empty. Otherwise, it will contain all the tokens with the given name.

Request

Path Parameters

    name stringrequired

Responses

apiTokensSchema

Schema

    tokens

    object[]

    required

    A list of Unleash API tokens.

  • Array [

  • secret stringrequired

    The token used for authentication.

    Example: project:environment.xyzrandomstring
    username stringdeprecated

    This property was deprecated in Unleash v5. Prefer the tokenName property instead.

    Example: a-name
    tokenName stringrequired

    A unique name for this particular token

    Example: some-user
    type stringrequired

    The type of API token

    Possible values: [client, admin, frontend]

    Example: client
    environment string

    The environment the token has access to. * if it has access to all environments.

    Example: development
    project stringrequired

    The project this token belongs to.

    Example: developerexperience
    projects string[]required

    The list of projects this token has access to. If the token has access to specific projects they will be listed here. If the token has access to all projects it will be represented as [*]

    Example: ["developerexperience","enterprisegrowth"]
    expiresAt date-timenullable

    The token's expiration date. NULL if the token doesn't have an expiration set.

    Example: 2023-04-19T08:15:14.000Z
    createdAt date-timerequired

    When the token was created.

    Example: 2023-04-19T08:15:14.000Z
    seenAt date-timenullable

    When the token was last seen/used to authenticate with. NULL if the token has not yet been used for authentication.

    Example: 2023-04-19T08:15:14.000Z
    alias stringnullable

    Alias is no longer in active use and will often be NULL. It's kept around as a way of allowing old proxy tokens created with the old metadata format to keep working.

    Example: randomid-or-some-alias
  • ]

Loading...