Skip to content
Get Started

Subaccounts

Create and manage child accounts for agency partners

Create and manage child accounts under your agency account. Subaccounts receive their own API credentials and phone line for independent messaging.

Agency accounts only. These endpoints are restricted to accounts with agency permissions. Contact [email protected] to enable agency access.


Create a new child account with automatic phone line assignment.

POST /request-child-account
ParameterTypeRequiredDescription
company_namestringYesName for the child account
primary_emailstringYesPrimary email for the child account
desired_area_codestringNoPreferred 3-digit area code for the assigned phone line
userstringNoUser name or identifier
emailstringNoAdditional email
Terminal window
curl -X POST "https://api.sendblue.com/request-child-account" \
-H "sb-api-key-id: YOUR_API_KEY" \
-H "sb-api-secret-key: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"company_name": "my-client",
"primary_email": "[email protected]",
"desired_area_code": "415",
"user": "Jane Smith",
"email": "[email protected]"
}'
const axios = require("axios");
const response = await axios.post(
"https://api.sendblue.com/request-child-account",
{
company_name: "my-client",
primary_email: "[email protected]",
desired_area_code: "415",
user: "Jane Smith",
},
{
headers: {
"sb-api-key-id": "YOUR_API_KEY",
"sb-api-secret-key": "YOUR_API_SECRET",
"Content-Type": "application/json",
},
}
);
import requests
response = requests.post(
"https://api.sendblue.com/request-child-account",
json={
"company_name": "my-client",
"primary_email": "[email protected]",
"desired_area_code": "415",
"user": "Jane Smith",
"email": "[email protected]"
},
headers={
"sb-api-key-id": "YOUR_API_KEY",
"sb-api-secret-key": "YOUR_API_SECRET",
"Content-Type": "application/json"
}
)
{
"status": "OK",
"data": {
"company_name": "[email protected]",
"api_key": "child_api_key_here",
"api_secret": "child_api_secret_here",
"assigned_number": "+14155551234"
}
}

If the requested area code is unavailable, a temporary line is assigned while your request is processed:

{
"status": "OK",
"data": {
"company_name": "[email protected]",
"api_key": "child_api_key_here",
"api_secret": "child_api_secret_here",
"assigned_number": "+12025551234",
"line_request_ticket_id": 67890,
"line_request_status": "OPEN",
"message": "Requested area code 415 is not currently available. A temporary line has been assigned while we fulfill your request."
}
}

If the account is created but line assignment fails:

{
"status": "PARTIAL",
"data": {
"company_name": "[email protected]",
"api_key": "child_api_key_here",
"api_secret": "child_api_secret_here",
"line_assignment_failed": true,
"message": "Account created but line assignment failed. Please contact support."
}
}
FieldTypeDescription
company_namestringFull child account name ({parent_email}-{company_name})
api_keystringAPI key for the child account
api_secretstringAPI secret for the child account
assigned_numberstringAssigned phone number in E.164 format
line_request_ticket_idnumberTicket ID if area code request is pending (use Check Request Status to track)
line_request_statusstringOPEN if a line request ticket was created
messagestringAdditional context when area code is unavailable or line assignment fails
line_assignment_failedbooleantrue if line assignment failed (partial success)
HTTP StatusDescription
400Missing required fields or invalid area code format
401Invalid API credentials
403Account does not have agency permissions
409A child account with this name already exists
500Server error during account or line creation
{
"status": "ERROR",
"message": "company_name and primary_email are required"
}

Get the list of area codes currently available for phone line assignment.

GET /available-area-codes
Terminal window
curl -X GET "https://api.sendblue.com/available-area-codes" \
-H "sb-api-key-id: YOUR_API_KEY" \
-H "sb-api-secret-key: YOUR_API_SECRET"
const axios = require("axios");
const response = await axios.get(
"https://api.sendblue.com/available-area-codes",
{
headers: {
"sb-api-key-id": "YOUR_API_KEY",
"sb-api-secret-key": "YOUR_API_SECRET",
},
}
);
import requests
response = requests.get(
"https://api.sendblue.com/available-area-codes",
headers={
"sb-api-key-id": "YOUR_API_KEY",
"sb-api-secret-key": "YOUR_API_SECRET"
}
)
{
"status": "OK",
"data": {
"area_codes": ["212", "310", "415", "512", "617", "720", "818"]
}
}
HTTP StatusDescription
401Invalid API credentials
500Failed to retrieve area codes

  • Agency access required: Only accounts with agency permissions can create child accounts. Contact [email protected] to request access.
  • Naming convention: Child account names are automatically prefixed with your account email (e.g., [email protected]).
  • Area code availability: Use the List Available Area Codes endpoint to check availability before creating an account. If your preferred area code is unavailable, a temporary line will be assigned while your request is processed.
  • Credentials: Store the returned api_key and api_secret securely — they are only returned once at creation time.
  • Line request tracking: If a line_request_ticket_id is returned, you can track its status using the Check Request Status endpoint.