curl --request POST \
--url https://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parent_tenant_id": "8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8",
"name": "Contoso Ltd",
"short_name": "Contoso",
"kind": "tenant",
"contact": "Jane Doe",
"notification_email": "it@contoso.example",
"address_1": "1 Main Street",
"address_2": null,
"city": "Springfield",
"state": "IL",
"postal_code": "62701",
"country_id": 840,
"industry_id": 2,
"employee_count": 250,
"assigned_technician_user_id": null,
"trial": true,
"tenant_type_id": 3,
"support_enabled": true,
"idempotency_key": "3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11"
}
'import requests
url = "https://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants"
payload = {
"parent_tenant_id": "8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8",
"name": "Contoso Ltd",
"short_name": "Contoso",
"kind": "tenant",
"contact": "Jane Doe",
"notification_email": "it@contoso.example",
"address_1": "1 Main Street",
"address_2": None,
"city": "Springfield",
"state": "IL",
"postal_code": "62701",
"country_id": 840,
"industry_id": 2,
"employee_count": 250,
"assigned_technician_user_id": None,
"trial": True,
"tenant_type_id": 3,
"support_enabled": True,
"idempotency_key": "3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11"
}
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({
parent_tenant_id: '8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8',
name: 'Contoso Ltd',
short_name: 'Contoso',
kind: 'tenant',
contact: 'Jane Doe',
notification_email: 'it@contoso.example',
address_1: '1 Main Street',
address_2: null,
city: 'Springfield',
state: 'IL',
postal_code: '62701',
country_id: 840,
industry_id: 2,
employee_count: 250,
assigned_technician_user_id: null,
trial: true,
tenant_type_id: 3,
support_enabled: true,
idempotency_key: '3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11'
})
};
fetch('https://{instance}.cyrisma.com/ta/v1/msp/provisioning/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://{instance}.cyrisma.com/ta/v1/msp/provisioning/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([
'parent_tenant_id' => '8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8',
'name' => 'Contoso Ltd',
'short_name' => 'Contoso',
'kind' => 'tenant',
'contact' => 'Jane Doe',
'notification_email' => 'it@contoso.example',
'address_1' => '1 Main Street',
'address_2' => null,
'city' => 'Springfield',
'state' => 'IL',
'postal_code' => '62701',
'country_id' => 840,
'industry_id' => 2,
'employee_count' => 250,
'assigned_technician_user_id' => null,
'trial' => true,
'tenant_type_id' => 3,
'support_enabled' => true,
'idempotency_key' => '3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11'
]),
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://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants"
payload := strings.NewReader("{\n \"parent_tenant_id\": \"8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8\",\n \"name\": \"Contoso Ltd\",\n \"short_name\": \"Contoso\",\n \"kind\": \"tenant\",\n \"contact\": \"Jane Doe\",\n \"notification_email\": \"it@contoso.example\",\n \"address_1\": \"1 Main Street\",\n \"address_2\": null,\n \"city\": \"Springfield\",\n \"state\": \"IL\",\n \"postal_code\": \"62701\",\n \"country_id\": 840,\n \"industry_id\": 2,\n \"employee_count\": 250,\n \"assigned_technician_user_id\": null,\n \"trial\": true,\n \"tenant_type_id\": 3,\n \"support_enabled\": true,\n \"idempotency_key\": \"3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11\"\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://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parent_tenant_id\": \"8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8\",\n \"name\": \"Contoso Ltd\",\n \"short_name\": \"Contoso\",\n \"kind\": \"tenant\",\n \"contact\": \"Jane Doe\",\n \"notification_email\": \"it@contoso.example\",\n \"address_1\": \"1 Main Street\",\n \"address_2\": null,\n \"city\": \"Springfield\",\n \"state\": \"IL\",\n \"postal_code\": \"62701\",\n \"country_id\": 840,\n \"industry_id\": 2,\n \"employee_count\": 250,\n \"assigned_technician_user_id\": null,\n \"trial\": true,\n \"tenant_type_id\": 3,\n \"support_enabled\": true,\n \"idempotency_key\": \"3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.cyrisma.com/ta/v1/msp/provisioning/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 \"parent_tenant_id\": \"8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8\",\n \"name\": \"Contoso Ltd\",\n \"short_name\": \"Contoso\",\n \"kind\": \"tenant\",\n \"contact\": \"Jane Doe\",\n \"notification_email\": \"it@contoso.example\",\n \"address_1\": \"1 Main Street\",\n \"address_2\": null,\n \"city\": \"Springfield\",\n \"state\": \"IL\",\n \"postal_code\": \"62701\",\n \"country_id\": 840,\n \"industry_id\": 2,\n \"employee_count\": 250,\n \"assigned_technician_user_id\": null,\n \"trial\": true,\n \"tenant_type_id\": 3,\n \"support_enabled\": true,\n \"idempotency_key\": \"3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11\"\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "5c0e7a92-3f4b-4d1e-a8c6-7b2d9e1f0a34",
"tenant_number": 4194321,
"job_id": "e4a7c1d2-9b3f-4e8a-a2c5-1f6d7b8e9a01",
"status": "queued",
"tenant_host": "cc4a1b2c.cyrisma.com",
"registration_key": "9F2C4A7B1E3D5C6A8B0F2E4D6C8A0B1C",
"orchestrator_wake_succeeded": null
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Provision a tenant
Creates a tenant and queues the job that deploys it. The tenant starts in status
provisioning and becomes active when the job reaches deployed. Needs pulse.write.
Send an Idempotency-Key header (or idempotency_key in the body) so a retry after a
timeout returns the original result instead of creating a second tenant.
- 400:
invalid_provisioning_requestwhennameorparent_tenant_idis missing, or a validation problem naming the field. - 401 (no body): missing or invalid token, no
pulse.write, orparent_tenant_idis outside your hierarchy. - 409: no hosting capacity is available right now; try again later.
curl --request POST \
--url https://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"parent_tenant_id": "8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8",
"name": "Contoso Ltd",
"short_name": "Contoso",
"kind": "tenant",
"contact": "Jane Doe",
"notification_email": "it@contoso.example",
"address_1": "1 Main Street",
"address_2": null,
"city": "Springfield",
"state": "IL",
"postal_code": "62701",
"country_id": 840,
"industry_id": 2,
"employee_count": 250,
"assigned_technician_user_id": null,
"trial": true,
"tenant_type_id": 3,
"support_enabled": true,
"idempotency_key": "3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11"
}
'import requests
url = "https://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants"
payload = {
"parent_tenant_id": "8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8",
"name": "Contoso Ltd",
"short_name": "Contoso",
"kind": "tenant",
"contact": "Jane Doe",
"notification_email": "it@contoso.example",
"address_1": "1 Main Street",
"address_2": None,
"city": "Springfield",
"state": "IL",
"postal_code": "62701",
"country_id": 840,
"industry_id": 2,
"employee_count": 250,
"assigned_technician_user_id": None,
"trial": True,
"tenant_type_id": 3,
"support_enabled": True,
"idempotency_key": "3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11"
}
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({
parent_tenant_id: '8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8',
name: 'Contoso Ltd',
short_name: 'Contoso',
kind: 'tenant',
contact: 'Jane Doe',
notification_email: 'it@contoso.example',
address_1: '1 Main Street',
address_2: null,
city: 'Springfield',
state: 'IL',
postal_code: '62701',
country_id: 840,
industry_id: 2,
employee_count: 250,
assigned_technician_user_id: null,
trial: true,
tenant_type_id: 3,
support_enabled: true,
idempotency_key: '3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11'
})
};
fetch('https://{instance}.cyrisma.com/ta/v1/msp/provisioning/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://{instance}.cyrisma.com/ta/v1/msp/provisioning/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([
'parent_tenant_id' => '8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8',
'name' => 'Contoso Ltd',
'short_name' => 'Contoso',
'kind' => 'tenant',
'contact' => 'Jane Doe',
'notification_email' => 'it@contoso.example',
'address_1' => '1 Main Street',
'address_2' => null,
'city' => 'Springfield',
'state' => 'IL',
'postal_code' => '62701',
'country_id' => 840,
'industry_id' => 2,
'employee_count' => 250,
'assigned_technician_user_id' => null,
'trial' => true,
'tenant_type_id' => 3,
'support_enabled' => true,
'idempotency_key' => '3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11'
]),
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://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants"
payload := strings.NewReader("{\n \"parent_tenant_id\": \"8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8\",\n \"name\": \"Contoso Ltd\",\n \"short_name\": \"Contoso\",\n \"kind\": \"tenant\",\n \"contact\": \"Jane Doe\",\n \"notification_email\": \"it@contoso.example\",\n \"address_1\": \"1 Main Street\",\n \"address_2\": null,\n \"city\": \"Springfield\",\n \"state\": \"IL\",\n \"postal_code\": \"62701\",\n \"country_id\": 840,\n \"industry_id\": 2,\n \"employee_count\": 250,\n \"assigned_technician_user_id\": null,\n \"trial\": true,\n \"tenant_type_id\": 3,\n \"support_enabled\": true,\n \"idempotency_key\": \"3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11\"\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://{instance}.cyrisma.com/ta/v1/msp/provisioning/tenants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"parent_tenant_id\": \"8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8\",\n \"name\": \"Contoso Ltd\",\n \"short_name\": \"Contoso\",\n \"kind\": \"tenant\",\n \"contact\": \"Jane Doe\",\n \"notification_email\": \"it@contoso.example\",\n \"address_1\": \"1 Main Street\",\n \"address_2\": null,\n \"city\": \"Springfield\",\n \"state\": \"IL\",\n \"postal_code\": \"62701\",\n \"country_id\": 840,\n \"industry_id\": 2,\n \"employee_count\": 250,\n \"assigned_technician_user_id\": null,\n \"trial\": true,\n \"tenant_type_id\": 3,\n \"support_enabled\": true,\n \"idempotency_key\": \"3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{instance}.cyrisma.com/ta/v1/msp/provisioning/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 \"parent_tenant_id\": \"8d2f6c1e-5b7a-4e39-9c0d-2a41f7e3b6a8\",\n \"name\": \"Contoso Ltd\",\n \"short_name\": \"Contoso\",\n \"kind\": \"tenant\",\n \"contact\": \"Jane Doe\",\n \"notification_email\": \"it@contoso.example\",\n \"address_1\": \"1 Main Street\",\n \"address_2\": null,\n \"city\": \"Springfield\",\n \"state\": \"IL\",\n \"postal_code\": \"62701\",\n \"country_id\": 840,\n \"industry_id\": 2,\n \"employee_count\": 250,\n \"assigned_technician_user_id\": null,\n \"trial\": true,\n \"tenant_type_id\": 3,\n \"support_enabled\": true,\n \"idempotency_key\": \"3f1b2c9e-4a55-4f3a-8b2d-9c7e51a04d11\"\n}"
response = http.request(request)
puts response.read_body{
"tenant_id": "5c0e7a92-3f4b-4d1e-a8c6-7b2d9e1f0a34",
"tenant_number": 4194321,
"job_id": "e4a7c1d2-9b3f-4e8a-a2c5-1f6d7b8e9a01",
"status": "queued",
"tenant_host": "cc4a1b2c.cyrisma.com",
"registration_key": "9F2C4A7B1E3D5C6A8B0F2E4D6C8A0B1C",
"orchestrator_wake_succeeded": null
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
A machine-client token from POST /v1/auth/client-token. Reads need the pulse.read scope; provisioning and tenant updates need pulse.write, which the token only carries when requested_scopes asks for it. Creating, changing, disabling and resetting MFA for users, and the tenant sign-in policy, need a signed-in user's token instead: they reject API-key tokens.
Body
Creates a tenant under parent_tenant_id and queues the job that deploys it. The response
carries the new tenant_id and a job_id; poll Get a provisioning job's status
(GET /v1/msp/provisioning/jobs/{jobId}) until the job reaches deployed.
Only parent_tenant_id, name and trial are required. Validation failures return 400 with
the offending field names as keys, for example {"industry_id": ["unsupported"]}.
The technician responsible for this tenant. Use user_id from List technicians who can be
assigned to a tenant (GET /v1/msp/provisioning/eligible-technicians?parent_tenant_id=…),
called with the same parent_tenant_id. Anyone else returns 400 with
assigned_technician_user_id: ["ineligible"].
A unique value, such as a UUID v4, that you generate for each tenant you create. Retrying a
request with a key that was already accepted returns the original result instead of creating
a second tenant, so a timed-out request is safe to retry. An Idempotency-Key header, when
sent, takes precedence over this field.
Response
OK
A tenant lifecycle job, returned by Provision a tenant, Get a provisioning job's status
and Decommission a tenant. Jobs run asynchronously: poll Get a provisioning job's status
(GET /v1/msp/provisioning/jobs/{jobId}) with job_id until status is deployed (create),
decommissioned (decommission) or failed.
The job's status: queued | leased | running | deployed | decommissioned | failed.
queued: accepted, waiting for a worker. A new create or decommission always starts here.leased/running: a worker has picked it up.deployed: the tenant is ready and its status is nowactive.decommissioned: the tenant is removed and its status is nowdeleted.failed: the job did not complete.
