Skip to content

Generate a new personal access token
Stable

Request

This endpoint allows clients to generate a new personal access token for a specific user and tenant.

Bodyapplication/jsonrequired
namestringrequired

name for the token.

descriptionstringrequired

description for the token.

expiry_atintegerrequired

exipy date for token.

cURL
curl -i -X POST \
  https://develop-api.esper.io/_mock/openapi/authn2/v0/personal-access-token/ \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "description": "string",
    "expiry_at": 0
  }'

Responses

Token successfully generated

Bodyapplication/json
idstring, (uuid)

Unique ID for the generated token.

namestring

Name for the token.

descriptionstring

Description for the token.

created_atstring, (timestamp)

Timestamp indicating when the token was created.

updated_atstring, (timestamp)

Timestamp indicating when the token was last updated.

tokenstring

The generated access token value.

prefixstring

Prefix for the generated token value.

expiry_atinteger

exipy date for token.

Response
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "description": "string", "created_at": "string", "updated_at": "string", "token": "string", "prefix": "string", "expiry_at": 0 }