Show examples in:
Javascript HTTP
Endpoint info
Available examples
Content Management API > Session

Destroy the current session

Warning: Experimental API

Please note that this API method is marked as unstable and should be avoided in production environments. Changes may occur at any time without warning, potentially impacting your scripts. We recommend contacting our Support Team to explore alternative approaches that are safer and more reliable!

Revokes the access token used to make this request. Subsequent requests with the same token will fail.

Examples

DELETE https://site-api.datocms.com/session HTTP/1.1
Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3
Terminal window
curl -g 'https://site-api.datocms.com/session' \
-X DELETE \
-H "Authorization: Bearer YOUR-API-TOKEN" \
-H "Accept: application/json" \
-H "X-Api-Version: 3"
await fetch("https://site-api.datocms.com/session", {
method: "DELETE",
headers: {
Authorization: "Bearer YOUR-API-TOKEN",
Accept: "application/json",
"X-Api-Version": "3",
},
});