E012: Create organization
POST /api/organizations
Creates a new tenant organization with the calling user as its owner. Triggered from the OrgSignup or NewOrganization page. Provisions the org row, the owner membership, and the default settings bundle in one transaction.
Authentication
User-scoped route. Requires Authorization: Bearer <firebase-id-token>; X-Org-Id is not required — the user identity alone is sufficient. Access: Member.
Request
{
"name": "Acme Co"
}
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | yes | Display name. Slug is derived server-side. |
Response — 201 Created
{
"organization": {
"id": "uuid",
"name": "Acme Co",
"slug": "acme-co",
"createdAt": "2026-05-18T22:00:00Z"
},
"membership": {
"userId": "uuid",
"orgId": "uuid",
"role": "owner",
"createdAt": "2026-05-18T22:00:00Z"
}
}
Errors
| HTTP | code | Condition |
|---|---|---|
| 422 | validation_failed | name is missing, empty, or fails shape checks; or slug retries were exhausted. |
Workflow
Calls W012 Create organization.