REST API

Organizations

Each user belongs to exactly one organization. Organizations group projects, members, and billing. All endpoints require a JWT session.

GET/organizations/me

Retrieve the organization associated with the authenticated session.

Auth:JWT Session (cookie)
Response
HTTP/1.1 200 OK

{
  "id": "org_01HX...",
  "name": "Acme Corp",
  "plan": "pro",
  "createdAt": "2026-01-15T10:00:00.000Z"
}
PATCH/organizations/me

Update the name or plan of the current organization.

Auth:JWT Session (cookie)

Request Body

NameTypeRequiredDescription
namestringoptionalNew organization display name.
plan"free" | "pro" | "enterprise"optionalSubscription plan.
Request
PATCH /organizations/me HTTP/1.1
Content-Type: application/json

{
  "name": "Acme Corp",
  "plan": "pro"
}
Response
HTTP/1.1 200 OK

{
  "id": "org_01HX...",
  "name": "Acme Corp",
  "plan": "pro",
  "createdAt": "2026-01-15T10:00:00.000Z"
}
GET/organizations/members

List all members of the current organization with their user profiles and roles.

Auth:JWT Session (cookie)
Response
HTTP/1.1 200 OK

[
  {
    "id": "mem_01HX...",
    "role": "OWNER",
    "joinedAt": "2026-01-15T10:00:00.000Z",
    "user": {
      "id": "usr_01HX...",
      "name": "Alice Smith",
      "email": "[email protected]"
    }
  },
  {
    "id": "mem_02HX...",
    "role": "MEMBER",
    "joinedAt": "2026-02-01T08:30:00.000Z",
    "user": {
      "id": "usr_02HX...",
      "name": "Bob Jones",
      "email": "[email protected]"
    }
  }
]
POST/organizations/:orgId/members

Add a user to the organization by their user ID. Requires OWNER role.

Auth:JWT Session (cookie)

Path Parameters

NameTypeRequiredDescription
orgIdstringrequiredOrganization ID.

Request Body

NameTypeRequiredDescription
userIdstringrequiredID of the user to add.
role"OWNER" | "MEMBER"optionalMember role. Defaults to MEMBER.
Request
POST /organizations/org_01HX.../members HTTP/1.1
Content-Type: application/json

{
  "userId": "usr_02HX...",
  "role": "MEMBER"
}
Response
HTTP/1.1 201 Created

{
  "id": "mem_03HX...",
  "organizationId": "org_01HX...",
  "userId": "usr_02HX...",
  "role": "MEMBER",
  "joinedAt": "2026-03-13T12:00:00.000Z"
}