Skip to content

Clean up expired guest accounts.

POST
/api/admin/guest-users/cleanup
Code sample: Shell / cURL
curl --request POST \
--url https://auth.example.com/api/admin/guest-users/cleanup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "dry_run": true, "limit": 100 }'

Reports expired browser resume credentials and existing deletion requests without mutation by default. With dry_run=false, resumes original deletion requests first, then processes at most 16 credential or job candidates per request. Pass next_cursor back as cursor to continue beyond held or pending candidates while has_more is true. A null next_cursor restarts the next sweep. Cursors expire when the verified storage inventory changes. complete=false includes pending work and legal holds; a partial response does not mean all guests are erased. A 503 reports unavailable or unverified storage rather than a successful empty cleanup.

Media type application/json
object
cursor

Opaque selection position from next_cursor; it does not grant authority.

string
nullable <= 2048 characters
dry_run
boolean
default: true
limit
integer
>= 1 <= 1000
key
additional properties
Example
{
"dry_run": true,
"limit": 100
}

Guest account cleanup response.

Media type application/json
One of:
object
dry_run
required
boolean
pending_users
required
integer
has_more
required
boolean
next_cursor
required
string
nullable <= 2048 characters
expired_count
required
integer
expired_credentials
required
Array<object>
object
user_id
string
credential_id
string
expired_at
integer format: int64
expired_since_hours
integer
key
additional properties
note
required
string
key
additional properties
Example
{
"dry_run": true
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}

Error response.

Media type application/json
object
error
string
message
string
error_description
string
key
additional properties
Example generated
{
"error": "example",
"message": "example",
"error_description": "example"
}