Skip to main content

Create a token for a service account.

POST 

/api/admin/service-account/:id/token

Creates a new token for the service account identified by the id.

Request

Path Parameters

    id stringrequired

Body

required

#/components/schemas/createPatSchema

    description stringrequired

    The PAT's description.

    Example: user:xyzrandomstring
    expiresAt date-timerequired

    The PAT's expiration date.

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

Responses

The resource was successfully created.

Response Headers

  • location

    string

    The location of the newly created resource.

Schema

    id integerrequired

    The PAT's ID. PAT IDs are incrementing integers. In other words, a more recently created PAT will always have a higher ID than an older one.

    Possible values: >= 1

    Example: 1
    secret string

    The token used for authentication. It is automatically generated by Unleash when the PAT is created and that is the only time this property is returned.

    Example: user:xyzrandomstring
    createdAt date-timerequired

    The date and time of when the PAT was created.

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

    When the PAT was last seen/used to authenticate with. null if it has not been used yet.

    Example: 2023-04-19T08:15:14.000Z
    userId integer

    The ID of the user this PAT belongs to.

    Example: 1337
    description stringrequired

    The PAT's description.

    Example: user:xyzrandomstring
    expiresAt date-timerequired

    The PAT's expiration date.

    Example: 2023-04-19T08:15:14.000Z
Loading...