curl --request PUT \
--url https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id} \
--header 'Content-Type: application/json' \
--header 'X-Account-ApiKey: <api-key>' \
--data '
{
"name": "Marketing - Production v2"
}
'import requests
url = "https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
payload = { "name": "Marketing - Production v2" }
headers = {
"X-Account-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Account-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Marketing - Production v2'})
};
fetch('https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}', 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.sendpost.io/api/v1/account/subaccount/{subaccount_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Marketing - Production v2'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Account-ApiKey: <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.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
payload := strings.NewReader("{\n \"name\": \"Marketing - Production v2\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Account-ApiKey", "<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.put("https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}")
.header("X-Account-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Marketing - Production v2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Account-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Marketing - Production v2\"\n}"
response = http.request(request)
puts response.read_body{
"id": 50441,
"accountId": 4021,
"name": "Transactional - Production",
"apiKey": "pR0YIuxYSbVwmQi2Y8Qs",
"type": 1,
"isPlus": false,
"labels": [],
"blocked": false,
"created": 1704067200000000000
}Update Sub-Account
Modify settings for an existing sub-account. Use this to rename sub-accounts, update labels, or modify configuration.
What Can Be Updated:
- Sub-account name
- Labels/tags for categorization
- Other configuration settings
Use Cases:
- Rename sub-account for clarity
- Update labels for organizational changes
- Modify settings after initial setup
curl --request PUT \
--url https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id} \
--header 'Content-Type: application/json' \
--header 'X-Account-ApiKey: <api-key>' \
--data '
{
"name": "Marketing - Production v2"
}
'import requests
url = "https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
payload = { "name": "Marketing - Production v2" }
headers = {
"X-Account-ApiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Account-ApiKey': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Marketing - Production v2'})
};
fetch('https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}', 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.sendpost.io/api/v1/account/subaccount/{subaccount_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Marketing - Production v2'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Account-ApiKey: <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.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
payload := strings.NewReader("{\n \"name\": \"Marketing - Production v2\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Account-ApiKey", "<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.put("https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}")
.header("X-Account-ApiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Marketing - Production v2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Account-ApiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Marketing - Production v2\"\n}"
response = http.request(request)
puts response.read_body{
"id": 50441,
"accountId": 4021,
"name": "Transactional - Production",
"apiKey": "pR0YIuxYSbVwmQi2Y8Qs",
"type": 1,
"isPlus": false,
"labels": [],
"blocked": false,
"created": 1704067200000000000
}Authorizations
This api key can be used for all account level operations
Path Parameters
The unique ID of the sub-account to update.
12
Body
Request body for updating an existing sub-account
New display name for the sub-account
1 - 100"Marketing - Production v2"
Response
Sub-account updated successfully.
A sub-account represents an isolated sending environment within your main account.
Use cases for sub-accounts:
- Separate transactional vs marketing emails
- Multi-tenant applications (one sub-account per customer)
- Different products or business units
- Development, staging, and production environments
Each sub-account has:
- Its own API key for sending
- Separate domains and sender verification
- Independent suppression list
- Isolated statistics and reporting
Unique identifier for the sub-account
50441
Identifier of the parent account this sub-account belongs to
4021
Display name for the sub-account. Must be unique within your account. Use descriptive names.
100"Transactional - Production"
API key for this sub-account. Use this as the X-SubAccount-ApiKey header
when making API calls for this sub-account (sending emails, managing domains, etc.).
Security: Treat this like a password. Rotate if compromised.
"pR0YIuxYSbVwmQi2Y8Qs"
Type of sub-account:
0= Default (the primary sub-account created with your account)1= Custom (additional sub-accounts you create)
Note: The default sub-account cannot be deleted.
0, 1 1
Whether this sub-account belongs to a SendX Plus customer. SendX Plus is a premium tier that provides enhanced features and support.
false
Custom labels for organizing and filtering sub-accounts
Show child attributes
Show child attributes
Whether the sub-account is blocked from sending. A blocked sub-account cannot send emails. Common reasons:
- High bounce/spam rates
- Billing issues
- Policy violations
- Manual suspension by administrator
false
UNIX epoch timestamp in nanoseconds when the sub-account was created
1704067200000000000
Was this page helpful?