Skip to main content
Identities

Clear an identity

Clear configuration, entry points, and bound resources that affect future sessions for an Identity.

POST /api/v1/forward/identities/{identity_id}/clear The Identity itself is retained after the operation and can continue to create new sessions. New sessions no longer use the previous configuration, schedules, or resource bindings. Historical sessions remain archived.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>
Content-TypeNoUse application/json when the request body is not empty.

Path parameters

ParameterTypeRequiredDescription
identity_idstringYesForward Identity ID.

Body parameters

ParameterTypeRequiredDescription
reasonstringNoReason for the cleanup. Used only to record the caller's intent.
You can omit the request body or send an empty JSON object.

Example request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/identities/idn_019eabc123/clear' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "reason": "customer requested cleanup"
}'

Example response

HTTP 200 OK
{
  "identity_id": "idn_019eabc123",
  "status": "completed",
  "completed_at": "2026-07-13T08:00:00Z",
  "summary": {
    "identity_configs_archived": 1,
    "resource_bindings_archived": 2,
    "identity_owned_resources_archived": 1,
    "schedules_archived": 1,
    "schedule_runs_skipped": 2,
    "sessions_archived": 3
  }
}

Response fields

FieldTypeDescription
identity_idstringID of the cleared Identity.
statusstringCleanup status. The value is completed on success.
completed_atstringTime when Forward completed the cleanup, in RFC 3339 format.
summary.identity_configs_archivednumberNumber of Identity Configs processed.
summary.resource_bindings_archivednumberNumber of resource bindings processed.
summary.identity_owned_resources_archivednumberNumber of Identity-owned resources processed (Forward-side ownership registrations).
summary.schedules_archivednumberNumber of schedules processed.
summary.schedule_runs_skippednumberNumber of pending Schedule Runs skipped.
summary.sessions_archivednumberNumber of sessions processed.

Errors

HTTPTypeCodeTrigger
400invalid_request_error-The request body or parameters are invalid.
401authentication_errorauthentication_requiredThe PAT is invalid, expired, or missing.
404not_found_error-The Identity does not exist or is not visible to the caller.
409conflict_errorADMIN_IDENTITY_READ_ONLY or -The target is the read-only Admin Identity, or the Identity has a Schedule Run in progress.

Notes

  • This endpoint does not delete the Identity itself.
  • You can create new sessions, configurations, and schedules after the cleanup.
  • Repeating the operation does not restore previously processed resources or configurations.

Cleaning up Identity-owned resources

Cleanup handles resources owned by this Identity according to their type:
Resource typeBehavior
EnvironmentArchive without deleting.
VaultArchive every active Credential in the Vault first, then archive the Vault.
Memory StoreFollow the existing cleanup behavior.
Environment and Vault archiving runs asynchronously after Forward-side cleanup finishes. Downstream archiving may therefore still be in progress when this endpoint returns completed. Failed archive operations are retried a limited number of times and logged. You can call this endpoint again to continue cleanup.
Archiving the Vault alone does not complete cleanup: all active Credentials in it must be archived first. Credentials are read page by page until none remain active.