Create a new smart account
curl --request POST \
--url https://developer-api.squads.so/api/v1/smart-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-squads-network: <x-squads-network>' \
--data '
{
"smart_account_signers": [
{
"address": "<string>",
"permissions": []
}
],
"threshold": 123,
"admin_address": "<string>",
"memo": "<string>"
}
'import requests
url = "https://developer-api.squads.so/api/v1/smart-accounts"
payload = {
"smart_account_signers": [
{
"address": "<string>",
"permissions": []
}
],
"threshold": 123,
"admin_address": "<string>",
"memo": "<string>"
}
headers = {
"x-squads-network": "<x-squads-network>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-squads-network': '<x-squads-network>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
smart_account_signers: [{address: '<string>', permissions: []}],
threshold: 123,
admin_address: '<string>',
memo: '<string>'
})
};
fetch('https://developer-api.squads.so/api/v1/smart-accounts', 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",
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_signers' => [
[
'address' => '<string>',
'permissions' => [
]
]
],
'threshold' => 123,
'admin_address' => '<string>',
'memo' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://developer-api.squads.so/api/v1/smart-accounts"
payload := strings.NewReader("{\n \"smart_account_signers\": [\n {\n \"address\": \"<string>\",\n \"permissions\": []\n }\n ],\n \"threshold\": 123,\n \"admin_address\": \"<string>\",\n \"memo\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-squads-network", "<x-squads-network>")
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/v1/smart-accounts")
.header("x-squads-network", "<x-squads-network>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"smart_account_signers\": [\n {\n \"address\": \"<string>\",\n \"permissions\": []\n }\n ],\n \"threshold\": 123,\n \"admin_address\": \"<string>\",\n \"memo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer-api.squads.so/api/v1/smart-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-squads-network"] = '<x-squads-network>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"smart_account_signers\": [\n {\n \"address\": \"<string>\",\n \"permissions\": []\n }\n ],\n \"threshold\": 123,\n \"admin_address\": \"<string>\",\n \"memo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "created",
"smart_account_address": "<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>"
]
}{
"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>"
]
}Smart Accounts
Create Smart Account
Create a new Smart Account
POST
/
api
/
v1
/
smart-accounts
Create a new smart account
curl --request POST \
--url https://developer-api.squads.so/api/v1/smart-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-squads-network: <x-squads-network>' \
--data '
{
"smart_account_signers": [
{
"address": "<string>",
"permissions": []
}
],
"threshold": 123,
"admin_address": "<string>",
"memo": "<string>"
}
'import requests
url = "https://developer-api.squads.so/api/v1/smart-accounts"
payload = {
"smart_account_signers": [
{
"address": "<string>",
"permissions": []
}
],
"threshold": 123,
"admin_address": "<string>",
"memo": "<string>"
}
headers = {
"x-squads-network": "<x-squads-network>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-squads-network': '<x-squads-network>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
smart_account_signers: [{address: '<string>', permissions: []}],
threshold: 123,
admin_address: '<string>',
memo: '<string>'
})
};
fetch('https://developer-api.squads.so/api/v1/smart-accounts', 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",
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_signers' => [
[
'address' => '<string>',
'permissions' => [
]
]
],
'threshold' => 123,
'admin_address' => '<string>',
'memo' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://developer-api.squads.so/api/v1/smart-accounts"
payload := strings.NewReader("{\n \"smart_account_signers\": [\n {\n \"address\": \"<string>\",\n \"permissions\": []\n }\n ],\n \"threshold\": 123,\n \"admin_address\": \"<string>\",\n \"memo\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-squads-network", "<x-squads-network>")
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/v1/smart-accounts")
.header("x-squads-network", "<x-squads-network>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"smart_account_signers\": [\n {\n \"address\": \"<string>\",\n \"permissions\": []\n }\n ],\n \"threshold\": 123,\n \"admin_address\": \"<string>\",\n \"memo\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developer-api.squads.so/api/v1/smart-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-squads-network"] = '<x-squads-network>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"smart_account_signers\": [\n {\n \"address\": \"<string>\",\n \"permissions\": []\n }\n ],\n \"threshold\": 123,\n \"admin_address\": \"<string>\",\n \"memo\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": "created",
"smart_account_address": "<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>"
]
}{
"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>"
]
}Create a new Smart Account with your desired configuration of signers, threshold, and optional settings. The Smart Account will be created on-chain and you’ll receive its address in the response.
Key Concepts
- Signers and Permissions: Each signer must have specific permissions (CAN_INITIATE, CAN_VOTE, CAN_EXECUTE)
- Threshold: The minimum number of required signatures for any action
- Optional Settings: Configure an admin address to limit the ability to update the account’s settings to only the admin address
Idempotency
You can optionally provide an idempotency key via thex-idempotency-key header to prevent duplicate account creation. The idempotency key can be any random string and helps ensure that retrying the same request won’t create multiple accounts.
When using idempotency:
- If an account was already created with the provided key → Returns status “created” and the existing account address
- If a request is still being processed → Returns status “pending” and an empty address
- If no idempotency key is provided → Creates a new account and returns status “created” with the new address
Important Notes
- At least one signer must have CAN_INITIATE permission
- The threshold cannot exceed the number of signers with CAN_VOTE permission
- Use idempotency keys when retrying failed requests to prevent duplicate accounts
- The response status field indicates whether the account is ready to use
- Updating an account with an admin_address set requires admin mode
Authorizations
UUID-based API key provided by Squads
Headers
Specifies the network for the API request
Available options:
mainnet, devnet Optional idempotency key to prevent duplicate account creation. If provided, the API will return the same result for identical requests.
Body
application/json
Response
Smart account creation request processed successfully
Was this page helpful?