curl --request POST \
--url https://api.sandbox.brickken.com/x402/rams/grant-mandate \
--header 'Content-Type: application/json' \
--header 'X-Payment: <api-key>' \
--data '
{
"chainId": "11155111",
"agent": "<string>",
"principal": "<string>",
"validUntil": 123,
"identityRef": "<string>",
"asset": "<string>",
"maxTransactionValue": "<string>",
"maxCumulativeValue": "<string>",
"actions": [
"<string>"
],
"signerAddress": "<string>",
"validFrom": 123,
"complianceProvider": "<string>",
"metadata": "<string>",
"signature": "<string>",
"deadline": "<string>",
"executionMode": "brickken-relayed",
"agentMandateAddress": "<string>",
"gasLimit": "<string>",
"nonce": 123,
"ownerEmail": "jsmith@example.com",
"email": "jsmith@example.com"
}
'import requests
url = "https://api.sandbox.brickken.com/x402/rams/grant-mandate"
payload = {
"chainId": "11155111",
"agent": "<string>",
"principal": "<string>",
"validUntil": 123,
"identityRef": "<string>",
"asset": "<string>",
"maxTransactionValue": "<string>",
"maxCumulativeValue": "<string>",
"actions": ["<string>"],
"signerAddress": "<string>",
"validFrom": 123,
"complianceProvider": "<string>",
"metadata": "<string>",
"signature": "<string>",
"deadline": "<string>",
"executionMode": "brickken-relayed",
"agentMandateAddress": "<string>",
"gasLimit": "<string>",
"nonce": 123,
"ownerEmail": "jsmith@example.com",
"email": "jsmith@example.com"
}
headers = {
"X-Payment": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Payment': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainId: '11155111',
agent: '<string>',
principal: '<string>',
validUntil: 123,
identityRef: '<string>',
asset: '<string>',
maxTransactionValue: '<string>',
maxCumulativeValue: '<string>',
actions: ['<string>'],
signerAddress: '<string>',
validFrom: 123,
complianceProvider: '<string>',
metadata: '<string>',
signature: '<string>',
deadline: '<string>',
executionMode: 'brickken-relayed',
agentMandateAddress: '<string>',
gasLimit: '<string>',
nonce: 123,
ownerEmail: 'jsmith@example.com',
email: 'jsmith@example.com'
})
};
fetch('https://api.sandbox.brickken.com/x402/rams/grant-mandate', 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.sandbox.brickken.com/x402/rams/grant-mandate",
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([
'chainId' => '11155111',
'agent' => '<string>',
'principal' => '<string>',
'validUntil' => 123,
'identityRef' => '<string>',
'asset' => '<string>',
'maxTransactionValue' => '<string>',
'maxCumulativeValue' => '<string>',
'actions' => [
'<string>'
],
'signerAddress' => '<string>',
'validFrom' => 123,
'complianceProvider' => '<string>',
'metadata' => '<string>',
'signature' => '<string>',
'deadline' => '<string>',
'executionMode' => 'brickken-relayed',
'agentMandateAddress' => '<string>',
'gasLimit' => '<string>',
'nonce' => 123,
'ownerEmail' => 'jsmith@example.com',
'email' => 'jsmith@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Payment: <api-key>"
],
]);
$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.sandbox.brickken.com/x402/rams/grant-mandate"
payload := strings.NewReader("{\n \"chainId\": \"11155111\",\n \"agent\": \"<string>\",\n \"principal\": \"<string>\",\n \"validUntil\": 123,\n \"identityRef\": \"<string>\",\n \"asset\": \"<string>\",\n \"maxTransactionValue\": \"<string>\",\n \"maxCumulativeValue\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"signerAddress\": \"<string>\",\n \"validFrom\": 123,\n \"complianceProvider\": \"<string>\",\n \"metadata\": \"<string>\",\n \"signature\": \"<string>\",\n \"deadline\": \"<string>\",\n \"executionMode\": \"brickken-relayed\",\n \"agentMandateAddress\": \"<string>\",\n \"gasLimit\": \"<string>\",\n \"nonce\": 123,\n \"ownerEmail\": \"jsmith@example.com\",\n \"email\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Payment", "<api-key>")
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.sandbox.brickken.com/x402/rams/grant-mandate")
.header("X-Payment", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": \"11155111\",\n \"agent\": \"<string>\",\n \"principal\": \"<string>\",\n \"validUntil\": 123,\n \"identityRef\": \"<string>\",\n \"asset\": \"<string>\",\n \"maxTransactionValue\": \"<string>\",\n \"maxCumulativeValue\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"signerAddress\": \"<string>\",\n \"validFrom\": 123,\n \"complianceProvider\": \"<string>\",\n \"metadata\": \"<string>\",\n \"signature\": \"<string>\",\n \"deadline\": \"<string>\",\n \"executionMode\": \"brickken-relayed\",\n \"agentMandateAddress\": \"<string>\",\n \"gasLimit\": \"<string>\",\n \"nonce\": 123,\n \"ownerEmail\": \"jsmith@example.com\",\n \"email\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.brickken.com/x402/rams/grant-mandate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Payment"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainId\": \"11155111\",\n \"agent\": \"<string>\",\n \"principal\": \"<string>\",\n \"validUntil\": 123,\n \"identityRef\": \"<string>\",\n \"asset\": \"<string>\",\n \"maxTransactionValue\": \"<string>\",\n \"maxCumulativeValue\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"signerAddress\": \"<string>\",\n \"validFrom\": 123,\n \"complianceProvider\": \"<string>\",\n \"metadata\": \"<string>\",\n \"signature\": \"<string>\",\n \"deadline\": \"<string>\",\n \"executionMode\": \"brickken-relayed\",\n \"agentMandateAddress\": \"<string>\",\n \"gasLimit\": \"<string>\",\n \"nonce\": 123,\n \"ownerEmail\": \"jsmith@example.com\",\n \"email\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transactions": {},
"txId": "<string>",
"info": {}
}
}Grant RAMS Mandate
Prepare a compliance-gated ERC-8226 mandate, directly or with a principal EIP-712 signature.
curl --request POST \
--url https://api.sandbox.brickken.com/x402/rams/grant-mandate \
--header 'Content-Type: application/json' \
--header 'X-Payment: <api-key>' \
--data '
{
"chainId": "11155111",
"agent": "<string>",
"principal": "<string>",
"validUntil": 123,
"identityRef": "<string>",
"asset": "<string>",
"maxTransactionValue": "<string>",
"maxCumulativeValue": "<string>",
"actions": [
"<string>"
],
"signerAddress": "<string>",
"validFrom": 123,
"complianceProvider": "<string>",
"metadata": "<string>",
"signature": "<string>",
"deadline": "<string>",
"executionMode": "brickken-relayed",
"agentMandateAddress": "<string>",
"gasLimit": "<string>",
"nonce": 123,
"ownerEmail": "jsmith@example.com",
"email": "jsmith@example.com"
}
'import requests
url = "https://api.sandbox.brickken.com/x402/rams/grant-mandate"
payload = {
"chainId": "11155111",
"agent": "<string>",
"principal": "<string>",
"validUntil": 123,
"identityRef": "<string>",
"asset": "<string>",
"maxTransactionValue": "<string>",
"maxCumulativeValue": "<string>",
"actions": ["<string>"],
"signerAddress": "<string>",
"validFrom": 123,
"complianceProvider": "<string>",
"metadata": "<string>",
"signature": "<string>",
"deadline": "<string>",
"executionMode": "brickken-relayed",
"agentMandateAddress": "<string>",
"gasLimit": "<string>",
"nonce": 123,
"ownerEmail": "jsmith@example.com",
"email": "jsmith@example.com"
}
headers = {
"X-Payment": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Payment': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainId: '11155111',
agent: '<string>',
principal: '<string>',
validUntil: 123,
identityRef: '<string>',
asset: '<string>',
maxTransactionValue: '<string>',
maxCumulativeValue: '<string>',
actions: ['<string>'],
signerAddress: '<string>',
validFrom: 123,
complianceProvider: '<string>',
metadata: '<string>',
signature: '<string>',
deadline: '<string>',
executionMode: 'brickken-relayed',
agentMandateAddress: '<string>',
gasLimit: '<string>',
nonce: 123,
ownerEmail: 'jsmith@example.com',
email: 'jsmith@example.com'
})
};
fetch('https://api.sandbox.brickken.com/x402/rams/grant-mandate', 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.sandbox.brickken.com/x402/rams/grant-mandate",
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([
'chainId' => '11155111',
'agent' => '<string>',
'principal' => '<string>',
'validUntil' => 123,
'identityRef' => '<string>',
'asset' => '<string>',
'maxTransactionValue' => '<string>',
'maxCumulativeValue' => '<string>',
'actions' => [
'<string>'
],
'signerAddress' => '<string>',
'validFrom' => 123,
'complianceProvider' => '<string>',
'metadata' => '<string>',
'signature' => '<string>',
'deadline' => '<string>',
'executionMode' => 'brickken-relayed',
'agentMandateAddress' => '<string>',
'gasLimit' => '<string>',
'nonce' => 123,
'ownerEmail' => 'jsmith@example.com',
'email' => 'jsmith@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Payment: <api-key>"
],
]);
$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.sandbox.brickken.com/x402/rams/grant-mandate"
payload := strings.NewReader("{\n \"chainId\": \"11155111\",\n \"agent\": \"<string>\",\n \"principal\": \"<string>\",\n \"validUntil\": 123,\n \"identityRef\": \"<string>\",\n \"asset\": \"<string>\",\n \"maxTransactionValue\": \"<string>\",\n \"maxCumulativeValue\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"signerAddress\": \"<string>\",\n \"validFrom\": 123,\n \"complianceProvider\": \"<string>\",\n \"metadata\": \"<string>\",\n \"signature\": \"<string>\",\n \"deadline\": \"<string>\",\n \"executionMode\": \"brickken-relayed\",\n \"agentMandateAddress\": \"<string>\",\n \"gasLimit\": \"<string>\",\n \"nonce\": 123,\n \"ownerEmail\": \"jsmith@example.com\",\n \"email\": \"jsmith@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Payment", "<api-key>")
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.sandbox.brickken.com/x402/rams/grant-mandate")
.header("X-Payment", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chainId\": \"11155111\",\n \"agent\": \"<string>\",\n \"principal\": \"<string>\",\n \"validUntil\": 123,\n \"identityRef\": \"<string>\",\n \"asset\": \"<string>\",\n \"maxTransactionValue\": \"<string>\",\n \"maxCumulativeValue\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"signerAddress\": \"<string>\",\n \"validFrom\": 123,\n \"complianceProvider\": \"<string>\",\n \"metadata\": \"<string>\",\n \"signature\": \"<string>\",\n \"deadline\": \"<string>\",\n \"executionMode\": \"brickken-relayed\",\n \"agentMandateAddress\": \"<string>\",\n \"gasLimit\": \"<string>\",\n \"nonce\": 123,\n \"ownerEmail\": \"jsmith@example.com\",\n \"email\": \"jsmith@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.brickken.com/x402/rams/grant-mandate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Payment"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainId\": \"11155111\",\n \"agent\": \"<string>\",\n \"principal\": \"<string>\",\n \"validUntil\": 123,\n \"identityRef\": \"<string>\",\n \"asset\": \"<string>\",\n \"maxTransactionValue\": \"<string>\",\n \"maxCumulativeValue\": \"<string>\",\n \"actions\": [\n \"<string>\"\n ],\n \"signerAddress\": \"<string>\",\n \"validFrom\": 123,\n \"complianceProvider\": \"<string>\",\n \"metadata\": \"<string>\",\n \"signature\": \"<string>\",\n \"deadline\": \"<string>\",\n \"executionMode\": \"brickken-relayed\",\n \"agentMandateAddress\": \"<string>\",\n \"gasLimit\": \"<string>\",\n \"nonce\": 123,\n \"ownerEmail\": \"jsmith@example.com\",\n \"email\": \"jsmith@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"transactions": {},
"txId": "<string>",
"info": {}
}
}ramsGrantMandate. The principal must already be eligible with the selected ComplianceProvider.
Authorization modes
| Mode | signerAddress | Signature fields |
|---|---|---|
| Direct | Principal | Omit signature; the transaction encodes 0x |
| Principal signature | Any transaction sender/relayer | signature and the same deadline returned by Typed Data |
Key fields
agent, principal, validUntil, identityRef, asset, both value caps, and at least one actions entry are required. validFrom defaults to immediate. Values are raw base units; caps accept max/unlimited. Actions accept bytes32 values or 4-byte selectors.
Response
ReturnstxId, unsigned transactions, and info with the contract, authorization mode, and EIP-712 nonce when applicable. The x402 charge is split evenly between prepare and send.
Next step
Preparing does not touch the chain. The response gives youtxId, the unsigned transactions, and an x402Requirements quote.
Choose who broadcasts
client-signed (the default) — you sign the transaction and Brickken broadcasts it. client-broadcast — you sign and broadcast it yourself, then confirm with txHash. Either way the operation price is split evenly: half at prepare, half at send.Submit it and settle the payment
POST to /send-transactions. The first attempt answers 402 Payment Required; read PAYMENT-REQUIRED, sign the payment locally, and retry with X-PAYMENT. An x-api-key is accepted here instead of paying.Poll until it confirms
GET /get-transaction-status with the txId. Your payment settles only after the operation confirms, and is released if it reverts.Authorizations
Base64-encoded x402 payment payload. Supported for x402-eligible agentic methods on /x402/... facades, /prepare-transactions, and eligible /send-transactions retries.
Body
Target operation chain ID. RAMS is available on Ethereum Sepolia (11155111) only at launch. Decimal and 0x hex values are accepted.
"11155111"
"0xaa36a7"
Agent wallet receiving the mandate.
^0x[a-fA-F0-9]{40}$Principal delegating authority. Direct mode: must equal signerAddress.
^0x[a-fA-F0-9]{40}$Mandate expiry. Must be greater than now and greater than validFrom. Unix timestamp in seconds (uint48).
Compliance identity reference (bytes32, 0x + 64 hex). Must match the principal's record on the compliance provider.
^0x[a-fA-F0-9]{64}$Asset (token) the mandate is scoped to.
^0x[a-fA-F0-9]{40}$Per-transaction value cap. Alias "max" / "unlimited" (case-insensitive) = 2^256-1 (no cap). Raw base units — no decimals scaling is applied. Decimal string (canonical), 0x hex string, or number accepted.
Cumulative value cap over the mandate lifetime. Alias "max" / "unlimited" = 2^256-1 (no cap). Raw base units — no decimals scaling is applied. Decimal string (canonical), 0x hex string, or number accepted.
Allowed actions. Each item is a bytes32 action or a 4-byte function selector, e.g. 0x23b872dd for transferFrom.
1bytes32 action (0x + 64 hex) or 4-byte selector (0x + 8 hex). Selectors are normalized by right-padding to 32 bytes (left-aligned, Solidity bytes32(selector)).
Required for direct/client-signed mode. Omit for brickken-relayed execution; Brickken supplies its operation signer.
^0x[a-fA-F0-9]{40}$Mandate start time. Defaults to 0 (immediately valid). Unix timestamp in seconds (uint48).
Compliance provider contract chosen by the principal. Must be non-zero. Defaults to the chain's configured RAMS ComplianceProvider address.
^0x[a-fA-F0-9]{40}$Optional opaque metadata (bytes32). Defaults to the zero value.
^0x[a-fA-F0-9]{64}$Optional EIP-712 signature from the principal (never the operator). At least 65 bytes for EOAs (r||s||v); longer payloads are allowed for EIP-1271 contract wallets. Omit for direct mode (the transaction sender authorizes on-chain). Obtain the payload to sign from GET /rams/typed-data/{operation}.
^0x([a-fA-F0-9]{2})*$Unix-seconds signature deadline (uint256). Required when signature is provided and must be greater than now — it must equal the deadline that was signed. Ignored (encoded as 0) in direct mode.
Optional. Only valid together with signature + deadline: Brickken's relayer becomes the transaction sender and the on-chain authorization rides on the principal's EIP-712 signature. Omit for client-signed execution (default on all /x402/rams facades).
brickken-relayed Optional AgentMandate contract override; defaults to the chain's configured RAMS AgentMandate address.
^0x[a-fA-F0-9]{40}$Optional explicit gas limit.
Optional explicit transaction nonce when managing nonces manually.
Optional owner attribution email.
Alias for ownerEmail where supported.
Response
Prepared unsigned transaction payload.
Show child attributes
Show child attributes