Provision Tenant
POST
/api/v1/tenants
const url = 'https://api.spartanauth.com/api/v1/tenants';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"slug":"example","name":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.spartanauth.com/api/v1/tenants \ --header 'Content-Type: application/json' \ --data '{ "slug": "example", "name": "example" }'Creates a new isolated tenant (and its default sector) for a customer. In pooled/Turso mode this provisions a new database. Only an admin of the legacy tenant’s default (admin) sector may call this.
Request Body
Section titled “Request Body ” Media type application/json
object
slug
string
name
string
Example generated
{ "slug": "example", "name": "example"}Responses
Section titled “ Responses ”A successful response.
Media type application/json
object
tenantID
string
slug
string
kid
string
sector
object
sectorID
string
name
string
domain
string
isDefault
boolean
allowedOrigins
Array<string>
slug
string
Example generated
{ "tenantID": "example", "slug": "example", "kid": "example", "sector": { "sectorID": "example", "name": "example", "domain": "example", "isDefault": true, "allowedOrigins": [ "example" ], "slug": "example" }}default
Section titled “default ”An unexpected error response.
Media type application/json
object
code
integer format: int32
message
string
details
Array<object>
object
@type
string
key
additional properties
Example generated
{ "code": 1, "message": "example", "details": [ { "@type": "example" } ]}