curl --request POST \
--url https://api.wavix.com/v1/sub-organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Company",
"default_destinations": {
"sms_endpoint": "https://examples.com/sms",
"dlr_endpoint": "https://examples.com/dlr"
}
}
'import requests
url = "https://api.wavix.com/v1/sub-organizations"
payload = {
"name": "Company",
"default_destinations": {
"sms_endpoint": "https://examples.com/sms",
"dlr_endpoint": "https://examples.com/dlr"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Company',
default_destinations: {
sms_endpoint: 'https://examples.com/sms',
dlr_endpoint: 'https://examples.com/dlr'
}
})
};
fetch('https://api.wavix.com/v1/sub-organizations', 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.wavix.com/v1/sub-organizations",
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([
'name' => 'Company',
'default_destinations' => [
'sms_endpoint' => 'https://examples.com/sms',
'dlr_endpoint' => 'https://examples.com/dlr'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.wavix.com/v1/sub-organizations"
payload := strings.NewReader("{\n \"name\": \"Company\",\n \"default_destinations\": {\n \"sms_endpoint\": \"https://examples.com/sms\",\n \"dlr_endpoint\": \"https://examples.com/dlr\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.wavix.com/v1/sub-organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Company\",\n \"default_destinations\": {\n \"sms_endpoint\": \"https://examples.com/sms\",\n \"dlr_endpoint\": \"https://examples.com/dlr\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wavix.com/v1/sub-organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Company\",\n \"default_destinations\": {\n \"sms_endpoint\": \"https://examples.com/sms\",\n \"dlr_endpoint\": \"https://examples.com/dlr\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"created_at": "2023-06-15T10:30:00Z",
"name": "My sub-account",
"api_key": "abc123def456",
"master_organization": 456,
"status": "enabled",
"default_destinations": {
"sms_endpoint": "https://examples.com/sms",
"dlr_endpoint": "https://examples.com/dlr"
}
}{
"success": false,
"message": "Missing or invalid parameter <param_name>"
}{
"success": false,
"error": true,
"message": "Unauthorized"
}{
"success": false,
"message": "The service is not provisioned for your account."
}{
"success": false,
"message": "Missing or invalid parameter <param_name>"
}Create a sub-account
Creates a sub-account under the authenticated master account. Returns the sub-account with its generated api_key.
curl --request POST \
--url https://api.wavix.com/v1/sub-organizations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Company",
"default_destinations": {
"sms_endpoint": "https://examples.com/sms",
"dlr_endpoint": "https://examples.com/dlr"
}
}
'import requests
url = "https://api.wavix.com/v1/sub-organizations"
payload = {
"name": "Company",
"default_destinations": {
"sms_endpoint": "https://examples.com/sms",
"dlr_endpoint": "https://examples.com/dlr"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Company',
default_destinations: {
sms_endpoint: 'https://examples.com/sms',
dlr_endpoint: 'https://examples.com/dlr'
}
})
};
fetch('https://api.wavix.com/v1/sub-organizations', 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.wavix.com/v1/sub-organizations",
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([
'name' => 'Company',
'default_destinations' => [
'sms_endpoint' => 'https://examples.com/sms',
'dlr_endpoint' => 'https://examples.com/dlr'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.wavix.com/v1/sub-organizations"
payload := strings.NewReader("{\n \"name\": \"Company\",\n \"default_destinations\": {\n \"sms_endpoint\": \"https://examples.com/sms\",\n \"dlr_endpoint\": \"https://examples.com/dlr\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.wavix.com/v1/sub-organizations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Company\",\n \"default_destinations\": {\n \"sms_endpoint\": \"https://examples.com/sms\",\n \"dlr_endpoint\": \"https://examples.com/dlr\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wavix.com/v1/sub-organizations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Company\",\n \"default_destinations\": {\n \"sms_endpoint\": \"https://examples.com/sms\",\n \"dlr_endpoint\": \"https://examples.com/dlr\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"created_at": "2023-06-15T10:30:00Z",
"name": "My sub-account",
"api_key": "abc123def456",
"master_organization": 456,
"status": "enabled",
"default_destinations": {
"sms_endpoint": "https://examples.com/sms",
"dlr_endpoint": "https://examples.com/dlr"
}
}{
"success": false,
"message": "Missing or invalid parameter <param_name>"
}{
"success": false,
"error": true,
"message": "Unauthorized"
}{
"success": false,
"message": "The service is not provisioned for your account."
}{
"success": false,
"message": "Missing or invalid parameter <param_name>"
}Authorizations
Wavix API key. Pass as Authorization: Bearer <api_key>. Keys support per-resource scopes (none / read / write). See Restricted keys and scopes.
Body
Attributes for the new sub-account.
Response
Returns the created sub-account.
Sub-account details including API key and webhook configurations.
Sub-account ID.
123
Date and time the sub-account was created in ISO 8601 format.
"2023-06-15T10:30:00Z"
Sub-account name.
"My sub-account"
Sub-account API key.
"abc123def456"
Master account ID.
456
Status of the subaccount. One of enabled (the subaccount is active and can be used) or disabled (the subaccount is suspended).
enabled, disabled "enabled"
Default webhook URLs for inbound messages and delivery reports.
Show child attributes
Show child attributes
Was this page helpful?