POST /api/domains/cleanup

Clean up custom domains that have been inactive (not verified) for a specified number of days. This uses Cloudflare as the source of truth to determine domain activity.

application/json

Body Required

  • staleDays number Required

    The number of days a domain must be inactive before it is considered stale and eligible for cleanup.

Responses

  • 200 application/json

    The cleanup result summary.

    Hide response attributes Show response attributes object
    • scannedCount number Required
    • deletedCount number Required
    • skippedActiveCount number Required
    • failedCount number Required
  • 400

    Bad Request

  • 401

    Unauthorized

  • 403

    Forbidden

POST /api/domains/cleanup
curl \
 --request POST 'https://[tenant_id].logto.app/api/domains/cleanup' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"staleDays":42.0}'
Request examples
{
  "staleDays": 42.0
}
Response examples (200)
{
  "scannedCount": 42.0,
  "deletedCount": 42.0,
  "skippedActiveCount": 42.0,
  "failedCount": 42.0
}