POST
/v1/mgmt/user/logout/sessions

Authorization

Descope Project ID and Management Key
AuthorizationBearer <token>

Project ID:Management Key as bearer token.

In: header

Request Body

application/json

sessionsCreatedAfter?string

RFC 3339. Optional: defaults to the beginning of time. At least one of sessionsCreatedAfter and sessionsCreatedBefore is required.

Lengthlength <= 64
sessionsCreatedBefore?string

RFC 3339. Optional: defaults to now, and cannot be in the future. Sessions created at or after this time are not affected.

Lengthlength <= 64
sessionTypes?array<string>
string

Only log out sessions of these types. Each value must match the session's dtt claim exactly; surrounding whitespace is trimmed, duplicates are dropped, and an empty value is refused. At most 20 values. Empty means every session.

Itemsitems <= 20

Log out every session in the project that was created inside a time range, using a valid management key. This is a project-wide rule: each matching session is logged out at its next refresh or validation, not immediately, and legitimate logins in the range are logged out too. The rule holds until it is deleted with the delete endpoint, or until it expires on its own one year after sessionsCreatedBefore; list the active rules with the list endpoint. A session refused at a refresh stays logged out after the rule is deleted or expires, and a user with many sessions in the range may be logged out of all their sessions. A range cannot cover time before the feature's rollout: sessionsCreatedAfter is clamped to it, the response shows the clamped value, and a range ending at or before it is rejected. Provide at least one of sessionsCreatedAfter and sessionsCreatedBefore as RFC 3339 times: sessionsCreatedAfter defaults to the beginning of time, and sessionsCreatedBefore defaults to now and cannot be in the future. sessionTypes limits the rule to sessions whose dtt claim matches one of its values exactly. No count of logged-out sessions is returned. To log out specific users, use the batch logout endpoint.

curl -X POST "https://api.descope.com/v1/mgmt/user/logout/sessions" \  -H "Content-Type: application/json" \  -d '{}'
{  "after": "string",  "before": "string",  "sessionTypes": [    "string"  ],  "id": "string"}
/** * The stored range, after defaults are applied. */export interface Response {/** * RFC 3339. */after?: string/** * RFC 3339. */before?: stringsessionTypes?: string[]/** * The rule's id, for /v1/mgmt/user/logout/sessions/delete. */id?: string}
Was this helpful?