Skip to main content
POST
/
accounts
/
{account_id}
/
remove_aliases
Remove Aliases to account
curl --request POST \
  --url https://api.togai.com/accounts/{account_id}/remove_aliases \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "aliases": [
    "abcd-12345-uids",
    "efgh-12345-uids"
  ]
}
'
import requests

url = "https://api.togai.com/accounts/{account_id}/remove_aliases"

payload = { "aliases": ["abcd-12345-uids", "efgh-12345-uids"] }
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: ['abcd-12345-uids', 'efgh-12345-uids']})
};

fetch('https://api.togai.com/accounts/{account_id}/remove_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}/remove_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' => [
'abcd-12345-uids',
'efgh-12345-uids'
]
]),
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}/remove_aliases"

payload := strings.NewReader("{\n \"aliases\": [\n \"abcd-12345-uids\",\n \"efgh-12345-uids\"\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}/remove_aliases")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"aliases\": [\n \"abcd-12345-uids\",\n \"efgh-12345-uids\"\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.togai.com/accounts/{account_id}/remove_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 \"abcd-12345-uids\",\n \"efgh-12345-uids\"\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

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

account_id
string
required

account_id corresponding to an account

Maximum string length: 50
Example:

"ACC00001"

Body

application/json

Payload to remove aliases from account

Payload to remove account aliases

aliases
string[]
accountAliases
RemoveAccountAliasRequest · object[]

Response

Response for Create and Get account requests

Structure of an account

id
string
required

Identifier of the account

Maximum string length: 50
togaiAccountId
string
required

Unique identifier of the account

togaiCustomerId
string
required

Unique identifier of the customer

name
string
required

Name of the Account

Required string length: 3 - 255
customerId
string
required

Identifier of the customer

status
enum<string>
required

Status of the account

Available options:
ACTIVE,
DRAFT,
ARCHIVED
Example:

"ACTIVE"

invoiceCurrency
string

ISO_4217 code of the currency in which the account must be invoiced Defaults to Base currency.

Required string length: 3
Example:

"USD"

aliases
AccountAliases · object[]

list of aliases of the account

Maximum array length: 10
netTermDays
integer<int32>
address
object

billing address of the customer

primaryEmail
string

Primary email of the customer

Maximum string length: 320
Example:

"admin@example.com"

billingInformation
object

Billing information of an account

settings
object[]
Maximum array length: 10
invoiceGroupDetails
object

Invoice group details

metadata
object

Additional information associated with the account. Example: GSTN, VATN

tags
string[]

Tag for accounts are stored in lowercase