---
title: "Reset a client (test environment only)"
method: DELETE
path: "/clients/{externalTenantId}"
tags: ["Clients"]
---

# Reset a client (test environment only)

`DELETE /clients/{externalTenantId}`

Deletes a client and all associated data, allowing you to re-create the client from scratch.

⚠️ **TEST ENVIRONMENT ONLY** - This endpoint is only available on the test environment (testreferral-api.debitura.com).
Calling this endpoint on production will return 403 Forbidden.

Use Cases
- Testing the full onboarding flow multiple times
- Resetting after changing your internal tenant structure during development
- Cleaning up test data without manual intervention

What Gets Deleted (cascade)
- All collection cases and invoices for the client
- All leads for the client
- The Creditor account (removes email from matching algorithm)
- The ReferralPartnerClientLink is archived
- Associated users are cleaned up if they have no other relations

After Reset
- You can call POST /clients with any externalTenantId using the same email
- The matching algorithm will not find the deleted client
- A completely new client will be created (IsAttributedClient=true)

Important
- You can only reset clients that are linked to your partner account
- Pending link requests (409 scenario) cannot be reset - only actual links

## Path parameters

- `externalTenantId` string, required

## Response `204`

Client and all associated data successfully deleted

## Other responses

- `403` — Endpoint not available in production environment
- `404` — No active client link found for this externalTenantId
- `500` — Internal server error

---

[API](https://skmtc.net/debitura/apis/debitura-referral-partner-api.md) · [All operations](https://skmtc.net/debitura/apis/debitura-referral-partner-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/debitura/debitura-referral-partner-api/revisions/8d237e9c6592/schema)
