---
title: "Retire a test or integration end user without deleting financial history"
method: DELETE
path: "/credits/end-users/{externalUserId}"
tags: ["End users"]
---

# Retire a test or integration end user without deleting financial history

`DELETE /credits/end-users/{externalUserId}`

## Request

- Base URL: `https://api.paywithlocus.com/api`
- URL: `https://api.paywithlocus.com/api/credits/end-users/{externalUserId}`
- Auth: HTTP bearer

Workspace owner or admin with fresh MFA/passkey step-up only. Fails closed unless the balance is zero and every reservation, top-up attempt, external purchase, and refund is terminal. Revokes end-user tokens and scoped agent credentials, cancels outstanding approvals, resets the operational policy, freezes the credit account, and marks the identity inactive. Ledger, funding, settlement, replay, and audit rows are retained. Repeating a completed retirement is safe.

## Path parameters

- `externalUserId` string, required: Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.

## Headers

- `X-Locus-Step-Up` string, password

## Response `200`

Retirement converged

- object
  - `success` unknown, required
  - `externalUserId` string, required: Case-sensitive immutable ID in the tenant namespace. Prefer an identity-provider subject, not an email address.
  - `retired` boolean, required
  - `alreadyRetired` boolean, required
  - `accountId` string, uuid, nullable, required
  - `revokedTokens` integer, required
  - `revokedAgentConnections` integer, required
  - `canceledApprovals` integer, required
  - `policyReset` boolean, required

## Other responses

- `401`: Authentication required
- `403`: Workspace owner/admin role and fresh MFA/passkey step-up required
- `409`: Balance or asynchronous money work is still open

---

[API](https://skmtc.dev/paywithlocus/apis/locus-pro-api.md) - [All operations](https://skmtc.dev/paywithlocus/apis/locus-pro-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paywithlocus/apis/locus-pro-api/revisions/aab8fa5d6cef?raw)
