---
title: "Compute the SafeTx hash for a call from a passkey Safe"
method: POST
path: "/v1/treasury/passkey-safes/{id}/prepare"
tags: ["Key Custody"]
---

# Compute the SafeTx hash for a call from a passkey Safe

`POST /v1/treasury/passkey-safes/{id}/prepare`

## Request

- Base URL: `https://api.1claw.co`
- URL: `https://api.1claw.co/v1/treasury/passkey-safes/{id}/prepare`
- Auth: HTTP bearer

Runs the sanctions screen and spend policies on the call, reads the
Safe's on-chain nonce (0 if not yet deployed), and returns the SafeTx
hash — the raw 32 bytes are the WebAuthn challenge to sign with
`userVerification: "required"`.

## Request body

- object
  - `to` string, required
  - `value_wei` string, required
  - `data` string: Hex calldata, optional.

## Response `200`

What to sign

- PasskeySafePrepare
  - `safe_id` string, uuid
  - `safe_address` string
  - `chain` string
  - `chain_id` integer
  - `to` string
  - `value_wei` string
  - `data` string
  - `nonce` integer
  - `operation` integer: Pass back to `execute` unchanged.
  - `grant_id` string, uuid: Present for grant setup / revoke; pass back to `execute`.
  - `deploy_required` boolean
  - `safe_tx_hash` string: Hex SafeTx hash — the WebAuthn challenge (raw 32 bytes).
  - `credential_id` string
  - `transports` string[], nullable: The passkey's registered transports (`internal`, `hybrid`, `usb`…) — pass as the `allowCredentials` hint so the browser asks the right authenticator.
  - `passkey_name` string, nullable
  - `rp_id` string

## Other responses

- `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/5fa0918f3b41?raw)
