Create Sub-Organization
Creates a new sub-organization belonging to the specified organization.
curl --request POST \
--url https://api.useinvent.com/orgs/{org_id}/orgs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"referral_code": "<string>",
"logo_id": "<string>",
"features": {
"allow_overdraft": true,
"workflows": true,
"enable_japifon": true
},
"billing": {
"use_parent_balance": true,
"last_low_balance_notification_at": "2023-11-07T05:31:56Z",
"last_out_of_balance_notification_at": "2023-11-07T05:31:56Z",
"last_spending_cap_notification_at": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.useinvent.com/orgs/{org_id}/orgs"
payload = {
"name": "<string>",
"referral_code": "<string>",
"logo_id": "<string>",
"features": {
"allow_overdraft": True,
"workflows": True,
"enable_japifon": True
},
"billing": {
"use_parent_balance": True,
"last_low_balance_notification_at": "2023-11-07T05:31:56Z",
"last_out_of_balance_notification_at": "2023-11-07T05:31:56Z",
"last_spending_cap_notification_at": "2023-11-07T05:31:56Z"
}
}
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: '<string>',
referral_code: '<string>',
logo_id: '<string>',
features: {allow_overdraft: true, workflows: true, enable_japifon: true},
billing: {
use_parent_balance: true,
last_low_balance_notification_at: '2023-11-07T05:31:56Z',
last_out_of_balance_notification_at: '2023-11-07T05:31:56Z',
last_spending_cap_notification_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.useinvent.com/orgs/{org_id}/orgs', 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.useinvent.com/orgs/{org_id}/orgs",
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' => '<string>',
'referral_code' => '<string>',
'logo_id' => '<string>',
'features' => [
'allow_overdraft' => true,
'workflows' => true,
'enable_japifon' => true
],
'billing' => [
'use_parent_balance' => true,
'last_low_balance_notification_at' => '2023-11-07T05:31:56Z',
'last_out_of_balance_notification_at' => '2023-11-07T05:31:56Z',
'last_spending_cap_notification_at' => '2023-11-07T05:31:56Z'
]
]),
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.useinvent.com/orgs/{org_id}/orgs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"referral_code\": \"<string>\",\n \"logo_id\": \"<string>\",\n \"features\": {\n \"allow_overdraft\": true,\n \"workflows\": true,\n \"enable_japifon\": true\n },\n \"billing\": {\n \"use_parent_balance\": true,\n \"last_low_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_out_of_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_spending_cap_notification_at\": \"2023-11-07T05:31:56Z\"\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.useinvent.com/orgs/{org_id}/orgs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"referral_code\": \"<string>\",\n \"logo_id\": \"<string>\",\n \"features\": {\n \"allow_overdraft\": true,\n \"workflows\": true,\n \"enable_japifon\": true\n },\n \"billing\": {\n \"use_parent_balance\": true,\n \"last_low_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_out_of_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_spending_cap_notification_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/orgs/{org_id}/orgs")
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\": \"<string>\",\n \"referral_code\": \"<string>\",\n \"logo_id\": \"<string>\",\n \"features\": {\n \"allow_overdraft\": true,\n \"workflows\": true,\n \"enable_japifon\": true\n },\n \"billing\": {\n \"use_parent_balance\": true,\n \"last_low_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_out_of_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_spending_cap_notification_at\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"logo_url": "<string>",
"balance": 123,
"promo_balance": 123,
"billing": {
"auto_recharge": {
"enabled": true,
"recharge_threshold": 252.5,
"recharge_amount": 252.5
},
"use_parent_balance": true,
"spending_cap": {
"enabled": true,
"amount": 50000,
"reset_at": "2023-11-07T05:31:56Z"
},
"payment_method": {
"type": "<string>",
"payment_method_id": "<string>",
"brand": "<string>",
"last4": "<string>",
"inactive": true,
"failed_at": "2023-11-07T05:31:56Z",
"failed_message": "<string>"
},
"last_low_balance_notification_at": "2023-11-07T05:31:56Z",
"last_out_of_balance_notification_at": "2023-11-07T05:31:56Z",
"last_spending_cap_notification_at": "2023-11-07T05:31:56Z"
},
"members": [
{
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"avatar": "<string>",
"org_id": "<string>",
"user_id": "<string>",
"preferences": {
"notifications": {
"assigned_to_me": {
"enabled": true,
"notified_at": "2023-11-07T05:31:56Z"
},
"billing": {
"enabled": true,
"notified_at": "2023-11-07T05:31:56Z"
}
},
"canned_responses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"name": "<string>"
}
]
},
"roles": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": []
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"seen_at": "2023-11-07T05:31:56Z"
}
],
"spending_cap_used": 123,
"created_at": "2023-11-07T05:31:56Z",
"features": {
"enterprise": true,
"allow_overdraft": true,
"workflows": true,
"enable_japifon": true,
"slack_access": true,
"emails": true,
"templates": true,
"org_chats": true
},
"config": {
"email": "jsmith@example.com",
"address": "<string>",
"terms_url": "<string>",
"privacy_url": "<string>",
"access": {
"session_ttl_seconds": 0,
"allow_google": true,
"allow_microsoft": true,
"allow_email_code": true,
"allow_invites": true
},
"modules": {
"enable_inbox": true,
"enable_analytics": true,
"enable_assistants": true,
"enable_knowledge_base": true,
"enable_broadcasts": true,
"enable_workflows": true,
"enable_audience": true,
"enable_tables": true,
"enable_pages": true,
"enable_balance_credits": true
}
}
}Authorizations
Bearer token authentication using your API key
Path Parameters
The ID of the org
Body
Response
Created sub-organization with its plan, balance, members, and features.
Summary information about a sub-organization
Unique identifier of the sub-organization
Name of the sub-organization
URL of the sub-organization logo
Type of subscription plan
free, business Current credit balance
Current promotional credit balance
Schema for updating payment configuration
Show child attributes
Show child attributes
Members of the sub-organization
Show child attributes
Show child attributes
Amount spent in the current month
Timestamp when the sub-organization was created
Org gate-keeping features configuration
Show child attributes
Show child attributes
Organization configuration settings
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.useinvent.com/orgs/{org_id}/orgs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"referral_code": "<string>",
"logo_id": "<string>",
"features": {
"allow_overdraft": true,
"workflows": true,
"enable_japifon": true
},
"billing": {
"use_parent_balance": true,
"last_low_balance_notification_at": "2023-11-07T05:31:56Z",
"last_out_of_balance_notification_at": "2023-11-07T05:31:56Z",
"last_spending_cap_notification_at": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.useinvent.com/orgs/{org_id}/orgs"
payload = {
"name": "<string>",
"referral_code": "<string>",
"logo_id": "<string>",
"features": {
"allow_overdraft": True,
"workflows": True,
"enable_japifon": True
},
"billing": {
"use_parent_balance": True,
"last_low_balance_notification_at": "2023-11-07T05:31:56Z",
"last_out_of_balance_notification_at": "2023-11-07T05:31:56Z",
"last_spending_cap_notification_at": "2023-11-07T05:31:56Z"
}
}
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: '<string>',
referral_code: '<string>',
logo_id: '<string>',
features: {allow_overdraft: true, workflows: true, enable_japifon: true},
billing: {
use_parent_balance: true,
last_low_balance_notification_at: '2023-11-07T05:31:56Z',
last_out_of_balance_notification_at: '2023-11-07T05:31:56Z',
last_spending_cap_notification_at: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.useinvent.com/orgs/{org_id}/orgs', 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.useinvent.com/orgs/{org_id}/orgs",
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' => '<string>',
'referral_code' => '<string>',
'logo_id' => '<string>',
'features' => [
'allow_overdraft' => true,
'workflows' => true,
'enable_japifon' => true
],
'billing' => [
'use_parent_balance' => true,
'last_low_balance_notification_at' => '2023-11-07T05:31:56Z',
'last_out_of_balance_notification_at' => '2023-11-07T05:31:56Z',
'last_spending_cap_notification_at' => '2023-11-07T05:31:56Z'
]
]),
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.useinvent.com/orgs/{org_id}/orgs"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"referral_code\": \"<string>\",\n \"logo_id\": \"<string>\",\n \"features\": {\n \"allow_overdraft\": true,\n \"workflows\": true,\n \"enable_japifon\": true\n },\n \"billing\": {\n \"use_parent_balance\": true,\n \"last_low_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_out_of_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_spending_cap_notification_at\": \"2023-11-07T05:31:56Z\"\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.useinvent.com/orgs/{org_id}/orgs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"referral_code\": \"<string>\",\n \"logo_id\": \"<string>\",\n \"features\": {\n \"allow_overdraft\": true,\n \"workflows\": true,\n \"enable_japifon\": true\n },\n \"billing\": {\n \"use_parent_balance\": true,\n \"last_low_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_out_of_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_spending_cap_notification_at\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/orgs/{org_id}/orgs")
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\": \"<string>\",\n \"referral_code\": \"<string>\",\n \"logo_id\": \"<string>\",\n \"features\": {\n \"allow_overdraft\": true,\n \"workflows\": true,\n \"enable_japifon\": true\n },\n \"billing\": {\n \"use_parent_balance\": true,\n \"last_low_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_out_of_balance_notification_at\": \"2023-11-07T05:31:56Z\",\n \"last_spending_cap_notification_at\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"logo_url": "<string>",
"balance": 123,
"promo_balance": 123,
"billing": {
"auto_recharge": {
"enabled": true,
"recharge_threshold": 252.5,
"recharge_amount": 252.5
},
"use_parent_balance": true,
"spending_cap": {
"enabled": true,
"amount": 50000,
"reset_at": "2023-11-07T05:31:56Z"
},
"payment_method": {
"type": "<string>",
"payment_method_id": "<string>",
"brand": "<string>",
"last4": "<string>",
"inactive": true,
"failed_at": "2023-11-07T05:31:56Z",
"failed_message": "<string>"
},
"last_low_balance_notification_at": "2023-11-07T05:31:56Z",
"last_out_of_balance_notification_at": "2023-11-07T05:31:56Z",
"last_spending_cap_notification_at": "2023-11-07T05:31:56Z"
},
"members": [
{
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"avatar": "<string>",
"org_id": "<string>",
"user_id": "<string>",
"preferences": {
"notifications": {
"assigned_to_me": {
"enabled": true,
"notified_at": "2023-11-07T05:31:56Z"
},
"billing": {
"enabled": true,
"notified_at": "2023-11-07T05:31:56Z"
}
},
"canned_responses": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"name": "<string>"
}
]
},
"roles": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"permissions": []
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"seen_at": "2023-11-07T05:31:56Z"
}
],
"spending_cap_used": 123,
"created_at": "2023-11-07T05:31:56Z",
"features": {
"enterprise": true,
"allow_overdraft": true,
"workflows": true,
"enable_japifon": true,
"slack_access": true,
"emails": true,
"templates": true,
"org_chats": true
},
"config": {
"email": "jsmith@example.com",
"address": "<string>",
"terms_url": "<string>",
"privacy_url": "<string>",
"access": {
"session_ttl_seconds": 0,
"allow_google": true,
"allow_microsoft": true,
"allow_email_code": true,
"allow_invites": true
},
"modules": {
"enable_inbox": true,
"enable_analytics": true,
"enable_assistants": true,
"enable_knowledge_base": true,
"enable_broadcasts": true,
"enable_workflows": true,
"enable_audience": true,
"enable_tables": true,
"enable_pages": true,
"enable_balance_credits": true
}
}
}