---
title: "A person takes an agent's account over: signed in with their own session (a cookie or the Bearer token of a code sign-in, never an API key), with the token from the claim link (the part after #t=). First with preview: true (which agent made it and what comes with it; nothing moves), then with confirm: true: the agent's orders, claims and follows move into their account, the agent's keys stop working, and one new key is made on their account, in this answer only (keys.new.value, shown once: no copy is kept) to give the agent. Needs an address proved by sign-in (403 email_not_verified); without preview or confirm: 400 confirm_required with the preview; at most 10 tries an hour (429)"
method: POST
path: "/api/agents/claim"
tags: ["Accounts"]
---

# A person takes an agent's account over: signed in with their own session (a cookie or the Bearer token of a code sign-in, never an API key), with the token from the claim link (the part after #t=). First with preview: true (which agent made it and what comes with it; nothing moves), then with confirm: true: the agent's orders, claims and follows move into their account, the agent's keys stop working, and one new key is made on their account, in this answer only (keys.new.value, shown once: no copy is kept) to give the agent. Needs an address proved by sign-in (403 email_not_verified); without preview or confirm: 400 confirm_required with the preview; at most 10 tries an hour (429)

`POST /api/agents/claim`

## Request

- Base URL: `https://agentdrives.com`
- URL: `https://agentdrives.com/api/agents/claim`
- Auth: HTTP bearer

## Request body

- object
  - `token` string, required
  - `preview` boolean: true: nothing moves; the answer says what comes with it (agent, when it was made, keys, orders, claimed domains)
  - `confirm` boolean: true: take it over

## Response `200`

Claimed (or, with preview, what comes with it)

- object
  - `ok` boolean
  - `account` string
  - `moved` object
  - `preview` boolean
  - `agent` string, nullable
  - `made_at` string, date-time, nullable
  - `keys` union
    - integer: preview: the agent's keys, which stop working
    - object: claimed: how many keys were revoked, and the new key (id, name, start; its value in this answer only: keys.new.value, shown once)
  - `orders` object[]
  - `claims` integer
  - `domains` object[]
  - `after` string

## Other responses

- `400`: Error as problem details (RFC 9457) with a machine-readable `error` and a `fix` that says what to do next
- `401`: Error as problem details (RFC 9457) with a machine-readable `error` and a `fix` that says what to do next
- `403`: Error as problem details (RFC 9457) with a machine-readable `error` and a `fix` that says what to do next
- `404`: Error as problem details (RFC 9457) with a machine-readable `error` and a `fix` that says what to do next
- `410`: Error as problem details (RFC 9457) with a machine-readable `error` and a `fix` that says what to do next
- `429`: Error as problem details (RFC 9457) with a machine-readable `error` and a `fix` that says what to do next

---

[API](https://skmtc.dev/agentdrives/apis/agentdrives-api.md) · [All operations](https://skmtc.dev/agentdrives/apis/agentdrives-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentdrives/apis/agentdrives-api/revisions/94dcaabff4b2?raw)
