Logout
id: core-auth-logout owner: core method: POST path: /wp-json/headlesswp/v1/auth/logout title: Logout usedBySite: true
POST /wp-json/headlesswp/v1/auth/logout
End the current cookie session.
Auth + CSRF
- Auth: cookie
- Proxy nonce required: yes.
- CSRF:
X-WP-Noncerequired by the proxy (HWP nonce policy: logged_in_only). - Cookies: session cookies are cleared via the
/api/secure/**proxy response.
Request schema
No request body.
Response schema
{
"data": {
"loggedOut": true
},
"meta": {
"correlationId": "string-or-null",
"correlation_id": "string-or-null",
"request_id": "string-or-null",
"timestamp": "2024-01-01T00:00:00Z"
}
}
Error codes
| Status | Code | Notes |
|---|---|---|
| 401 | NOT_AUTHENTICATED | No active cookie session. |
| 403 | CSRF_FAILED | Proxy rejected missing nonce. |