curl --request POST \
--url https://api.togai.com/accounts/{account_id}/add_aliases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aliases": [
"account2@acme.com",
"+1234567890"
]
}
'import requests
url = "https://api.togai.com/accounts/{account_id}/add_aliases"
payload = { "aliases": ["account2@acme.com", "+1234567890"] }
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({aliases: ['account2@acme.com', '+1234567890']})
};
fetch('https://api.togai.com/accounts/{account_id}/add_aliases', 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.togai.com/accounts/{account_id}/add_aliases",
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([
'aliases' => [
'account2@acme.com',
'+1234567890'
]
]),
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.togai.com/accounts/{account_id}/add_aliases"
payload := strings.NewReader("{\n \"aliases\": [\n \"account2@acme.com\",\n \"+1234567890\"\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.togai.com/accounts/{account_id}/add_aliases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aliases\": [\n \"account2@acme.com\",\n \"+1234567890\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/accounts/{account_id}/add_aliases")
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 \"aliases\": [\n \"account2@acme.com\",\n \"+1234567890\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "G234DZZKBKACATFFGVGEMERFI",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "ACME",
"togaiCustomerId": "customer.savass.11e1a",
"name": "ACME Enterprise - Account2",
"invoiceCurrency": "USD",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "admin@example.com",
"billingInformation": {
"emailRecipients": [
"admin@example.com",
"acme@acme.com",
"acmeacme@acme.com"
],
"additionalEmailRecipients": [
"admin@acme.com"
]
},
"aliases": [
{
"alias": "account2@acme.com"
},
{
"alias": "+1234567890"
}
],
"status": "ACTIVE"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Add Aliases to account
Add aliases to an account using customer_id and account_id.
curl --request POST \
--url https://api.togai.com/accounts/{account_id}/add_aliases \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"aliases": [
"account2@acme.com",
"+1234567890"
]
}
'import requests
url = "https://api.togai.com/accounts/{account_id}/add_aliases"
payload = { "aliases": ["account2@acme.com", "+1234567890"] }
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({aliases: ['account2@acme.com', '+1234567890']})
};
fetch('https://api.togai.com/accounts/{account_id}/add_aliases', 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.togai.com/accounts/{account_id}/add_aliases",
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([
'aliases' => [
'account2@acme.com',
'+1234567890'
]
]),
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.togai.com/accounts/{account_id}/add_aliases"
payload := strings.NewReader("{\n \"aliases\": [\n \"account2@acme.com\",\n \"+1234567890\"\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.togai.com/accounts/{account_id}/add_aliases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aliases\": [\n \"account2@acme.com\",\n \"+1234567890\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/accounts/{account_id}/add_aliases")
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 \"aliases\": [\n \"account2@acme.com\",\n \"+1234567890\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "G234DZZKBKACATFFGVGEMERFI",
"togaiAccountId": "account.safdla.c234ds",
"customerId": "ACME",
"togaiCustomerId": "customer.savass.11e1a",
"name": "ACME Enterprise - Account2",
"invoiceCurrency": "USD",
"address": {
"phoneNumber": "+919876543210",
"line1": "2281 Broadway Street",
"line2": "G-31",
"postalCode": "29501",
"city": "Florence",
"state": "South Carolina",
"country": "US"
},
"primaryEmail": "admin@example.com",
"billingInformation": {
"emailRecipients": [
"admin@example.com",
"acme@acme.com",
"acmeacme@acme.com"
],
"additionalEmailRecipients": [
"admin@acme.com"
]
},
"aliases": [
{
"alias": "account2@acme.com"
},
{
"alias": "+1234567890"
}
],
"status": "ACTIVE"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
account_id corresponding to an account
50"ACC00001"
Body
Payload to add aliases to account
Response
Response for Create and Get account requests
Structure of an account
Identifier of the account
50Unique identifier of the account
Unique identifier of the customer
Name of the Account
3 - 255Identifier of the customer
Status of the account
ACTIVE, DRAFT, ARCHIVED "ACTIVE"
list of aliases of the account
10Show child attributes
Show child attributes
billing address of the customer
Show child attributes
Show child attributes
Primary email of the customer
320"admin@example.com"
Billing information of an account
Show child attributes
Show child attributes
10Show child attributes
Show child attributes
Invoice group details
Show child attributes
Show child attributes
Additional information associated with the account. Example: GSTN, VATN
Show child attributes
Show child attributes
Tag for accounts are stored in lowercase
