JavaScript
import { TrophyApiClient } from '@trophyso/node';
const trophy = new TrophyApiClient({
apiKey: 'YOUR_API_KEY'
});
const response = await trophy.admin.tenants.create([
{
customerId: 'customer_12345',
name: 'Acme Corp'
}
]);from trophy import TrophyApi
client = TrophyApi(api_key='YOUR_API_KEY')
response = client.admin.tenants.create([
{
"customerId": "customer_12345",
"name": "Acme Corp"
}
])import (
"context"
api "github.com/trophyso/trophy-go"
trophyclient "github.com/trophyso/trophy-go/client"
"github.com/trophyso/trophy-go/option"
)
client := trophyclient.NewClient(
option.WithApiKey("YOUR_API_KEY"),
)
response, err := client.Admin.Tenants.Create(context.TODO(), api.CreateTenantsRequest{})curl --request POST \
--url https://admin.trophy.so/v1/tenants \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
[
{
"customerId": "customer_12345",
"name": "Acme Corp"
},
{
"customerId": "customer_67890",
"name": "Globex Inc"
}
]
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://admin.trophy.so/v1/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([
[
'customerId' => 'customer_12345',
'name' => 'Acme Corp'
],
[
'customerId' => 'customer_67890',
'name' => 'Globex Inc'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://admin.trophy.so/v1/tenants")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"customerId\": \"customer_12345\",\n \"name\": \"Acme Corp\"\n },\n {\n \"customerId\": \"customer_67890\",\n \"name\": \"Globex Inc\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://admin.trophy.so/v1/tenants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"customerId\": \"customer_12345\",\n \"name\": \"Acme Corp\"\n },\n {\n \"customerId\": \"customer_67890\",\n \"name\": \"Globex Inc\"\n }\n]"
response = http.request(request)
puts response.read_body{
"created": [],
"issues": [
{
"index": 0,
"severity": "error",
"message": "Customer ID \"customer_12345\" already exists in this environment"
}
]
}{
"created": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"customerId": "customer_12345",
"name": "Acme Corp",
"status": "active",
"created": "2026-01-15T09:30:00.000Z",
"updated": "2026-01-15T09:30:00.000Z"
}
],
"issues": []
}{
"error": "<string>"
}{
"error": "<string>"
}Admin
Create tenants
Create tenants.
POST
/
tenants
JavaScript
import { TrophyApiClient } from '@trophyso/node';
const trophy = new TrophyApiClient({
apiKey: 'YOUR_API_KEY'
});
const response = await trophy.admin.tenants.create([
{
customerId: 'customer_12345',
name: 'Acme Corp'
}
]);from trophy import TrophyApi
client = TrophyApi(api_key='YOUR_API_KEY')
response = client.admin.tenants.create([
{
"customerId": "customer_12345",
"name": "Acme Corp"
}
])import (
"context"
api "github.com/trophyso/trophy-go"
trophyclient "github.com/trophyso/trophy-go/client"
"github.com/trophyso/trophy-go/option"
)
client := trophyclient.NewClient(
option.WithApiKey("YOUR_API_KEY"),
)
response, err := client.Admin.Tenants.Create(context.TODO(), api.CreateTenantsRequest{})curl --request POST \
--url https://admin.trophy.so/v1/tenants \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
[
{
"customerId": "customer_12345",
"name": "Acme Corp"
},
{
"customerId": "customer_67890",
"name": "Globex Inc"
}
]
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://admin.trophy.so/v1/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([
[
'customerId' => 'customer_12345',
'name' => 'Acme Corp'
],
[
'customerId' => 'customer_67890',
'name' => 'Globex Inc'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://admin.trophy.so/v1/tenants")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"customerId\": \"customer_12345\",\n \"name\": \"Acme Corp\"\n },\n {\n \"customerId\": \"customer_67890\",\n \"name\": \"Globex Inc\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://admin.trophy.so/v1/tenants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"customerId\": \"customer_12345\",\n \"name\": \"Acme Corp\"\n },\n {\n \"customerId\": \"customer_67890\",\n \"name\": \"Globex Inc\"\n }\n]"
response = http.request(request)
puts response.read_body{
"created": [],
"issues": [
{
"index": 0,
"severity": "error",
"message": "Customer ID \"customer_12345\" already exists in this environment"
}
]
}{
"created": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"customerId": "customer_12345",
"name": "Acme Corp",
"status": "active",
"created": "2026-01-15T09:30:00.000Z",
"updated": "2026-01-15T09:30:00.000Z"
}
],
"issues": []
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Body
application/json
Array of tenants to create. Maximum 100 tenants per request.
Was this page helpful?
⌘I