Creates a new key for an API token and sets all other keys to expire.
Required permission
Account > Admin > ApiTokens > Update
Path parameters
tokenId
string requiredID of the API token
Request body
- {object}
otherKeysExpiresAt
stringExpiry time for all existing keys. Defaults to immediate expiry.
Response body
- {object}Response object.
data
{object} requiredResult data.key
{object} requiredThe newly created API key.id
string requiredUUID of the new API key.issuedAt
string requiredThe time the key was issued.token
string requiredThe API token for authentication.
API
CLI
JS Client
POST /v1/tokens/{tokenId}/keys
POST /v1/teams/{teamId}/tokens/{tokenId}/keys
Example request
Request body
curl --header "Content-Type: application/json" \
--header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
--request POST \
--data '{}' \
https://api.northflank.com/v1/tokens/{tokenId}/keysExample response
200 OK
The newly created API key and token.
JSON
{
"data": {
"key": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"issuedAt": "2021-01-20T11:19:53.175Z"
},
"token": "eyJhbGciOiJIUzI1NiIs..."
}
}