Skip to main content
POST
/
iam
/
clients
/
{clientId}
/
tokens
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
api_token_create = client.iam.api_tokens.create(
    client_id=0,
    client_user={},
    exp_date="2021-01-01 12:00:00+00:00",
    name="My token",
)
print(api_token_create.token)
{
  "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 | null
required

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

Example:

"2021-01-01 12:00:00+00:00"

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.

I