Skip to content

Provision Tenant

POST
/api/v1/tenants
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.

Media type application/json
object
slug
string
name
string
Example generated
{
"slug": "example",
"name": "example"
}

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"
}
}

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"
}
]
}