Skip to content

Create a tenant — provision its DB, migrate, register it

POST
/admin/tenants
curl --request POST \
--url http://localhost:3000/admin/tenants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": "acme", "name": "Acme Inc" }'
Media typeapplication/json
object
id
required

Permanent. t, rl, tenant and bull are reserved — they name platform-wide Redis key families, so erasing a tenant with one of those ids would delete other tenants’ data.

string
/^[a-z0-9_]{1,48}$/
Example
acme
name
required
string
Example
Acme Inc

Created. The only time api_secret is ever returned.

Media typeapplication/json
object
id
string
name
string
api_key
string
api_secret
string
Examplegenerated
{
"id": "example",
"name": "example",
"api_key": "example",
"api_secret": "example"
}

The id does not match the pattern, or is reserved. Nothing was created.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
Example
{
"error": {
"code": "VALIDATION_FAILED"
}
}

Tenant already exists

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
Example
{
"error": {
"code": "VALIDATION_FAILED"
}
}