---
title: "Agent declares a send from a delegated client_tss wallet"
method: POST
path: "/v1/agents/{agent_id}/tss/prepare"
tags: ["Key Custody"]
---

# Agent declares a send from a delegated client_tss wallet

`POST /v1/agents/{agent_id}/tss/prepare`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/agents/{agent_id}/tss/prepare`
- Auth: HTTP bearer

The only gate on an agent threshold signature: sign/complete hands the
signature to the agent, which could broadcast it without 1Claw, so
everything `POST /v1/agents/{agent_id}/transactions` checks before
signing is checked here, in this order: the agent's guardrails (chains,
allowlists, per-transaction and daily caps), the sanctions screen, the
human approval policy (or the resume of an approved one), Cedar/OPA
transaction policy, and M-of-N consensus (action `submit_transaction`).
Then it builds the unsigned message, writes a `prepared` row to the
transaction ledger (so daily caps count it from this moment) and
records the prepared intent. Only a prepared message can enter
`/tss/sign/begin`, and sign/complete and broadcast refuse (403) a
prepare that recorded no ledger row. Requires a treasury delegation and
a share provisioned to the agent's runtime.

Two 202 outcomes, neither of which builds a message:

- Human approval (`status: awaiting_approval`): a ledger row is written
  as `awaiting_approval` and an approval with action
  `agent_tss_transaction` is created. Once a human approves it, call
  prepare again with the same `key_id`, `to` and `value` and
  `resume_tx_id` set to the returned `transaction_id`. Rejecting the
  approval marks the row `rejected`.
- M-of-N consensus (`status: pending_approval`): call prepare again with
  the same transfer and `approval_id` set to the returned
  `pending_approval_id` once the approval is granted.

## Request body

- object
  - `key_id` string, uuid, required
  - `to` string, required
  - `value` string, required: Major units.
  - `memo` string
  - `approval_id` string, uuid: An approved M-of-N consensus approval for this exact transfer (the `pending_approval_id` of an earlier 202). The approval is bound to `key_id`, `chain`, `to`, `value` and `memo`.
  - `resume_tx_id` string, uuid: The `transaction_id` of an earlier prepare that was parked on human approval (202 `awaiting_approval`). The transaction must still be `awaiting_approval`, belong to this agent, match this transfer, and its approval must be approved; resuming spends that approval.

## Response `200`

Unsigned message, recorded as a prepared intent with a ledger row

- TssPrepareResponse
  - `key_id` string, uuid, required
  - `chain` string, required
  - `from` string, required
  - `to` string, required
  - `value_base_units` string, required
  - `recent_blockhash` string, required: The chain's freshness value the message was built against.
  - `message` string, required: Base64 unsigned transaction message; what `/tss/sign/begin` takes.
  - `message_digest` string, required: Hex SHA-256 of the message.
  - `transaction_id` string, uuid: The `prepared` ledger row an agent prepare wrote. Present on an agent prepare; absent on a user's own treasury prepare.

## Other responses

- `202`: Held for approval. `awaiting_approval` = human approval (resume with `resume_tx_id`); `pending_approval` = M-of-N consensus (retry with `approval_id`).
- `400`: Invalid request
- `401`: Authentication required or invalid
- `403`: Insufficient permissions
- `404`: Resource not found

---

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