Register company in tenant_registry (portal, owner-only)
POST
/api/account/company
const url = 'http://localhost:3000/api/account/company';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","slug":"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 http://localhost:3000/api/account/company \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "slug": "example" }'Cloud only. Bearer JWT + X-Organization-Id. Membership must be owner. Body is { name, slug } only — never tenant_id. Upserts public.tenant_registry.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
name
required
string
slug
required
string
Example generated
{ "name": "example", "slug": "example"}Responses
Section titled “ Responses ”Company registered
Invalid body or no active organisation
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Not authenticated
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Owner role required
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}Slug taken
Media type application/json
object
error
required
string
Example
{ "error": "Not found"}