create_escrow_hold
Reserve credits: deducts amount from an existing user and parks it in a hold (status held), returning hold_id. Finish with capture_escrow_hold or release_escrow_hold; a hold past expires_at can be released back at any time. Pass idempotency_key on anything an agent might retry: a replay returns the original hold (idempotent_replay: true, with its current status) and holds nothing more; the same key on a different request is 409 IDEMPOTENCY_KEY_REUSED. Without a key every call places another hold. Errors: 400 INSUFFICIENT_CREDITS, 404 USER_NOT_FOUND. Costs 1 CRD (platform credit) per call, charged even when the call is then rejected (a 429 RATE_LIMITED costs nothing). Error results include request_id; quote it to support.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Credits to hold | |
| reason | No | ||
| api_key | No | Cred API key (optional if set via the x-api-key header) | |
| user_id | No | External user ID of the holder | |
| metadata | No | ||
| expires_at | No | ISO timestamp after which the hold can be released back to the holder | |
| project_id | No | Cred project ID (optional; the API key already identifies the project) | |
| user_email | No | Holder email (checked first) | |
| reference_id | No | Your reference, e.g. an order ID (filterable in list_escrow_holds) | |
| x402_payment | No | Base64 x402 PaymentPayload, only when a previous call failed with an x402 PaymentRequired because the account is out of CRD | |
| credit_type_id | Yes | Credit type to hold | |
| idempotency_key | No | Unique key for this hold (max 255 chars). Retrying with the same key and same arguments returns the first result instead of repeating it; reusing it for different arguments fails with 409 IDEMPOTENCY_KEY_REUSED. Generate a fresh key (e.g. a UUID) per intended operation and reuse it only to retry that operation. |