Skip to Content
API ReferenceOrganizations

Organizations API

Organizations are company-level entities that own and group workspaces. They provide a higher level of administration for teams that manage multiple workspaces (e.g., production, staging, sandbox environments).

Endpoints

MethodPathDescription
GET/api/v1/organizationsList organizations
POST/api/v1/organizationsCreate an organization
GET/api/v1/organizations/{orgId}Get an organization
PUT/api/v1/organizations/{orgId}Update an organization
DELETE/api/v1/organizations/{orgId}Delete an organization
GET/api/v1/organizations/{orgId}/workspacesList org workspaces
POST/api/v1/organizations/{orgId}/workspacesCreate workspace in org
POST/api/v1/organizations/{orgId}/workspaces/{workspaceId}/membersAdd an existing org member to a workspace
GET/api/v1/organizations/{orgId}/membersList org members
POST/api/v1/organizations/{orgId}/members/inviteInvite a new member by email
PUT/api/v1/organizations/{orgId}/members/{accountId}/roleUpdate member role
DELETE/api/v1/organizations/{orgId}/members/{accountId}Remove a member
GET/api/v1/organizations/{orgId}/invitesList pending invitations
DELETE/api/v1/organizations/{orgId}/invites/{inviteId}Cancel an invitation
POST/api/v1/organizations/{orgId}/invites/{inviteId}/acceptAccept an invitation
POST/api/v1/organizations/{orgId}/invites/{inviteId}/resendResend an invitation email

List Organizations

GET /api/v1/organizations

Returns all organizations the authenticated user is a member of. Does not require the X-Workspace-ID header.

Response

[ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Acme Corp", "slug": "acme-corp", "avatar_url": "", "settings": {}, "created_by": "660e8400-e29b-41d4-a716-446655440000", "workspace_count": 3, "member_count": 15, "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-15T09:30:00Z" } ]

Example

curl -X GET https://composable.zeotap.com/api/v1/organizations \ -H "Authorization: Bearer <token>"

Create Organization

POST /api/v1/organizations

Creates a new organization. The authenticated user becomes the organization owner.

Request Body

FieldTypeRequiredDescription
namestringYesOrganization display name
slugstringYesURL-safe identifier (must be globally unique)
{ "name": "Acme Corp", "slug": "acme-corp" }

Response

Returns the created organization with status 201 Created.

Example

curl -X POST https://composable.zeotap.com/api/v1/organizations \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Corp", "slug": "acme-corp" }'

Get Organization

GET /api/v1/organizations/{orgId}

Returns a single organization by ID.


Update Organization

PUT /api/v1/organizations/{orgId}

Updates organization details. Requires org_owner or org_admin role.

Request Body

FieldTypeRequiredDescription
namestringNoUpdated display name
slugstringNoUpdated slug
avatar_urlstringNoUpdated avatar URL
settingsobjectNoUpdated org settings

Delete Organization

DELETE /api/v1/organizations/{orgId}

Deletes an organization. Requires org_owner role. All workspaces under the organization must be deleted first.

Response

{ "status": "deleted" }

Workspace Management

List Org Workspaces

GET /api/v1/organizations/{orgId}/workspaces

Returns all workspaces belonging to the organization.

Create Workspace in Org

POST /api/v1/organizations/{orgId}/workspaces

Creates a new workspace under the organization.

Request Body

FieldTypeRequiredDescription
namestringYesWorkspace display name
slugstringYesURL-safe identifier
{ "name": "Production", "slug": "production" }

Member Management

Organization Roles

RoleDescription
org_ownerFull access to org settings, billing, and all workspaces
org_adminCan manage org members and create workspaces
org_memberCan access assigned workspaces

List Members

GET /api/v1/organizations/{orgId}/members

Returns all organization members with their roles and account details.

Response

[ { "organization_id": "550e8400-e29b-41d4-a716-446655440000", "account_id": "660e8400-e29b-41d4-a716-446655440000", "role": "org_owner", "email": "alice@example.com", "name": "Alice Smith", "avatar_url": "https://...", "created_at": "2024-01-01T00:00:00Z" } ]

Invite Member

POST /api/v1/organizations/{orgId}/members/invite

Sends an email invitation to add a new member to the organization. The new account is created on acceptance.

Request Body

FieldTypeRequiredDescription
emailstringYesEmail address of the user to invite
rolestringNoRole to assign on acceptance (defaults to org_member)

Update Member Role

PUT /api/v1/organizations/{orgId}/members/{accountId}/role

Changes a member’s organization role.

Request Body

FieldTypeRequiredDescription
rolestringYesNew role (org_owner, org_admin, org_member)

Remove Member

DELETE /api/v1/organizations/{orgId}/members/{accountId}

Removes a member from the organization. Also removes them from all workspaces under the organization.


Invitations

Invitations are managed via the members/invite endpoint (see Invite Member above) and the invites collection below.

List Invitations

GET /api/v1/organizations/{orgId}/invites

Returns all pending invitations.

Response

[ { "id": "770e8400-e29b-41d4-a716-446655440000", "organization_id": "550e8400-e29b-41d4-a716-446655440000", "email": "newuser@example.com", "role": "org_member", "invited_by": "660e8400-e29b-41d4-a716-446655440000", "inviter_name": "Alice Smith", "status": "pending", "expires_at": "2024-02-15T00:00:00Z", "created_at": "2024-01-15T09:30:00Z", "updated_at": "2024-01-15T09:30:00Z" } ]

Cancel Invitation

DELETE /api/v1/organizations/{orgId}/invites/{inviteId}

Cancels a pending invitation.

Accept Invitation

POST /api/v1/organizations/{orgId}/invites/{inviteId}/accept

Accepts an invitation. The authenticated user is added to the organization with the invited role.

Resend Invitation

POST /api/v1/organizations/{orgId}/invites/{inviteId}/resend

Resends the invitation email for a pending invite.


Organization Object

FieldTypeDescription
idstring (UUID)Unique identifier
namestringDisplay name
slugstringURL-safe identifier
avatar_urlstringAvatar image URL
settingsobjectOrganization settings
created_bystring (UUID)Account that created the org
workspace_countintegerNumber of workspaces
member_countintegerNumber of members
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp

Organization Member Object

FieldTypeDescription
organization_idstring (UUID)Organization ID
account_idstring (UUID)Account ID
rolestringorg_owner, org_admin, or org_member
emailstringMember email
namestringMember display name
avatar_urlstringMember avatar URL
created_atstring (ISO 8601)When the member was added

Organization Invite Object

FieldTypeDescription
idstring (UUID)Unique identifier
organization_idstring (UUID)Organization ID
emailstringInvited email address
rolestringRole to assign on acceptance
invited_bystring (UUID)Account that sent the invite
inviter_namestringName of the inviter
statusstringpending, accepted, or expired
expires_atstring (ISO 8601)Invitation expiry time
created_atstring (ISO 8601)Creation timestamp
updated_atstring (ISO 8601)Last update timestamp
Last updated on