Add Tenant

post
Add Tenant

https://api.serialized.io/tenants
This endpoint allows you to create a Tenant.
Request
Response
Request
Headers
Serialized-Access-Key
required
string
Serialized access key
Serialized-Secret-Access-Key
required
string
Serialized secret key
Body Parameters
tenantId
required
string
Unique tenant id
reference
optional
string
Tenant reference
Response
200: OK
Tenant successfully created
204: No Content
Tenant already created
400: Bad Request
Invalid Tenant id or reference.

Example

cURL
Java
C#
Node
cURL
curl -i https://api.serialized.io/tenants \
--header "Content-Type: application/json" \
--header "Serialized-Access-Key: <YOUR_ACCESS_KEY>" \
--header "Serialized-Secret-Access-Key: <YOUR_SECRET_ACCESS_KEY>" \
--data '
{
"tenantId": "e9ef574f-4563-4d56-ad9e-0a2d5ce42004",
"reference": "Acme Inc"
}
'
Java
import com.google.common.collect.ImmutableMap;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
Client client = ClientBuilder.newClient();
URI apiRoot = URI.create("https://api.serialized.io");
Map<String, Object> tenant = ImmutableMap.of(
"tenantId", "e9ef574f-4563-4d56-ad9e-0a2d5ce42004",
"reference", "Acme Inc"
);
Response response = client.target(apiRoot)
.path("tenants")
.request()
.header("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
.header("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>")
.post(Entity.json(tenant));
C#
using System;
using System.Collections.Generic;
using RestSharp;
var tenant = new Dictionary<string, Object>
{
{ "tenantId", "e9ef574f-4563-4d56-ad9e-0a2d5ce42004" },
{ "reference", "Acme Inc" }
};
var client = new RestClient("https://api.serialized.io");
var request = new RestRequest("tenants", Method.POST)
.AddHeader("Serialized-Access-Key", "<YOUR_ACCESS_KEY>")
.AddHeader("Serialized-Secret-Access-Key", "<YOUR_SECRET_ACCESS_KEY>");
.AddJsonBody(tenant);
var response = client.Execute(request);
Node
const axios = require("axios");
const client = axios.create({
baseURL: "https://api.serialized.io",
headers: {"Serialized-Access-Key": "<YOUR_ACCESS_KEY>"},
headers: {"Serialized-Secret-Access-Key": "<YOUR_SECRET_ACCESS_KEY>"}
});
const definition = {
tenantId: "e9ef574f-4563-4d56-ad9e-0a2d5ce42004",
reference: "Acme Inc"
};
client.post("tenants", definition)
.then(function (response) {
// Handle response
})
.catch(function (error) {
// Handle error
});