> For the complete documentation index, see [llms.txt](https://docs.nexus.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexus.xyz/api-reference/bridge/create-bridge-withdrawal.md).

# POST /api/v1/bridge/withdrawals

Trigger a bridge withdrawal

Trigger a bridge withdrawal.

`operationId`: `createBridgeWithdrawal`

> **Declared server:** `https://api.testnet.nexus.xyz`. Examples follow the OpenAPI operation, path-item, then document server precedence and append the full operation path. A declared URL is not proof of live routing; verify the target deployment before use. See [Networks](/api-reference/guides/networks.md).

> **Not reachable through CCXT.** Nexus-specific Halliday-fronted payout. CCXT's withdraw method models a venue paying a user-supplied address from its own custody, not a per-withdrawal one-time-wallet quote settled by a third party.

**Authentication:** `hmacAuth`.

Trigger a withdrawal to a Halliday one-time wallet (OTW). The server quotes an OTW from Halliday, debits the account's USDX on the Exchange, and releases the funds on-chain to that OTW; Halliday then settles to the user in the asset and destination they chose.

The request carries only an `amount` (USDX base units). There is no `destination_address` -- the destination is the OTW Halliday quotes, never a user-supplied address.

The write path runs synchronously and the response carries the resulting record with its terminal status. The `Idempotency-Key` header is required and makes the call safe to retry: the same key returns the original withdrawal without moving money again. A replay returns the stored record as `200` even when it is terminal `failed` (including a withdrawal the original call rejected with a `400`, e.g. insufficient balance), so branch on the returned `status`, not on the HTTP code, and expect a key consumed by a terminal `failed` to keep replaying that failure.

States advance pending -> quoted -> broadcast -> confirmed | failed. On `failed`, the Exchange debit is reversed only when the release is provably unpaid (bad config, a terminally-rejected broadcast, or a mined-and-reverted tx); when the release was broadcast and its outcome is unknown the debit is left in place for reconciliation, so `failed` does not by itself mean the balance was restored -- read `failure_reason`.

The debit can also be rejected synchronously: a `400` when the account has insufficient balance, or an open position or open orders that must be closed first; a `503` when the Exchange is not currently accepting withdrawals. Neither applies a debit.

## Parameters

| Name              | In     | Type     | Required | Default | Description                                                                                                                                               |
| ----------------- | ------ | -------- | -------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Idempotency-Key` | header | `string` | Yes      | —       | Client-generated key that makes the withdrawal idempotent. Retrying with the same key returns the original withdrawal without triggering a second payout. |

## Request body

**Required.** [`BridgeWithdrawalRequest`](/api-reference/guides/schemas.md#bridgewithdrawalrequest) — `application/json`.

## Responses

| Status | Body                                                                    | Meaning                                                                                                                                                                                                                                                                                              |
| ------ | ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `200`  | [`BridgeWithdrawal`](/api-reference/guides/schemas.md#bridgewithdrawal) | Idempotent replay: the withdrawal this Idempotency-Key already created. May be terminal `failed` -- even a withdrawal the original call rejected with a 400 replays here as 200 -- so branch on its `status`, not the HTTP code.                                                                     |
| `201`  | [`BridgeWithdrawal`](/api-reference/guides/schemas.md#bridgewithdrawal) | The withdrawal was triggered.                                                                                                                                                                                                                                                                        |
| `400`  | — *(no schema declared)*                                                | —                                                                                                                                                                                                                                                                                                    |
| `401`  | — *(no schema declared)*                                                | —                                                                                                                                                                                                                                                                                                    |
| `403`  | — *(no schema declared)*                                                | —                                                                                                                                                                                                                                                                                                    |
| `409`  | [`BridgeError`](/api-reference/guides/schemas.md#bridgeerror)           | The Idempotency-Key was already used with a different amount. The key is bound to its first request, so a mismatched retry is rejected rather than silently replaying the original withdrawal.                                                                                                       |
| `429`  | — *(no schema declared)*                                                | —                                                                                                                                                                                                                                                                                                    |
| `502`  | [`BridgeError`](/api-reference/guides/schemas.md#bridgeerror)           | A downstream step failed (Halliday quote, the Exchange debit, or the on-chain release). On a release failure the debit is reversed only when the failure is provably money-safe; an unknown on-chain outcome leaves the account debited pending reconciliation.                                      |
| `503`  | [`BridgeError`](/api-reference/guides/schemas.md#bridgeerror)           | Withdrawals are not available: either not enabled on this deployment (the money path is not provisioned), or the Exchange is not currently accepting withdrawals (withdrawals disabled, or an uncovered system loss outstanding). Transient — no debit was applied; retry once the condition clears. |

## Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST 'https://api.testnet.nexus.xyz/api/v1/bridge/withdrawals' \
  -H 'X-API-Key: nx_7f3a1b...' \
  -H 'X-Timestamp: 1776033911836' \
  -H 'X-Signature: <hmac-sha256>' \
  -H 'Content-Type: application/json'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    "X-API-Key": "nx_7f3a1b...",
    "X-Timestamp": "1776033911836",
    "X-Signature": "<hmac-sha256>",
    "Content-Type": "application/json"
}

response = requests.post("https://api.testnet.nexus.xyz/api/v1/bridge/withdrawals", headers=headers)
response.raise_for_status()
print(response.json())
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
const response = await fetch("https://api.testnet.nexus.xyz/api/v1/bridge/withdrawals", {
  method: "POST",
  headers: {
    "X-API-Key": "nx_7f3a1b...",
    "X-Timestamp": "1776033911836",
    "X-Signature": "<hmac-sha256>",
    "Content-Type": "application/json"
  },
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

`X-Signature` is a placeholder: it is derived from this specific request. See [Authentication](/api-reference/guides/authentication.md) for the canonical string and the HMAC rule.

***

<sub>Generated from</sub> <sub></sub><sub>`eng/apps/exchange/api/openapi.json`</sub> <sub></sub><sub>(spec</sub> <sub></sub><sub>`0.9.70`</sub><sub>). Do not edit by hand — regenerate with</sub> <sub></sub><sub>`python3 product/docs/tools/api-reference/generate.py`</sub><sub>. Hand-authored context lives in the Guides pages.</sub>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nexus.xyz/api-reference/bridge/create-bridge-withdrawal.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
