Skip to content
Niu DocsNiu 牛元文档
Dashboard控制台

Sign out the member session supplied in Authorization

Generated from the checked-in source. Do not edit this reference by hand.

POST /api/v1/auth/logout

Available to every member role, independently of password login configuration. Revokes only the supplied active session and records a metadata-only audit event atomically. Other sessions remain active. Installation credentials are not member sessions. When password login is configured, a supplied Origin must match its HTTPS origin. All responses use Cache-Control no-store.

Operation: revokeCurrentMemberSession.

Use the credential and permission scope described above. Each object below is an alternative; schemes within one object are required together.

JSON
[
{
"bearerAuth": []
}
]

Set NIU_ORIGIN to your installation origin (without /v1). Replace path, query and header placeholders with the required values. Query examples use curl 7.87 or newer to encode values with --url-query. Use the credential scope described above; a bearer token must have the authority required by this operation.

Shell
curl --fail-with-body -X POST "$NIU_ORIGIN/api/v1/auth/logout" \
-H "Authorization: Bearer $NIU_BEARER_TOKEN"

No path, query, or header parameters are declared.

No request body is declared.

Current session revoked; no response body

Missing, invalid, expired or already revoked member session

Supplied Origin does not match the configured origin

Storage unavailable; retry sign-out before assuming revocation

Available to every member role, independently of password login configuration. Revokes only the supplied active session and records a metadata-only audit event atomically. Other sessions remain active. Installation credentials are not member sessions. When password login is configured, a supplied Origin must match its HTTPS origin. All responses use Cache-Control no-store.