POST
/
iam
/
clients
/
{clientId}
/
tokens
Create API Token
curl --request POST \
  --url https://api.gcore.com/iam/clients/{clientId}/tokens \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "My token",
  "description": "It'\''s my token",
  "exp_date": null,
  "client_user": {
    "role": {
      "id": 1,
      "name": "Administrators"
    }
  }
}'
{
  "token": "<string>"
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

clientId
integer
required

Account ID.

Body

application/json
name
string
required

API token name.

Example:

"My token"

exp_date
string
required

Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If null, then the API token will never expire.

Example:

null

client_user
object
required

API token role.

description
string

API token description.

Example:

"It's my token"

Response

OK.

token
string

API token. Copy it, because you will not be able to get it again. We do not store tokens. All responsibility for token storage and usage is on the issuer.