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

> ## Agent Instructions
> Authenticate every request with `Authorization: ApiKey {jwt}`: an ES256 JWT signed with the user's private API key, whose header carries `kid` (the API key ID) and whose payload carries `iat` (Unix time in seconds) and `message`, the hex SHA-256 of `{iat}\n{METHOD}\n{PATH}\n{BODY}`. METHOD is uppercase, PATH includes the query string, BODY is the exact JSON sent or an empty string. Full steps: https://developer.bron.org/api-reference/authentication
> Prefer the official SDKs or the CLI, which sign every request: TypeScript `npm install @bronlabs/bron-sdk`, Go `go get github.com/bronlabs/bron-sdk-go`, Python `pip install git+https://github.com/bronlabs/bron-sdk-python.git`, CLI `brew install bronlabs/apps/bron`. Hand-write JWT signing only for a language without an SDK.
> The base URL is https://api.bron.org. Workspace data lives under `/workspaces/{workspaceId}/...`, and `/dictionary/...` serves reference data such as assets, networks and prices. Timestamps are milliseconds since the Unix epoch. Numeric values, amounts included, are strings: never parse them as floats.
> Never ask the user to paste their API key (the private JWK) into a chat and never hard-code it: read it from an environment variable or a secret store.

# User's HTTP API

> Step-by-step tutorial for creating and settling intents using the Bron API

This guide walks you through creating, polling, and settling a new **Intent** in the Bron platform. Intents are the core mechanism for executing asset swaps through the auction-based solver network.

> [!NOTE]
>
> Intents are **idempotent**. Always generate and persist your own `intentId`. If you retry a request with the same `intentId`, the API will safely return the same intent.

## Prerequisites

1. **Workspace ID** (e.g. `v5xez43nnluqmyhhw67x`), you can get it from the Workspace -> Settings page
2. **Account ID** with a valid deposit address for the `fromAssetId` (Account settings)
3. **API Key** with "Manage Transfers" permissions
4. At least one of `fromAmount` or `toAmount` defined (do not set both unless your integration explicitly supports it)

## Step 1: Create an Intent request

```bash theme={"system"}
POST https://api.bron.org/workspaces/{workspaceId}/intents

Request Example

{
  "accountId": "c2joaorrushyrbe2ppvp3gog",
  "fromAmount": "1",
  "fromAssetId": "5",
  "intentId": "x50nqjmvdrbjpk3mw5x4n7w6",
  "toAssetId": "22628"
}

Response Example

{
  "intentId": "x50nqjmvdrbjpk3mw5x4n7w6",
  "status": "user-initiated",
  "fromNetworkId": "CC",
  "fromAssetId": "5",
  "userAddress": "0xc629e6341337AEc9a773A2170FF38bd00299a3F0",
  "toNetworkId": "ETH",
  "toAssetId": "22628",
  "fromAmount": "1",
  "maxPrice": "2.408",
  "expiresAt": "1758185826000",
  "auctionDuration": "15",
  "userSettlementDeadline": "1758189426000",
  "updatedAt": "1758185811000",
  "createdAt": "1758185811000"
}
```

**Field Highlights**

* intentId: Client-generated unique ID, used as idempotency key
* status: Current lifecycle state (user-initiated, auction-in-progress, completed, etc.)
* maxPrice: Upper price limit enforced by protocol
* expiresAt: Quote expiration (epoch ms)
* userSettlementDeadline: Hard deadline for user settlement

### Step 2: Poll Intent Status and price

```bash theme={"system"}
GET https://api.bron.org/workspaces/{workspaceId}/intents/{intentId}

Typical mid-auction response:

{
  "status": "auction-in-progress",
  "price": "2.15",
  "toAmount": "2.150000000000000000",
  "solverAddress": "bron::122082f70795...",
  "expiresAt": "1758185826000",
  "userSettlementDeadline": "1758189426000"
}
```

> [!NOTE]
>
> Wait until you see a `price` with status `auction-in-progress` before proceeding to settlement.

### Step 3: Create Transaction for Settlement

Once you are ready to settle, create a transaction referencing the intentId.

```bash theme={"system"}
POST https://api.bron.org/workspaces/{workspaceId}/transactions

Request Example

{
  "accountId": "c2joaorrushyrbe2ppvp3gog",
  "externalId": "kdx5kev1gj1exehcs1izdxm1",
  "transactionType": "intents",
  "params": {
    "intentId": "x50nqjmvdrbjpk3mw5x4n7w6"
  }
}

Response Example

{
  "transactionId": "x50nqjmvdrbjpk3mw5x4n7w6",
  "status": "signing-required",
  "transactionType": "intents",
  "accountId": "c2joaorrushyrbe2ppvp3gog",
  "workspaceId": "v5xez43nnluqmyhhw67x"
}
```

At this point the transaction is created and must be signed before it can be broadcast on-chain.

### Step 4: Signing Transactions

Transactions created for intents require a signature step. You can sign them in two ways:

1. Manually via the Bron desktop application (user flow)
2. Automatically with the [MPC Hot Signer](https://developer.bron.org/hot-signer/about.md)

> [!NOTE]
>
> [The MPC Hot Signer](https://developer.bron.org/hot-signer/about.md) enables automated transaction signing inside your infrastructure.
> This is recommended for enterprise integrations that require non-interactive settlement.

### Step 5: Monitor Until Completion (optional)

Use the Transactions API to track status until a terminal state (completed):

```bash theme={"system"}
GET https://api.bron.org/workspaces/{workspaceId}/transactions/{transactionId}
```

**Time & Lifecycle Constraints**

* Settle before the userSettlementDeadline expired
* Missed deadlines lead to automatic cancellation
* Re-using an existing intentId will return the same intent if it was already created


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.