---
title: "Detach an agent from the JWT's account"
method: POST
path: "/v1/accounts/me/detach-agent"
tags: ["accounts"]
---

# Detach an agent from the JWT's account

`POST /v1/accounts/me/detach-agent`

## Request

- Base URL: `https://alive-api.alphakek.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://alive-api.alphakek.ai/v1/accounts/me/detach-agent`
- Auth: none declared

Clear `ai_agents.account_id` for `agent_id`, scoped to the caller's account.

Returns 404 if the agent doesn't exist, isn't attached, or is
attached to a different account — the scoped UPDATE folds all three
cases into one False return so we don't leak which it was.

Body uses `agent_id` (UUID) rather than `slug` because the slug-by-
account scope is just a display convenience; the canonical handle
we store on `ai_agents.account_id` is the UUID.

## Request body

- DetachAgentRequest
  - `agent_id` string, required: UUID of the agent to detach from this account.

## Response `200`

Successful Response

- DetachAgentResponse: Detach response. The success path always returns; the False path raises 404 before reaching this model, so there's no `detached` boolean — HTTP 200 carries that signal.
  - `agent_id` string, required

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `b6d96e7673dc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/alphakek-ai/apis/aikek-api/changes/v1/accounts/me/detach-agent/post.md)

---

[API](https://skmtc.dev/alphakek-ai/apis/aikek-api.md) - [All operations](https://skmtc.dev/alphakek-ai/apis/aikek-api/llms.txt) - [OpenAPI document](https://skmtc.dev/alphakek-ai/apis/aikek-api/revisions/b6d96e7673dc?raw)
