tokens_create
Create an API token for read-only access
post/api/v1/tokens/create
Header parameters
authorizationstringRequired
Auth token in the Authorization header.
Body
namestringRequired
account_indexinteger · int64Required
expiryinteger · int64Required
Token expiry as a Unix timestamp in seconds, at least 5 minutes and at most 10 years after creation.
sub_account_accessbooleanRequired
scopesstringOptionalDefault:
Read-only token scope; currently only read.* is supported.
read.*Example: read.*Responses
200
A successful response.
application/json
Fields with zero or empty values may be omitted; handle optional properties when decoding responses.
codeinteger · int32RequiredExample:
200messagestringOptional
token_idinteger · int64Required
api_tokenstringOptional
namestringRequired
account_indexinteger · int64Required
expiryinteger · int64Required
Unix timestamp in seconds.
sub_account_accessbooleanRequired
revokedbooleanRequired
scopesstringRequired
Granted read-only scopes. Currently read.* is the supported scope.
400
Bad request
application/json
post/api/v1/tokens/create
POST /api/v1/tokens/create HTTP/1.1
Host: mainnet.zklighter.elliot.ai
authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 88
"name='text'&account_index=1&expiry=1&sub_account_access=true&scopes='read.*'"{
"code": 200,
"message": "text",
"token_id": 1,
"api_token": "text",
"name": "text",
"account_index": 1,
"expiry": 1,
"sub_account_access": true,
"revoked": true,
"scopes": "text"
}Last updated
Was this helpful?