Create tenant
curl --request POST \
--url https://{environment}.resistant.ai/v0/tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cells": [
"eu-1"
]
}
'import requests
url = "https://{environment}.resistant.ai/v0/tenants"
payload = {
"name": "<string>",
"cells": ["eu-1"]
}
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>', cells: ['eu-1']})
};
fetch('https://{environment}.resistant.ai/v0/tenants', 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://{environment}.resistant.ai/v0/tenants",
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>',
'cells' => [
'eu-1'
]
]),
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://{environment}.resistant.ai/v0/tenants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"cells\": [\n \"eu-1\"\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://{environment}.resistant.ai/v0/tenants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"cells\": [\n \"eu-1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.resistant.ai/v0/tenants")
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 \"cells\": [\n \"eu-1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created": "<string>",
"updated": "<string>",
"cells": [],
"_links": {
"documents-ui": [
{
"href": "name-org-name.documents.resistant.ai",
"rel": "eu-1"
},
{
"href": "name-org-name.us-1.documents.resistant.ai",
"rel": "us-1"
},
{
"href": "name-org-name.ap-2.documents.resistant.ai",
"rel": "ap-2"
},
{
"href": "name-org-name.ap-3.documents.resistant.ai",
"rel": "ap-3"
},
{
"href": "name-org-name.ca-1.documents.resistant.ai",
"rel": "ca-1"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}API Reference
Create tenant
Create tenant in the managed organization
POST
/
tenants
Create tenant
curl --request POST \
--url https://{environment}.resistant.ai/v0/tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"cells": [
"eu-1"
]
}
'import requests
url = "https://{environment}.resistant.ai/v0/tenants"
payload = {
"name": "<string>",
"cells": ["eu-1"]
}
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>', cells: ['eu-1']})
};
fetch('https://{environment}.resistant.ai/v0/tenants', 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://{environment}.resistant.ai/v0/tenants",
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>',
'cells' => [
'eu-1'
]
]),
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://{environment}.resistant.ai/v0/tenants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"cells\": [\n \"eu-1\"\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://{environment}.resistant.ai/v0/tenants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"cells\": [\n \"eu-1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.resistant.ai/v0/tenants")
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 \"cells\": [\n \"eu-1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"created": "<string>",
"updated": "<string>",
"cells": [],
"_links": {
"documents-ui": [
{
"href": "name-org-name.documents.resistant.ai",
"rel": "eu-1"
},
{
"href": "name-org-name.us-1.documents.resistant.ai",
"rel": "us-1"
},
{
"href": "name-org-name.ap-2.documents.resistant.ai",
"rel": "ap-2"
},
{
"href": "name-org-name.ap-3.documents.resistant.ai",
"rel": "ap-3"
},
{
"href": "name-org-name.ca-1.documents.resistant.ai",
"rel": "ca-1"
}
]
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
JWT with private key. Java example Please note that Token URL is specific for a given environment. Correct URL is in the corresponding environment documentation.
Body
application/json
Desired name of the tenant. Must be unique within the organization and contain only lowercase letters (a-z) and digits (0-9).
Required string length:
1 - 61Pattern:
^[a-z0-9]{1,61}$List of cells where the UI should be accessible
An enumeration.
Available options:
eu-1, us-1, ap-2, ap-3, ca-1 Was this page helpful?
⌘I