Create a tenant — provision its DB, migrate, register it
POST
/admin/tenants
const url = 'http://localhost:3000/admin/tenants';const options = { method: 'POST', headers: {'X-Admin-Key': '<X-Admin-Key>', '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 'Content-Type: application/json' \ --header 'X-Admin-Key: <X-Admin-Key>' \ --data '{ "id": "acme", "name": "Acme Inc" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
id
required
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"}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" }}