Rotate a token
POST/accounts/{account_id}/moq/relays/{relay_id}/tokens/rotate
Generates a new token for the specified type. The old token is immediately invalidated. Token value is shown once in the response.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Rotate a token
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/moq/relays/$RELAY_ID/tokens/rotate \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-d '{
"type": "publish_subscribe"
}'{
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"success": true,
"result": {
"token": "eyJhbGciOiJFZDI1NTE5...",
"type": "publish_subscribe"
}
}Returns Examples
{
"errors": [
{
"code": 0,
"message": "message"
}
],
"messages": [
{
"code": 0,
"message": "message"
}
],
"success": true,
"result": {
"token": "eyJhbGciOiJFZDI1NTE5...",
"type": "publish_subscribe"
}
}