Skip to main content

Token - Token Delete

Endpoint

/i/token/delete

Overview

Deletes one token owned by the authenticated user.

Authentication

  • API Key (parameter): api_key=YOUR_API_KEY
  • Auth Token (parameter): auth_token=YOUR_AUTH_TOKEN
  • Auth Token (header): countly-token: YOUR_AUTH_TOKEN

Permissions

  • Any authenticated dashboard user.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
tokenidStringYesToken ID to revoke.

Response

Success Response

{
"result": {
"n": 1,
"ok": 1,
"deletedCount": 1
}
}

Response Fields

FieldTypeDescription
resultObjectMongo remove result object.
result.deletedCountNumberNumber of token rows deleted.

Error Responses

Status Code: 404 Not Found

{
"result": "Token id not provided"
}

Status Code: 400 Bad Request

{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}

Status Code: 404 Not Found

{
"result": "Database error message"
}

Behavior/Processing

Behavior Modes

ModeTriggerProcessing PathResponse Shape
Delete successValid tokenid and ownership matchRemoves token by _id and owner.Wrapped DB remove result object.
Missing token idtokenid omittedRejects before DB call.Wrapped error string.

Database Collections

CollectionUsed forData touched by this endpoint
countly.membersAuth validationResolves authenticated member.
countly.auth_tokensToken revocation targetRemoves token row matching _id and owner.

Examples

Example 1: Delete token

/i/token/delete?api_key=YOUR_API_KEY&tokenid=884803f9e9eda51f5dbbb45ba91fa7e2b1dbbf4b

Limitations

  • Endpoint only removes tokens owned by the caller.

Last Updated

2026-02-17