Gatana logoGatana Docs
RoutesUsersUseridPersonal access tokens

/users/{userId}/personal-access-tokens

Create a personal access token for the user and return its API key

POST
/users/{userId}/personal-access-tokens
AuthorizationBearer <token>

In: header

Path Parameters

userId*string

ID of the user

Request Body

application/json

name*string

Display name of the token

Length1 <= length
profileIds?array<>

IDs of the profiles the token uses

Response Body

application/json

curl -X POST "https://YOUR_ORG_ID.gatana.ai/api/v1/users/string/personal-access-tokens" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "token": {
    "tenantId": "string",
    "userId": "string",
    "id": "string",
    "name": "string",
    "apiKey": "string",
    "profileIds": [
      "string"
    ],
    "createdAt": "string",
    "lastUsedAt": "string"
  }
}