Delete Cluster token

  • Published Feb 12, 2020

This API call deletes a cluster token. It can be used to delete any token, including tokens not owned by the user who owns the token used to authenticate the call.

Authentication

To execute this request, you need the Cluster token management (ClusterTokenManagement) permission assigned to your API token. Generate your API token via Cluster Management Console (CMC). To learn how to obtain and use it, see Cluster API - Authentication.

Endpoint

/api/cluster/v2/tokens

Parameters

ParameterTypeDescriptionInRequired
idstring

The ID of the token to be deleted. Can either be the public identifier or the secret.

You can't delete the token you're using for authentication of the request.

pathRequired

Response

Response codes

CodeTypeDescription
204-

Success

400ErrorEnvelope

Failed. You can't delete the token you're using for authentication of the request.

404ErrorEnvelope

Failed. The requested token has not been found.

Response body objects

The ErrorEnvelope object

ElementTypeDescription
errorError-

The Error object

ElementTypeDescription
constraintViolationsConstraintViolation[]

A list of constraint violations

messagestring

The error message

codeinteger

The HTTP status code

The ConstraintViolation object

A list of constraint violations

ElementTypeDescription
parameterLocationstring-
The element can hold these values
  • PATH
  • PAYLOAD_BODY
  • QUERY
locationstring-
messagestring-
pathstring-

Response body JSON models

{
"error": {
"constraintViolations": [
{
"parameterLocation": "PATH",
"location": "string",
"message": "string",
"path": "string"
}
],
"message": "string",
"code": 1
}
}

Example

In this example, the request deletes the token with ID value 4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4. The response code of 204 indicates that the deletion was successful.

The API token is passed in the Authorization header.

Curl

curl -X DELETE "https://myManaged.cluster.com/api/cluster/v2/tokens/4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4"
-H "accept: application/json; charset=utf-8"

Request URL

https://myManaged.cluster.com/api/cluster/v2/tokens/4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4

Response code

204