Organizations

An organization is your isolated workspace on Egret — it owns your private knowledge base, tracks your storage and document limits, and scopes your API keys and sessions.

Creating an organization

Organizations are created from the Egret dashboard: Login → Organization → Create an Organization. You can manage your organization programmatically using the endpoints below once it exists.

All organization endpoints require authentication: Authorization: Bearer egret_...

List organizations

GET https://api.getegret.com/v1/orgs/
Authorization: Bearer egret_...

Returns all organizations belonging to the authenticated user.

[
  {
    "id": "0d4f8133-cefb-47da-8a7b-fb118b1895e9",
    "slug": "egret-ai",
    "name": "Egret AI",
    "owner_email": "you@example.com",
    "s3_prefix": "orgs/egret-ai/",
    "allowed_domains": [],
    "max_documents": 50,
    "max_storage_bytes": 524288000,
    "max_members": 5,
    "document_count": 1,
    "storage_used_bytes": 408970,
    "storage_used_mb": 0.39,
    "max_storage_mb": 500.0,
    "member_count": 1,
    "kb_status": "active",
    "is_active": true,
    "created_at": "2026-03-25T21:54:52.674567Z",
    "updated_at": "2026-03-25T21:54:52.674598Z"
  }
]

Get organization detail

GET https://api.getegret.com/v1/orgs/{org_slug}/
Authorization: Bearer egret_...

Returns a single organization by its slug.

Response fields

FieldDescription
slugURL-safe identifier used in API paths
allowed_domainsDomain slugs this org is restricted to. Empty array = access to all domains
max_documentsMaximum private documents allowed in the knowledge base
max_storage_mbStorage limit in MB for private documents
document_countNumber of documents currently uploaded
storage_used_mbStorage consumed in MB
kb_statusactive when the private knowledge base is ready to receive uploads and queries
max_membersMaximum team members allowed on your plan

Update organization name

PATCH https://api.getegret.com/v1/orgs/{org_slug}/
Authorization: Bearer egret_...
Content-Type: application/json

{
  "name": "Egret AI LLC"
}

Returns the updated organization object.

Restrict to specific domains

Use allowed_domains to limit your organization to one or more Egret domains. Queries made by your org's API keys will be restricted to those domains only.

PATCH https://api.getegret.com/v1/orgs/{org_slug}/
Authorization: Bearer egret_...
Content-Type: application/json

{
  "allowed_domains": ["business-continuity"]
}

Pass an empty array ([]) to remove restrictions and allow access to all available domains.

Team management

Multi-member team management — inviting members, assigning roles, and removing members — is coming in the next update.