Local linking
curl --request POST \
--url https://api.compose.market/api/local/link-token \
--header 'Content-Type: application/json' \
--header 'x-session-user-address: <x-session-user-address>' \
--data '
{
"userAddress": "<string>",
"agentWallet": "<string>",
"agentCardCid": "<string>",
"chainId": 123,
"deviceId": "<string>",
"token": "<string>",
"connectedUserAddress": "<string>"
}
'import requests
url = "https://api.compose.market/api/local/link-token"
payload = {
"userAddress": "<string>",
"agentWallet": "<string>",
"agentCardCid": "<string>",
"chainId": 123,
"deviceId": "<string>",
"token": "<string>",
"connectedUserAddress": "<string>"
}
headers = {
"x-session-user-address": "<x-session-user-address>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-session-user-address': '<x-session-user-address>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
userAddress: '<string>',
agentWallet: '<string>',
agentCardCid: '<string>',
chainId: 123,
deviceId: '<string>',
token: '<string>',
connectedUserAddress: '<string>'
})
};
fetch('https://api.compose.market/api/local/link-token', 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.compose.market/api/local/link-token",
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([
'userAddress' => '<string>',
'agentWallet' => '<string>',
'agentCardCid' => '<string>',
'chainId' => 123,
'deviceId' => '<string>',
'token' => '<string>',
'connectedUserAddress' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-session-user-address: <x-session-user-address>"
],
]);
$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.compose.market/api/local/link-token"
payload := strings.NewReader("{\n \"userAddress\": \"<string>\",\n \"agentWallet\": \"<string>\",\n \"agentCardCid\": \"<string>\",\n \"chainId\": 123,\n \"deviceId\": \"<string>\",\n \"token\": \"<string>\",\n \"connectedUserAddress\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-session-user-address", "<x-session-user-address>")
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.compose.market/api/local/link-token")
.header("x-session-user-address", "<x-session-user-address>")
.header("Content-Type", "application/json")
.body("{\n \"userAddress\": \"<string>\",\n \"agentWallet\": \"<string>\",\n \"agentCardCid\": \"<string>\",\n \"chainId\": 123,\n \"deviceId\": \"<string>\",\n \"token\": \"<string>\",\n \"connectedUserAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compose.market/api/local/link-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-session-user-address"] = '<x-session-user-address>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userAddress\": \"<string>\",\n \"agentWallet\": \"<string>\",\n \"agentCardCid\": \"<string>\",\n \"chainId\": 123,\n \"deviceId\": \"<string>\",\n \"token\": \"<string>\",\n \"connectedUserAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyMesh
Local linking
Create and redeem deep-link tokens for local Manowar clients.
POST
/
api
/
local
/
link-token
Local linking
curl --request POST \
--url https://api.compose.market/api/local/link-token \
--header 'Content-Type: application/json' \
--header 'x-session-user-address: <x-session-user-address>' \
--data '
{
"userAddress": "<string>",
"agentWallet": "<string>",
"agentCardCid": "<string>",
"chainId": 123,
"deviceId": "<string>",
"token": "<string>",
"connectedUserAddress": "<string>"
}
'import requests
url = "https://api.compose.market/api/local/link-token"
payload = {
"userAddress": "<string>",
"agentWallet": "<string>",
"agentCardCid": "<string>",
"chainId": 123,
"deviceId": "<string>",
"token": "<string>",
"connectedUserAddress": "<string>"
}
headers = {
"x-session-user-address": "<x-session-user-address>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-session-user-address': '<x-session-user-address>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
userAddress: '<string>',
agentWallet: '<string>',
agentCardCid: '<string>',
chainId: 123,
deviceId: '<string>',
token: '<string>',
connectedUserAddress: '<string>'
})
};
fetch('https://api.compose.market/api/local/link-token', 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.compose.market/api/local/link-token",
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([
'userAddress' => '<string>',
'agentWallet' => '<string>',
'agentCardCid' => '<string>',
'chainId' => 123,
'deviceId' => '<string>',
'token' => '<string>',
'connectedUserAddress' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-session-user-address: <x-session-user-address>"
],
]);
$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.compose.market/api/local/link-token"
payload := strings.NewReader("{\n \"userAddress\": \"<string>\",\n \"agentWallet\": \"<string>\",\n \"agentCardCid\": \"<string>\",\n \"chainId\": 123,\n \"deviceId\": \"<string>\",\n \"token\": \"<string>\",\n \"connectedUserAddress\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-session-user-address", "<x-session-user-address>")
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.compose.market/api/local/link-token")
.header("x-session-user-address", "<x-session-user-address>")
.header("Content-Type", "application/json")
.body("{\n \"userAddress\": \"<string>\",\n \"agentWallet\": \"<string>\",\n \"agentCardCid\": \"<string>\",\n \"chainId\": 123,\n \"deviceId\": \"<string>\",\n \"token\": \"<string>\",\n \"connectedUserAddress\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.compose.market/api/local/link-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-session-user-address"] = '<x-session-user-address>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userAddress\": \"<string>\",\n \"agentWallet\": \"<string>\",\n \"agentCardCid\": \"<string>\",\n \"chainId\": 123,\n \"deviceId\": \"<string>\",\n \"token\": \"<string>\",\n \"connectedUserAddress\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyLocal linking routes bind the web session, local device, agent wallet, and active session context.
Routes
| Method | Path | Description |
|---|---|---|
POST | /api/local/link-token | Creates a short-lived local link token. |
POST | /api/local/link-token/redeem | Redeems a local link token from a device. |
POST | /api/local/deployments/register | Registers a local deployment for an active session. |
Create link body
string
required
Wallet address. Must match
x-session-user-address.string
Agent wallet address.
string
Agent card CID-like identifier.
number
Chain ID. Defaults to the active chain.
string
Optional local device ID. When present, the link token is local-first and bound to the device.
Redeem body
string
required
Link token returned by
/api/local/link-token.string
required
Local device ID.
string
Optional connected wallet check.
Headers
string
required
Must match the
userAddress body field.string
Optional for link-token creation, required for deployment registration. When present, it must be a valid active session Compose Key.
⌘I