Organizations
POST /organizations
Create a new organization. You become the admin automatically.
Body:
json
{
"name": "Acme Inc",
"slug": "acme-inc",
"description": "Optional"
}Response: Organization object + JWT tokens (auto-switches to new org).
GET /organizations/:id
Get organization details. You must be a member.
PATCH /organizations/:id
Update organization name, slug, or description. You must be a member.
Body:
json
{
"name": "Updated Name",
"slug": "updated-slug"
}DELETE /organizations/:id
Delete an organization. Requires Admin role.
POST /organizations/:id/invitations
Invite a user to the organization. Requires Admin role.
Body:
json
{
"invitedEmail": "newuser@example.com",
"desired_role": "user"
}Response:
json
{
"id": 1,
"code": "inv_abc123...",
"invitedEmail": "newuser@example.com",
"invite_role": "user",
"status": "pending"
}