# Bridge cNGN

## Bridge cNGN

<mark style="color:green;">`POST`</mark> `https://api.cngn.co/v1/api/bridge`

Initiates a cross-chain bridge of cNGN tokens. **Requires `Swap` permission.** The request body must be **AES encrypted**.

#### Request Body

| Name                                                   | Type   | Description                                                                        |
| ------------------------------------------------------ | ------ | ---------------------------------------------------------------------------------- |
| destinationNetworkId<mark style="color:red;">\*</mark> | string | The ID of the destination blockchain network.                                      |
| destinationAddress<mark style="color:red;">\*</mark>   | string | Your wallet address on the destination network.                                    |
| originNetworkId<mark style="color:red;">\*</mark>      | string | The ID of the origin blockchain network.                                           |
| senderAddress                                          | string | Your wallet address on the origin network.                                         |
| callbackUrl                                            | string | URL to receive webhook notifications about the bridge status. Must be a valid URL. |

{% tabs %}
{% tab title="200 Swap was successfully" %}

```json
{
  "status": 200,
  "message": "Swap was successfully",
  "data": {
    "receivableAddress": "0xabc123def456789...",
    "transactionId": "brg-20250615-GHI789",
    "reference": "REF-20250615-JKL012"
  }
}
```

{% endtab %}

{% tab title="400 Invalid request" %}

```json
{
  "status": 400,
  "message": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

> **Encryption Required:** The request body must be encrypted using AES-256-CBC before sending. See the Encrypting / Decrypting Request section.

#### Response Fields (Decrypted)

| Field               | Type   | Description                                        |
| ------------------- | ------ | -------------------------------------------------- |
| `receivableAddress` | string | Address to send your cNGN to on the origin network |
| `transactionId`     | string | Unique bridge transaction identifier               |
| `reference`         | string | Reference for tracking the bridge operation        |

#### Example Request

The request body should be encrypted. Below shows the **plaintext payload** before encryption:

```json
{
  "destinationNetworkId": "clx1destnet456",
  "destinationAddress": "0x9876543210fedcba9876543210fedcba98765432",
  "originNetworkId": "clx1orignet789",
  "senderAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "callbackUrl": "https://yourapp.com/webhooks/bridge"
}
```

**Encrypted request:**

```bash
curl -X POST https://api.cngn.co/v1/api/bridge \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "content": "BASE64_ENCRYPTED_CONTENT",
    "iv": "BASE64_IV"
  }'
```
