v2 is generally available. See what changed
Skip to content
Acme Commerce API Menu

Revoke the current token

DELETE /api/v1/auth/tokens/current Requires authentication 60 requests per minute Deprecated v1

Send a bearer token in the Authorization header.

A newer version of this operation is available: DELETE /api/v2/auth/tokens/current.

Invalidates the token used to make this call. Idempotent — revoking an already-revoked token still returns 204.

Full URL: https://api.acme.example/api/v1/auth/tokens/current

Responses

204 Revoked. No body is returned.

No response body.

Example request

cURL
curl -X DELETE 'https://api.acme.example/api/v1/auth/tokens/current' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
JavaScript
const response = await fetch('https://api.acme.example/api/v1/auth/tokens/current', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Accept': 'application/json'
  }
});

const data = await response.json();
PHP (Laravel)
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'Authorization' => 'Bearer YOUR_TOKEN',
    'Accept' => 'application/json',
])->delete('https://api.acme.example/api/v1/auth/tokens/current');

$data = $response->json();
PHP (Guzzle)
use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('DELETE', 'https://api.acme.example/api/v1/auth/tokens/current', [
    'headers' => [
        'Authorization' => 'Bearer YOUR_TOKEN',
        'Accept' => 'application/json',
    ],
]);

$data = json_decode((string) $response->getBody(), true);

Free while you are building.

Get an API key

This page as Markdown, or the whole API as OpenAPI. Ask ChatGPT Ask Claude