# Submit

## Submitting Signed Transactions

**Endpoint**: `POST /tournaments/submit-tx`

**CRITICAL**: This endpoint is required to complete all Tournament operations. Each transaction-generating endpoint (tournament creation, registration, adding participants, settlement) returns an unsigned transaction that must be signed and submitted using this endpoint.

**Request Parameters**:

* `transaction` (string): Hex-encoded signed transaction
* `signatures` (string\[], optional): Array of additional signatures to add to the transaction

**Response**:

* `txHash` (string): Transaction hash of the successfully submitted transaction

{% hint style="warning" %}
Transactions must be properly signed before submission. Unsigned or improperly signed transactions will be rejected by the Cardano network.
{% endhint %}

**Technical Notes**:

* All tournament operations follow a two-step process:
  1. Generate an unsigned transaction using one of the endpoints
  2. Sign the transaction and submit it using this endpoint
* Multiple signatures can be combined in a single submission
* The transaction hash returned can be used to track the transaction on the blockchain

**Example (Node.js with fetch)**:

```javascript
async function submitTransaction(signedTransaction) {
  const apiUrl = 'https://preprod.api.ada-anvil.app/v2/services/tournaments/submit-tx';
  
  const requestData = {
    transaction: signedTransaction,
    // Optional additional signatures
    // signatures: ["signature1", "signature2"]
  };
  
  const response = await fetch(apiUrl, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(requestData),
  });
  
  const data = await response.json();
  console.log(`Transaction submitted successfully with hash: ${data.txHash}`);
  
  return data.txHash;
}
```

{% hint style="info" %}
For more details on transaction creation, signing, and the complete Anvil API transaction process, see the [Transaction Overview](/guides/transaction.md) documentation.
{% endhint %}


---

# 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://dev.ada-anvil.io/tournament-builder/submit.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.
