Organizations
Use organization endpoints to discover the API key’s organization, read and update organization settings, inspect resource counts, manage members, and manage invitations.
Some organization actions, such as transferring account ownership or closing an account, are not available through the API.
API keys are scoped to one organization. If an API key requests a different org_id, the API returns 404.
List Organizations
GET /organizations
Lists organizations available to the caller. For API-key auth, this returns the key’s organization.
Permission: api-read
Response:
{
"data": [
{
"id": "org_...",
"name": "Acme",
"is_personal": false,
"billing_account_id": "ba_...",
"data_persistence": {},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"role": "member"
}
]
}Get Organization
GET /organizations/{org_id}
Returns organization details.
Permission: api-read
Response:
{
"data": {
"id": "org_...",
"name": "Acme",
"is_personal": false,
"billing_account_id": "ba_...",
"data_persistence": {},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-01T00:00:00Z",
"role": "member",
"counts": {
"members": 3,
"primary_owners": 1
}
}
}data_persistence.stored_responses_days is omitted when the organization uses the default 30 day retention.
Update Organization
PATCH /organizations/{org_id}
Updates organization settings.
Permission: api-admin
Request:
{
"name": "New organization name",
"data_persistence": {
"stored_responses_days": 7
}
}Fields:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | New organization name. |
data_persistence | object | No | Contains stored_responses_days, the stored response retention in days for the Responses API when store: true is sent. Overrides the Mixlayer default of 30 days. Must be 0 through 90; 0 means responses are not stored even when store: true is sent. |
Response:
{
"data": {
"id": "org_...",
"name": "New organization name",
"is_personal": false,
"billing_account_id": "ba_...",
"data_persistence": {
"stored_responses_days": 7
},
"created_at": "2026-01-01T00:00:00Z",
"updated_at": "2026-01-02T00:00:00Z",
"role": "member",
"counts": {
"members": 3,
"primary_owners": 1
}
}
}List Resources
GET /organizations/{org_id}/resources
Returns resource counts for the organization.
Permission: api-read
Response:
{
"data": {
"api_keys": 4
}
}The response is a map from resource name to count.
List Members
GET /organizations/{org_id}/members
Lists organization members.
Permission: api-read
Query parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 50 | Maximum members to return. |
Response:
{
"data": [
{
"id": "user_...",
"user": {
"id": "user_...",
"email": "[email protected]",
"name": "Person Example",
"profile_image_url": "https://..."
},
"role": "owner",
"joined_at": "2026-01-01T00:00:00Z",
"last_active_at": "2026-01-02T00:00:00Z"
}
]
}profile_image_url and last_active_at may be null.
Update Member
PATCH /organizations/{org_id}/members/{member_id}
Updates a member role.
Permission: api-admin
Request:
{
"role": "member"
}Fields:
| Field | Type | Required | Description |
|---|---|---|---|
role | string | Yes | New member role. One of owner or member. |
Response:
{
"data": {
"id": "user_...",
"user": {
"id": "user_...",
"email": "[email protected]",
"name": "Person Example",
"profile_image_url": "https://..."
},
"role": "member",
"joined_at": "2026-01-01T00:00:00Z",
"last_active_at": "2026-01-02T00:00:00Z"
}
}Remove Member
DELETE /organizations/{org_id}/members/{member_id}
Removes a member from the organization.
Permission: api-admin
Response: 204 No Content
List Invitations
GET /organizations/{org_id}/invites
Lists pending organization invitations.
Permission: api-read
Response:
{
"data": [
{
"id": "invite_...",
"email": "[email protected]",
"role": "member",
"invited_by": {
"id": "user_...",
"email": "[email protected]",
"name": "Owner Example"
},
"created_at": "2026-01-01T00:00:00Z",
"expires_at": "2026-01-08T00:00:00Z"
}
]
}role is one of primary_owner, owner, or member. invited_by.name may be null.
Send Invitation
POST /organizations/{org_id}/invites
Sends an invitation to join the organization.
Permission: api-admin
Request:
{
"email": "[email protected]",
"role": "member"
}Fields:
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address to invite. |
role | string | Yes | Role to assign when the invitation is accepted. One of primary_owner, owner, or member. |
Response:
{
"data": {
"id": "invite_...",
"email": "[email protected]",
"role": "member",
"invited_by": {
"id": "user_...",
"email": "[email protected]",
"name": "Owner Example"
},
"created_at": "2026-01-01T00:00:00Z",
"expires_at": "2026-01-08T00:00:00Z"
}
}Status: 201 Created
Resend Invitation
POST /organizations/{org_id}/invites/{invite_id}/resend
Resends a pending organization invitation.
Permission: api-admin
Response: 204 No Content
Revoke Invitation
DELETE /organizations/{org_id}/invites/{invite_id}
Revokes a pending organization invitation.
Permission: api-admin
Response: 204 No Content
Errors
All endpoints can return:
{
"error": {
"message": "resource not found"
}
}Common statuses:
| Status | Code | When |
|---|---|---|
400 | none | Missing name and data_persistence, invalid data_persistence.stored_responses_days, or invalid request body. |
401 | none | Authentication failed. |
403 | insufficient_api_key_permissions | API key does not have the required permission. |
403 | forbidden, forbidden_personal, forbidden_role, cannot_remove_self | The caller cannot perform the organization/member change. |
404 | none, organization_not_found, member_not_found, invitation_not_found | Organization, member, invitation, or API-key organization scope was not found. |
409 | already_member, invite_pending, last_primary_owner, not_active_member | The invitation, role, or removal change conflicts with current organization state. |
422 | invalid_email, invalid_name, invalid_role | Email, organization name, or member role is invalid. |
500 | none | Internal error. |