Skip to main content

Platform API: Gateway tokens

Gateway token rotation and revocation operations

List active gateway tokens​

GET /gateways/{gatewayId}/tokens

Code samples


curl -X GET https://localhost:9243/api/v0.9/gateways/{gatewayId}/tokens \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Returns all active tokens for the specified gateway. Token hashes and salts are never exposed. Access is validated against the organization in the JWT token.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `ap:gateway:token:read`, `ap:gateway:token:manage`, `ap:gateway:manage`

Parameters​

NameInTypeRequiredDescription
gatewayIdpathstringtrueGateway ID consisting of the handle (unique slug identifier) of the Gateway.
limitqueryintegerfalseMaximum number of items to return per page.
offsetqueryintegerfalseZero-based index of the first item to return.

Detailed descriptions​

gatewayId: Gateway ID consisting of the handle (unique slug identifier) of the Gateway.

Example responses

200 Response

{
"count": 0,
"list": [
{
"id": "abc12345-f678-90de-f123-456789abcdef",
"status": "active",
"createdAt": "2025-10-14T10:30:00Z",
"revokedAt": null
}
],
"pagination": {
"total": 10,
"offset": 0,
"limit": 10
}
}

401 Response

{
"status": "error",
"code": "UNAUTHORIZED",
"message": "Authorization header is required, or the token is invalid or expired."
}

404 Response

{
"status": "error",
"code": "NOT_FOUND",
"message": "The specified resource does not exist."
}

500 Response

{
"status": "error",
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred.",
"trackingId": "4f1c6f2e-8a4b-4c93-b1de-9f2f6f0c2a11"
}

Responses​

StatusMeaningDescriptionSchema
200OKList of active tokensGatewayTokenListResponse
401UnauthorizedUnauthorized. Authentication credentials are missing or invalid.Error
404Not FoundNot Found. The specified resource does not exist.Error
500Internal Server ErrorInternal Server Error.Error

Rotate gateway token​

POST /gateways/{gatewayId}/tokens

Code samples


curl -X POST https://localhost:9243/api/v0.9/gateways/{gatewayId}/tokens \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Generates a new authentication token for the gateway. The existing token remains active to enable zero-downtime rotation. Access is validated against the organization in the JWT token.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `ap:gateway:token:create`, `ap:gateway:token:manage`, `ap:gateway:manage`

Parameters​

NameInTypeRequiredDescription
gatewayIdpathstringtrueGateway ID consisting of the handle (unique slug identifier) of the Gateway.

Detailed descriptions​

gatewayId: Gateway ID consisting of the handle (unique slug identifier) of the Gateway.

Example responses

201 Response

{
"id": "def45678-g901-23hi-j456-789012klmnop",
"token": "REDACTED_TOKEN",
"createdAt": "2025-10-15T14:20:00Z",
"message": "New token generated successfully. Old token remains active until revoked."
}

400 Response

{
"status": "error",
"code": "VALIDATION_FAILED",
"message": "The request failed validation.",
"errors": [
{
"field": "<name of the offending field>",
"message": "<reason this field failed validation>"
}
]
}

401 Response

{
"status": "error",
"code": "UNAUTHORIZED",
"message": "Authorization header is required, or the token is invalid or expired."
}

403 Response

{
"status": "error",
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action."
}

404 Response

{
"status": "error",
"code": "NOT_FOUND",
"message": "The specified resource does not exist."
}

500 Response

{
"status": "error",
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred.",
"trackingId": "4f1c6f2e-8a4b-4c93-b1de-9f2f6f0c2a11"
}

Responses​

StatusMeaningDescriptionSchema
201CreatedNew token generated successfullyTokenRotationResponse
400Bad RequestBad Request. Invalid request or validation error.Error
401UnauthorizedUnauthorized. Authentication credentials are missing or invalid.Error
403ForbiddenForbidden. The authenticated user does not have permission to access this resource.Error
404Not FoundNot Found. The specified resource does not exist.Error
500Internal Server ErrorInternal Server Error.Error

Response Headers​

StatusHeaderTypeFormatDescription
201LocationstringuriURL of the newly created resource.

Revoke gateway token​

DELETE /gateways/{gatewayId}/tokens/{tokenId}

Code samples


curl -X DELETE https://localhost:9243/api/v0.9/gateways/{gatewayId}/tokens/{tokenId} \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Revokes a specific gateway token. Operation is idempotent - revoking an already-revoked token succeeds. Access is validated against the organization in the JWT token.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `ap:gateway:token:delete`, `ap:gateway:token:manage`, `ap:gateway:manage`

Parameters​

NameInTypeRequiredDescription
gatewayIdpathstringtrueGateway ID consisting of the handle (unique slug identifier) of the Gateway.
tokenIdpathstring(uuid)trueToken ID consisting of the UUID of the Token.

Detailed descriptions​

gatewayId: Gateway ID consisting of the handle (unique slug identifier) of the Gateway.

tokenId: Token ID consisting of the UUID of the Token.

Example responses

200 Response

{
"message": "Token revoked successfully"
}

400 Response

{
"status": "error",
"code": "VALIDATION_FAILED",
"message": "The request failed validation.",
"errors": [
{
"field": "<name of the offending field>",
"message": "<reason this field failed validation>"
}
]
}

401 Response

{
"status": "error",
"code": "UNAUTHORIZED",
"message": "Authorization header is required, or the token is invalid or expired."
}

403 Response

{
"status": "error",
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action."
}

404 Response

{
"status": "error",
"code": "NOT_FOUND",
"message": "The specified resource does not exist."
}

500 Response

{
"status": "error",
"code": "INTERNAL_ERROR",
"message": "An unexpected error occurred.",
"trackingId": "4f1c6f2e-8a4b-4c93-b1de-9f2f6f0c2a11"
}

Responses​

StatusMeaningDescriptionSchema
200OKToken revoked successfullyInline
400Bad RequestBad Request. Invalid request or validation error.Error
401UnauthorizedUnauthorized. Authentication credentials are missing or invalid.Error
403ForbiddenForbidden. The authenticated user does not have permission to access this resource.Error
404Not FoundNot Found. The specified resource does not exist.Error
500Internal Server ErrorInternal Server Error.Error

Response Schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
messagestringfalsenonenone

Was this page helpful?