# TAAL Transaction Endpoints

The simplest way to broadcast transactions to BSV is to use the broadcast and the batchBroadcast endpoints. /api/v1/broadcast expects a single transaction whilst /api/v1/batchBroadcast expects a batch of them.

With both of these it is possible to send your request as text with the `application/json` mimetype or binary with the `application/octet-stream` mimetype (discussed below).

The binary format has 2 advantages:

1. The size of the request payload is half of the text equivalent.
2. Unlike with JSON, the 1st transaction in the binary stream can be processed before the entire payload has been received.

The endpoints are:

```
curl -X POST https://api.taal.com/api/v1/broadcast
curl -X POST https://api.taal.com/api/v1/batchBroadcast
```

**Please note that these endpoints require a Taal APIKey that can be obtained for free by registering at <https://platform.taal.com>**

#### /api/v1/broadcast (`application/json`)

**Request body**

```json
{
  "rawTx": "bitcoin transaction in hex..."
}
```

**Response, if successful:**

```
201 Created
text/plain
<32 byte TXID in 64 hexadecimal characters>
```

**Response, if not successful**

```json
400 Bad request
application/json
{
  "status": number,
  "code": number,
  "error": "string"
}
```

These are the exact responses returned by the bitcoin node.

#### /api/v1/broadcast (`application/octet-stream`)

**Request body**

```
bitcoin transaction as a stream of bytes (binary) 
```

**Response, if successful:**

```
201 Created
text/plain
<32 byte TXID in 64 hexadecimal characters>
```

#### /api/v1/batchBroadcast (`application/json`)

**Request body**

```json
[
  {
    "rawTx": "bitcoin transaction in hex..."
  },
  {
    "rawTx": "bitcoin transaction in hex..."
  },
  ....
]
```

#### /api/v1/batchBroadcast (`application/octet-stream`)

**Request body**

```
one or more bitcoin transactions as a stream of bytes (binary) 
```

**Response for both text and binary requests:**

```json
200 OK
application/json
{
  "txs": [
    {
      "txid": "<32 byte TXID in 64 hexadecimal characters>",
      "returnResult": "success or failure",
      "resultDescription": "string"
    }
  ],
  "failureCount": number
}
```

The resultDescription contains the exact responses returned by the bitcoin node for each transaction.

***


---

# Agent Instructions: 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:

```
GET https://docs.taal.com/core-products/transaction-processing/taal-transaction-endpoints.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
