> ## Documentation Index
> Fetch the complete documentation index at: https://www.sapientpriors.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# A customer leaves

> Offboard a customer completely by deleting their dedicated agent in one call

## Example use case

A prospect closes their account on your sales agent and requests complete data removal. Because you followed the one-agent-per-customer architecture, all of their threads, memories, files, and logs live inside a single agent.

## Setup

Look up the customer's `agent_id` in your database and call [DELETE`/v2/agents/{agent_id}`](https://www.sapientpriors.com/docs/api-reference/v2/agents/delete-agent) as the agent's owner:

* Priors returns `202` with `"status": "deleted"`.
* The agent, every thread, every memory, every uploaded file, and all activity history become permanently unreadable.
* The agent slot returns immediately to your organization's quota.

## Benefit with Priors

* **Atomic offboarding:** one call replaces fragile sweeps across threads, files, and individual memory turns.
* **Clean compliance boundary:** one agent per customer makes deletion requests verifiable and self-contained.

## What goes wrong

> [!WARNING]
>
> Deletion cannot be undone. If multiple customers shared one agent, you cannot call [DELETE`/v2/agents/{agent_id}`](https://www.sapientpriors.com/docs/api-reference/v2/agents/delete-agent) for one departing customer without wiping every other customer on that agent. Conversely, deleting only the customer's threads leaves all of their memories and uploaded files intact inside Priors.

## Recommendation

Give each customer their own agent from day one so offboarding is always a single [DELETE`/v2/agents/{agent_id}`](https://www.sapientpriors.com/docs/api-reference/v2/agents/delete-agent) call. Treat `404` on a retry as already deleted, and remove the `agent_id` mapping from your own database once confirmed.

## Calls used

* Guides: [Agents](https://www.sapientpriors.com/docs/concepts/agents.md), [Your data](https://www.sapientpriors.com/docs/data.md), [Limits](https://www.sapientpriors.com/docs/limits.md)
* API reference: [Delete agent](https://www.sapientpriors.com/docs/api-reference/v2/agents/delete-agent.md), [Get agent](https://www.sapientpriors.com/docs/api-reference/v2/agents/get-agent.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.