Organizations API
Multi-tenant organization management with RBAC, invitations, and SSO support. All endpoints require JWT authentication.
Organization CRUD
POST
/api/v1/organizations ๐
Create a new organization. The authenticated user becomes the owner.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Organization name |
slug | string | Yes | URL-safe slug (unique) |
curl -X POST https://api.privabase.com/api/v1/organizations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Acme Corp", "slug": "acme-corp"}'
Response 201
{
"success": true,
"data": {
"id": "org-uuid",
"name": "Acme Corp",
"slug": "acme-corp",
"createdAt": "2026-03-13T..."
}
}
GET
/api/v1/organizations ๐
List all organizations the current user belongs to.
GET
/api/v1/organizations/:id ๐
Get organization details.
PUT
/api/v1/organizations/:id ๐
Update organization name or settings. Requires owner or admin role.
DELETE
/api/v1/organizations/:id ๐
Delete an organization. Requires owner role.
Members
GET
/api/v1/organizations/:id/members ๐
List organization members with their roles.
PUT
/api/v1/organizations/:id/members/:memberId ๐
Update a member's role. Requires owner or admin role.
Request Body
{ "role": "admin" }
Available roles: owner, admin, member, viewer
DELETE
/api/v1/organizations/:id/members/:memberId ๐
Remove a member from the organization.
Invitations
POST
/api/v1/organizations/:id/invitations ๐
Invite a user to the organization by email.
Request Body
{ "email": "teammate@company.com", "role": "member" }
GET
/api/v1/organizations/:id/invitations ๐
List pending invitations for the organization.
DELETE
/api/v1/organizations/:id/invitations/:inviteId ๐
Revoke a pending invitation.
POST
/api/v1/organizations/invitations/:token/accept
Accept an organization invitation using the invite token.
SSO
GET
/api/v1/organizations/:id/sso/metadata ๐
Get SAML SSO metadata for the organization. Used during SSO configuration. See the SSO Setup Guide.
POST
/api/v1/organizations/:id/sso ๐
Configure SAML SSO for the organization. Requires owner role.
Request Body
{
"entityId": "https://idp.example.com/saml",
"ssoUrl": "https://idp.example.com/saml/sso",
"certificate": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
"emailDomain": "company.com"
}
DELETE
/api/v1/organizations/:id/sso ๐
Disable SSO for the organization.