List sub-accounts
curl --request GET \
--url https://api.wavix.com/v1/sub-organizations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wavix.com/v1/sub-organizations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.wavix.com/v1/sub-organizations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.wavix.com/v1/sub-organizations")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sub_organizations": [
{
"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"
}
}
],
"pagination": {
"current_page": 2,
"per_page": 25,
"total": 123,
"total_pages": 123
}
}{
"success": false,
"error": true,
"message": "Unauthorized"
}{
"success": false,
"message": "The service is not provisioned for your account."
}Sub-accounts
List sub-accounts
Returns a paginated list of sub-accounts under the authenticated master account.
GET
/
v1
/
sub-organizations
List sub-accounts
curl --request GET \
--url https://api.wavix.com/v1/sub-organizations \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.wavix.com/v1/sub-organizations"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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 => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.wavix.com/v1/sub-organizations"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.wavix.com/v1/sub-organizations")
.header("Authorization", "Bearer <token>")
.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::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"sub_organizations": [
{
"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"
}
}
],
"pagination": {
"current_page": 2,
"per_page": 25,
"total": 123,
"total_pages": 123
}
}{
"success": false,
"error": true,
"message": "Unauthorized"
}{
"success": false,
"message": "The service is not provisioned for your account."
}Authorizations
Wavix API key. Pass as Authorization: Bearer <api_key>. Keys support per-resource scopes (none / read / write). See Restricted keys and scopes.
Query Parameters
Filters sub-accounts by status. One of enabled (the sub-account is active) or disabled (the sub-account is suspended).
Available options:
enabled, disabled Example:
"enabled"
Was this page helpful?
⌘I