Create a tenant — provision its DB, migrate, register it
POST
/admin/tenants
const url = 'http://localhost:3000/admin/tenants';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"acme","name":"Acme Inc"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/admin/tenants \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "acme", "name": "Acme Inc" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”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
Example
acmename
required
string
Example
Acme IncResponses
Section titled “Responses”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
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
message
required
string
requestId
required
string
fields
Present only for VALIDATION_FAILED.
Array<object>
object
path
string
message
string
Example
{ "error": { "code": "VALIDATION_FAILED" }}