curl --request GET \
--url https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id} \
--header 'X-Account-ApiKey: <api-key>'import requests
url = "https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
headers = {"X-Account-ApiKey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Account-ApiKey': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-ApiKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}")
.header("X-Account-ApiKey", "<api-key>")
.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::Get.new(url)
request["X-Account-ApiKey"] = '<api-key>'
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
}Get Sub-Account
Retrieve detailed information about a specific sub-account, including API keys, SMTP credentials, and configuration.
Response Includes:
- Sub-account name and ID
- API key for sub-account authentication
- SMTP credentials (if enabled)
- Team members with access
- Labels/tags for categorization
- Creation timestamp
curl --request GET \
--url https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id} \
--header 'X-Account-ApiKey: <api-key>'import requests
url = "https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
headers = {"X-Account-ApiKey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Account-ApiKey': '<api-key>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-ApiKey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sendpost.io/api/v1/account/subaccount/{subaccount_id}")
.header("X-Account-ApiKey", "<api-key>")
.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::Get.new(url)
request["X-Account-ApiKey"] = '<api-key>'
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 retrieve.
11
Response
Successfully retrieved the sub-account.
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?