Get a specific spending limit
curl --request GET \
--url https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address} \
--header 'Authorization: Bearer <token>' \
--header 'x-squads-network: <x-squads-network>'import requests
url = "https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}"
headers = {
"x-squads-network": "<x-squads-network>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-squads-network': '<x-squads-network>', Authorization: 'Bearer <token>'}
};
fetch('https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}', 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/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-squads-network: <x-squads-network>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-squads-network", "<x-squads-network>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}")
.header("x-squads-network", "<x-squads-network>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-squads-network"] = '<x-squads-network>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"spending_limit": {
"address": "<string>",
"token_address": "<string>",
"amount": "<string>",
"remaining_amount": "<string>",
"last_reset": 123,
"spending_limit_signers": [
"<string>"
],
"destinations": [
"<string>"
],
"expiration": 123
}
}{
"status": 123,
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"expected": "<string>",
"actual": "<string>"
}
],
"metadata": {
"status": 123,
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"resource_id": "<string>",
"useful_links": [
"<string>"
]
},
"custom": {},
"simulation_logs": [
"<string>"
]
}{
"status": 123,
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"expected": "<string>",
"actual": "<string>"
}
],
"metadata": {
"status": 123,
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"resource_id": "<string>",
"useful_links": [
"<string>"
]
},
"custom": {},
"simulation_logs": [
"<string>"
]
}Spending Limits
Get Spending Limit
Get details of a specific spending limit
GET
/
api
/
v1
/
smart-accounts
/
{smart_account_address}
/
spending-limits
/
{spending_limit_address}
Get a specific spending limit
curl --request GET \
--url https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address} \
--header 'Authorization: Bearer <token>' \
--header 'x-squads-network: <x-squads-network>'import requests
url = "https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}"
headers = {
"x-squads-network": "<x-squads-network>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-squads-network': '<x-squads-network>', Authorization: 'Bearer <token>'}
};
fetch('https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}', 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/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-squads-network: <x-squads-network>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-squads-network", "<x-squads-network>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}")
.header("x-squads-network", "<x-squads-network>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer-api.squads.so/api/v1/smart-accounts/{smart_account_address}/spending-limits/{spending_limit_address}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-squads-network"] = '<x-squads-network>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"spending_limit": {
"address": "<string>",
"token_address": "<string>",
"amount": "<string>",
"remaining_amount": "<string>",
"last_reset": 123,
"spending_limit_signers": [
"<string>"
],
"destinations": [
"<string>"
],
"expiration": 123
}
}{
"status": 123,
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"expected": "<string>",
"actual": "<string>"
}
],
"metadata": {
"status": 123,
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"resource_id": "<string>",
"useful_links": [
"<string>"
]
},
"custom": {},
"simulation_logs": [
"<string>"
]
}{
"status": 123,
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>",
"expected": "<string>",
"actual": "<string>"
}
],
"metadata": {
"status": 123,
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"resource_id": "<string>",
"useful_links": [
"<string>"
]
},
"custom": {},
"simulation_logs": [
"<string>"
]
}Retrieve detailed information about a specific spending limit, including its current status and usage.
Key Concepts
- Limit Details: View configured amount and period
- Current Status: Check remaining amount and time until reset
- Token Information: See associated token mint address
Important Notes
- Remaining amount updates with each use
- Reset time indicates when the limit will refresh
- Returns 404 if the spending limit doesn’t exist
Authorizations
UUID-based API key provided by Squads
Headers
Specifies the network for the API request
Available options:
mainnet, devnet Path Parameters
The address of the smart account
The address of the spending limit
Response
Spending limit retrieved successfully
Show child attributes
Show child attributes
Was this page helpful?
⌘I