Delete a token

POST /token/delete


Description

The method deletes a user’s permanent access token by its identifier. Access requires a JWT token in the header.


Request format

  • HTTP method: POST
  • URL: /token/delete
  • Content-Type: application/json
  • Authorization: required

Request parameters

ParameterTypeWhere passedRequiredDescription
tokenstringHeaderUser JWT token

Request body (JSON)

FieldTypeRequiredDescription
tokenstringUser JWT token
token_idstringToken identifier (UUID)

Example request (cURL)

curl -X POST "https://api.enface.ai/token/delete" 
  -H "Content-Type: application/json" 
  -H "Authorization: Bearer jwt.temporary.token" 
  -d '{
    "token": "jwt.temporary.token",
    "token_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }'

Response examples

Success (200 OK)
{
  "status": "ok"
}
Error (400 Bad Request)
{
  "message": "invalid schema",
  "status": "error"
}
Error (401 Unauthorized)
{
  "message": "access denied",
  "status": "error"
}
Error (404 Not Found)
{
  "message": "item with this id does not found",
  "status": "error"
}