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

# Broadcast Transaction

> Broadcast a signed UTXO transaction via LeoKit's NowNodes proxy (currently ZEC only)

## Overview

`/leokit/broadcast` is a server-side proxy for broadcasting signed UTXO transactions on chains where public APIs don't allow CORS from a browser. Currently the only supported chain is **Zcash (ZEC)**, where the most reliable public node (NowNodes) requires a server-side API key.

Use this endpoint when your client-side ZEC swap flow needs to push a signed transaction without exposing your NowNodes key.

## Endpoint

```
POST /leokit/broadcast
```

## Request

### Headers

| Header         | Value              |
| -------------- | ------------------ |
| `Content-Type` | `application/json` |
| `Api-Key`      | Your API key       |

### Body

| Field    | Type   | Required | Description                              |
| -------- | ------ | -------- | ---------------------------------------- |
| `chain`  | string | Yes      | Chain identifier. Currently only `zcash` |
| `tx_hex` | string | Yes      | Hex-encoded signed transaction           |

## Response

### Success (200)

```json theme={null}
{
  "data": {
    "txid": "f4d6c2..."
  },
  "status": 200
}
```

| Field  | Description                                            |
| ------ | ------------------------------------------------------ |
| `txid` | Confirmed transaction ID returned by the upstream node |

## Errors

| Status | Code                  | Description                                                    |
| ------ | --------------------- | -------------------------------------------------------------- |
| `400`  | `BAD_REQUEST`         | Missing/invalid `tx_hex`, or `chain` not in the supported list |
| `405`  | `METHOD_NOT_ALLOWED`  | Non-POST request                                               |
| `502`  | `BROADCAST_FAILED`    | Upstream node rejected the broadcast (returned in error body)  |
| `503`  | `SERVICE_UNAVAILABLE` | Server has no NowNodes API key configured                      |

See the [error codes catalog](/reference/error-codes) for the full list.

## Example

```bash theme={null}
curl -X POST https://api.leokit.dev/leokit/broadcast \
  -H "Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "zcash",
    "tx_hex": "0500008085202f8901..."
  }'
```

## Notes

* Successful broadcasts return immediately once the upstream node accepts the transaction. Use [`/leokit/status`](/api-reference/transactions) to track confirmation.
* ZEC transparent (`t-`) transactions are forwarded to NowNodes' BlockBook `sendtx` endpoint. Shielded (`z-`) transactions are not yet supported by this proxy.
* This endpoint is a thin pass-through: the same `txid` you'd get by calling NowNodes directly.


## OpenAPI

````yaml /api-reference/openapi.json POST /broadcast
openapi: 3.0.3
info:
  title: Leokit API
  version: 1.0.0
  description: API reference for Leokit
servers:
  - url: https://api.leokit.dev
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /broadcast:
    post:
      summary: Broadcast UTXO transaction (ZEC)
      description: >-
        Server-side proxy for broadcasting signed UTXO transactions on chains
        where public APIs don't support browser CORS. Currently zcash only.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BroadcastRequest'
            example:
              chain: zcash
              tx_hex: 0500008085202f8901...
      responses:
        '200':
          description: Broadcast accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BroadcastResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    BroadcastRequest:
      type: object
      required:
        - chain
        - tx_hex
      properties:
        chain:
          type: string
          enum:
            - zcash
          description: Currently only zcash is supported.
        tx_hex:
          type: string
          description: Hex-encoded signed transaction.
    BroadcastResponse:
      type: object
      required:
        - data
        - status
      properties:
        status:
          type: integer
        data:
          type: object
          required:
            - txid
          properties:
            txid:
              type: string
    Error:
      type: object
      description: Generic error payload.
      properties:
        message:
          type: string
        code:
          type: string
  responses:
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: 'Demo API-Key (Sandbox): 7037d2b3-9c76-4f62-b730-c544f7570fa4'

````