Skip to content

Organizations

intermediate

Manage organizations, invite members, manage roles, and handle API keys.

Get organization

GET/v1/organizations/{org_id}

Retrieve details for a specific organization.

org_idstringrequired

Organization ID (path parameter).

200Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Acme Engineering",
  "slug": "acme-eng",
  "plan_id": "pro",
  "status": "active",
  "created_at": "2026-01-15T10:00:00Z",
  "member_count": 5,
  "stripe_customer_id": "cus_..."
}

Update organization

PATCH/v1/organizations/{org_id}

Update organization name or settings. Requires admin role.

namestring | null

New organization name.

settingsobject | null

Organization settings to update.

200Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Acme Engineering (Updated)",
  "slug": "acme-eng",
  "plan_id": "pro",
  "status": "active"
}

Delete organization

DELETE/v1/organizations/{org_id}

Permanently delete an organization and all its data. Requires admin role.

200Response
{
  "message": "Organization deleted"
}
Danger

Organization deletion is irreversible and removes all memory data.


List members (shortcut)

GET/v1/organizations/members

List all members of your organization. Resolves the organization from JWT/API key.

200Response
[
  {
    "id": "member-uuid",
    "user_id": "user-uuid",
    "email": "[email protected]",
    "name": "Alice",
    "role": "admin",
    "joined_at": "2026-01-15T10:00:00Z",
    "last_login_at": "2026-01-20T14:30:00Z",
    "avatar_url": null
  }
]

List members (explicit org)

GET/v1/organizations/{org_id}/members

List all members of a specific organization.


Invite member (shortcut)

POST/v1/organizations/invitations

Send an email invitation to join your organization.

emailstringrequired

Email address to invite.

rolestringDefault: member

Role to assign: admin, member, or owner.

200Response
{
  "invitation_id": "inv-uuid",
  "email": "[email protected]",
  "role": "member",
  "message": "Invitation sent"
}

Invite member (explicit org)

POST/v1/organizations/{org_id}/members/invite

Send an invitation specifying the organization explicitly.

emailstringrequired

Email address to invite.

rolestringDefault: member

Role to assign.


Accept invitation

POST/v1/organizations/invitations/accept

Accept a pending invitation.

tokenstringrequired

The invitation token from the email link.

200Response
{
  "message": "Invitation accepted"
}

List invitations (shortcut)

GET/v1/organizations/invitations

List pending invitations for your organization.

200Response
[
  {
    "id": "inv-uuid",
    "email": "[email protected]",
    "role": "member",
    "invited_by": "user-uuid",
    "expires_at": "2026-01-22T10:00:00Z",
    "created_at": "2026-01-15T10:00:00Z",
    "status": "pending"
  }
]

Update member role (shortcut)

PATCH/v1/organizations/members/{member_id}

Change a member's role.

member_idstringrequired

Member ID (path parameter).

rolestringrequired

New role: admin, member, or owner.


Update member role (explicit org)

PATCH/v1/organizations/{org_id}/members/{member_id}/role

Change a member's role in a specific organization.

rolestringrequired

New role.


Remove member (shortcut)

DELETE/v1/organizations/members/{member_id}

Remove a member from your organization.


Remove member (explicit org)

DELETE/v1/organizations/{org_id}/members/{member_id}

Remove a member from a specific organization.

200Response
{
  "message": "Member removed"
}

Organization usage

GET/v1/organizations/{org_id}/usage

Get usage breakdown for the organization.

200Response
{
  "plan_id": "pro",
  "patterns": {
    "current": 4523,
    "limit": 100000,
    "percentage": 4.5,
    "warning": false
  },
  "queries_today": {
    "current": 274,
    "limit": -1,
    "percentage": 0,
    "warning": false
  },
  "api_keys": {
    "current": 3,
    "limit": 20,
    "percentage": 15,
    "warning": false
  },
  "members": {
    "current": 5,
    "limit": 10,
    "percentage": 50,
    "warning": false
  },
  "operations_today": {}
}

Create API key (explicit org)

POST/v1/organizations/{org_id}/api-keys

Create a new API key for the organization.

namestringrequired

Descriptive name for the key.

environmentstringDefault: live

Key environment: live or test.

scopesarray | null

Permission scopes. Null for full access.

expires_atstring | null

Optional expiration date (ISO 8601).

200Response
{
  "id": "key-uuid",
  "name": "Production Backend",
  "key": "ek_live_a1b2c3d4e5f6...",
  "key_prefix": "ek_live_a1b2",
  "environment": "live",
  "scopes": [
    "memory:read",
    "memory:write"
  ],
  "created_at": "2026-01-15T10:00:00Z",
  "message": "Store this key securely. It will not be shown again."
}
Danger

The full API key value is only shown once in this response. Store it securely immediately.


List API keys (explicit org)

GET/v1/organizations/{org_id}/api-keys

List all API keys for the organization. Values are masked.

200Response
[
  {
    "id": "key-uuid",
    "name": "Production Backend",
    "key_prefix": "ek_live_a1b2",
    "environment": "live",
    "scopes": [
      "memory:read",
      "memory:write"
    ],
    "last_used_at": "2026-01-20T14:30:00Z",
    "expires_at": null,
    "created_at": "2026-01-15T10:00:00Z"
  }
]

Update API key

PATCH/v1/organizations/{org_id}/api-keys/{key_id}

Update an API key's name, scopes, or expiration.

namestring | null

New name.

scopesarray | null

New scopes.

expires_atstring | null

New expiration date.


Revoke API key

DELETE/v1/organizations/{org_id}/api-keys/{key_id}

Immediately revoke an API key.

200Response
{
  "message": "API key revoked"
}
Warning

Revoking is immediate. All requests using this key will receive 401 errors.

Next steps