Skip to content

Clean up expired anonymous users.

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

Finds expired anonymous devices and optionally deletes the associated anonymous users. The default dry-run mode reports what would be removed without mutating data.

Media type application/json
object
dry_run
boolean
default: true
limit
integer
>= 1 <= 1000
key
additional properties
Example
{
"dry_run": true,
"limit": 100
}

Anonymous user cleanup response.

Media type application/json
One of:
object
dry_run
required
boolean
expired_count
required
integer
expired_devices
required
Array<object>
object
user_id
string
device_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"
}