Skip to main content
POST
/
workspaces
/
{workspaceId}
/
intents
Create Intent request
curl --request POST \
  --url https://api.bron.org/workspaces/{workspaceId}/intents \
  --header 'Content-Type: application/json' \
  --data '
{
  "accountId": "<string>",
  "fromAssetId": "<string>",
  "intentId": "<string>",
  "toAssetId": "<string>",
  "fromAmount": "<string>",
  "toAmount": "<string>"
}
'
import requests

url = "https://api.bron.org/workspaces/{workspaceId}/intents"

payload = {
"accountId": "<string>",
"fromAssetId": "<string>",
"intentId": "<string>",
"toAssetId": "<string>",
"fromAmount": "<string>",
"toAmount": "<string>"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
fromAssetId: '<string>',
intentId: '<string>',
toAssetId: '<string>',
fromAmount: '<string>',
toAmount: '<string>'
})
};

fetch('https://api.bron.org/workspaces/{workspaceId}/intents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bron.org/workspaces/{workspaceId}/intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>',
'fromAssetId' => '<string>',
'intentId' => '<string>',
'toAssetId' => '<string>',
'fromAmount' => '<string>',
'toAmount' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.bron.org/workspaces/{workspaceId}/intents"

payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"fromAssetId\": \"<string>\",\n \"intentId\": \"<string>\",\n \"toAssetId\": \"<string>\",\n \"fromAmount\": \"<string>\",\n \"toAmount\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.bron.org/workspaces/{workspaceId}/intents")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"<string>\",\n \"fromAssetId\": \"<string>\",\n \"intentId\": \"<string>\",\n \"toAssetId\": \"<string>\",\n \"fromAmount\": \"<string>\",\n \"toAmount\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.bron.org/workspaces/{workspaceId}/intents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"<string>\",\n \"fromAssetId\": \"<string>\",\n \"intentId\": \"<string>\",\n \"toAssetId\": \"<string>\",\n \"fromAmount\": \"<string>\",\n \"toAmount\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "createdAt": "<string>",
  "fromAssetId": "<string>",
  "intentId": "<string>",
  "toAssetId": "<string>",
  "updatedAt": "<string>",
  "expiresAt": "<string>",
  "fromAmount": "<string>",
  "price": "<string>",
  "toAmount": "<string>",
  "userSettlementDeadline": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}

Path Parameters

workspaceId
string
required

Body

application/json
accountId
string
required

The id of the account where the intent transaction should be placed

Example:

"kqftx9zd3g6qdp09or"

fromAssetId
string
required
Example:

"2"

intentId
string
required

Unique intent identifier from client (should be unique per the account)

Example:

"w2u573pjj5wl975z4a9"

toAssetId
string
required
Example:

"5002"

fromAmount
string<decimal>

The amount of asset that will be sent. Optional, one of fromAmount or toAmount must be specified.

Example:

"120.015"

toAmount
string<decimal>
Example:

"117500.03"

Response

OK

createdAt
string<date-time-millis>
required

Creation timestamp of the intent (epoch millis)

Example:

"1794678400000"

fromAssetId
string
required

ID of the asset being sent

Example:

"2"

intentId
string
required

Unique user-generated ID of the intent

Example:

"rzsdziq1iknnzszmmtqz"

status
enum<string>
required

Current status of the intent order. See details

Available options:
not-exist,
user-initiated,
auction-in-progress,
wait-for-user-tx,
wait-for-oracle-confirm-user-tx,
wait-for-solver-tx,
wait-for-oracle-confirm-solver-tx,
completed,
liquidated,
cancelled
Example:

"auction-in-progress"

toAssetId
string
required

ID of the asset to receive

Example:

"5002"

updatedAt
string<date-time-millis>
required

Last update timestamp of the intent (epoch millis)

Example:

"1794764800000"

expiresAt
string<date-time-millis>

Expiration timestamp of the intent (epoch millis)

Example:

"1758188560749"

fromAmount
string<decimal>

Amount of the from-asset specified by the user

Example:

"100.50"

price
string<decimal>

Execution price of the swap (quote/base)

Example:

"101.2312"

toAmount
string<decimal>

Amount of the to-asset requested or estimated

Example:

"0.0025"

userSettlementDeadline
string<date-time-millis>

Deadline timestamp for user settlement (epoch millis)

Example:

"1759188567456"