Skip to main content
POST
/
api
/
v0
/
smart_account
/
transaction
/
spending_limit
/
update
Manage Spending Limit
curl --request POST \
  --url https://developer-api.squads.so/api/v0/smart_account/transaction/spending_limit/update \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "smart_account_address": "<string>",
  "spending_limit_address": "<string>",
  "amount": "<string>",
  "token_address": "<string>",
  "transaction_signers": [
    "<string>"
  ],
  "spending_limit_signers": [
    "<string>"
  ],
  "destinations": [
    "<string>"
  ],
  "fee_config": {
    "payer_address": "<string>"
  }
}
'
import requests

url = "https://developer-api.squads.so/api/v0/smart_account/transaction/spending_limit/update"

payload = {
"smart_account_address": "<string>",
"spending_limit_address": "<string>",
"amount": "<string>",
"token_address": "<string>",
"transaction_signers": ["<string>"],
"spending_limit_signers": ["<string>"],
"destinations": ["<string>"],
"fee_config": { "payer_address": "<string>" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
smart_account_address: '<string>',
spending_limit_address: '<string>',
amount: '<string>',
token_address: '<string>',
transaction_signers: ['<string>'],
spending_limit_signers: ['<string>'],
destinations: ['<string>'],
fee_config: {payer_address: '<string>'}
})
};

fetch('https://developer-api.squads.so/api/v0/smart_account/transaction/spending_limit/update', 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://developer-api.squads.so/api/v0/smart_account/transaction/spending_limit/update",
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([
'smart_account_address' => '<string>',
'spending_limit_address' => '<string>',
'amount' => '<string>',
'token_address' => '<string>',
'transaction_signers' => [
'<string>'
],
'spending_limit_signers' => [
'<string>'
],
'destinations' => [
'<string>'
],
'fee_config' => [
'payer_address' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://developer-api.squads.so/api/v0/smart_account/transaction/spending_limit/update"

payload := strings.NewReader("{\n \"smart_account_address\": \"<string>\",\n \"spending_limit_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"token_address\": \"<string>\",\n \"transaction_signers\": [\n \"<string>\"\n ],\n \"spending_limit_signers\": [\n \"<string>\"\n ],\n \"destinations\": [\n \"<string>\"\n ],\n \"fee_config\": {\n \"payer_address\": \"<string>\"\n }\n}")

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

req.Header.Add("Authorization", "Bearer <token>")
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://developer-api.squads.so/api/v0/smart_account/transaction/spending_limit/update")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"smart_account_address\": \"<string>\",\n \"spending_limit_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"token_address\": \"<string>\",\n \"transaction_signers\": [\n \"<string>\"\n ],\n \"spending_limit_signers\": [\n \"<string>\"\n ],\n \"destinations\": [\n \"<string>\"\n ],\n \"fee_config\": {\n \"payer_address\": \"<string>\"\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://developer-api.squads.so/api/v0/smart_account/transaction/spending_limit/update")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"smart_account_address\": \"<string>\",\n \"spending_limit_address\": \"<string>\",\n \"amount\": \"<string>\",\n \"token_address\": \"<string>\",\n \"transaction_signers\": [\n \"<string>\"\n ],\n \"spending_limit_signers\": [\n \"<string>\"\n ],\n \"destinations\": [\n \"<string>\"\n ],\n \"fee_config\": {\n \"payer_address\": \"<string>\"\n }\n}"

response = http.request(request)
puts response.read_body
{
  "transaction": "<string>",
  "fee": {
    "amount": "<string>",
    "amount_decimal": "<string>",
    "currency": "<string>",
    "sol_equivalent": {
      "amount": "<string>",
      "amount_decimal": "<string>"
    }
  }
}
{
"error": "<string>"
}
{
"error": "<string>"
}

Authorizations

Authorization
string
header
required

Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"

Headers

x-squads-network
enum<string>
default:mainnet

Specifies which Solana network to use. Defaults to 'mainnet' if not provided. Valid values are 'devnet' or 'mainnet'.

Available options:
devnet,
mainnet

Body

application/json
smart_account_address
string
required

The address of the Smart Account

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
spending_limit_address
string
required

The address of the spending limit to modify

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
amount
string<uint64>
required

The new maximum amount in base units that can be spent within the specified period

token_address
string
required

The address of the token mint for which this spending limit applies

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
period
enum<string>
required

Defines the period for spending limits:

  • ONE_TIME: Limit can only be used once
  • DAY: Limit resets daily
  • WEEK: Limit resets weekly
  • MONTH: Limit resets monthly
Available options:
ONE_TIME,
DAY,
WEEK,
MONTH
transaction_signers
string[]
required

List of addresses that will sign this transaction

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
spending_limit_signers
string[]
required

Updated list of signer addresses that are authorized to use this spending limit

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
destinations
string[]
required

Updated list of allowed recipient addresses. If empty, funds can be sent to any address

Pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$
fee_config
object
required

Response

Spending limit successfully updated

transaction
string
required

The transaction encoded in base64

fee
object
required