> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cngn.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Bridge

> Move cNGN from one blockchain network to another

Bridges (swaps) cNGN between supported networks. The API returns a `receivableAddress` on the origin network. Send your cNGN there, and the equivalent amount is delivered to `destinationAddress` on the destination network.

<Note>
  Requires the **Swap** permission. The request body must be [encrypted](/guides/encryption). Get the fees and receivable amount first with [Bridge Quote](/api-reference/bridge-quote).
</Note>

### Body parameters (plain payload, pre-encryption)

<ParamField body="originNetworkId" type="string" required>
  Network ID you are bridging **from**. See [Get Networks](/api-reference/get-networks).
</ParamField>

<ParamField body="destinationNetworkId" type="string" required>
  Network ID you are bridging **to**.
</ParamField>

<ParamField body="destinationAddress" type="string" required>
  Wallet address to receive cNGN on the destination network.
</ParamField>

<ParamField body="senderAddress" type="string">
  Address you will send from on the origin network.
</ParamField>

<ParamField body="callbackUrl" type="string">
  HTTPS URL to notify when the bridge completes. See [Bridge completion callback](/guides/webhooks#bridge-completion-callback) for the payload.
</ParamField>

### Response (decrypted `data`)

<ResponseField name="receivableAddress" type="string">
  Deposit address on the origin network. Send the cNGN you want to bridge here.
</ResponseField>

<ResponseField name="transactionId" type="string">
  Internal transaction ID.
</ResponseField>

<ResponseField name="reference" type="string">
  Bridge reference for tracking.
</ResponseField>

<RequestExample>
  ```json Plain body (encrypt before sending) theme={null}
  {
    "originNetworkId": "1f2e3d4c-5b6a-7988-9a0b-c1d2e3f4a5b6",
    "destinationNetworkId": "9b2e6a1f-3c4d-4e5f-8a7b-1c2d3e4f5a6b",
    "destinationAddress": "0x8Ba1f109551bD432803012645Ac136ddd64DBA72",
    "senderAddress": "0x1fA2b3C4d5E6f7A8b9C0d1E2f3A4b5C6d7E8f9A0",
    "callbackUrl": "https://yourapp.com/webhooks/cngn-bridge"
  }
  ```

  ```bash cURL (wire format) theme={null}
  curl -X POST "https://api.cngn.co/v1/api/bridge" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "content": "<base64 AES-256-CBC ciphertext of the plain body>",
      "iv": "<base64 16-byte IV>"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success (data shown decrypted) theme={null}
  {
    "status": 200,
    "message": "Swap was successfully",
    "data": {
      "receivableAddress": "0x2aB3c4D5e6F7a8B9c0D1e2F3a4B5c6D7e8F9a0B1",
      "transactionId": "c4d5e6f7-a8b9-4c0d-9e1f-2a3b4c5d6e7f",
      "reference": "BR-5d4c3b2a"
    }
  }
  ```

  ```json 403 - Permission denied theme={null}
  {
    "status": false,
    "message": "Permission denied"
  }
  ```
</ResponseExample>
