CapyDB/ docs
ReferenceAPI

Organizations

Organization profile and billing metadata.

Get an organization

GET
/v1/organizations/{orgID}

Authorization

headerAuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

Path Parameters

orgID*string

Organization id.

Response Body

The organization.

application/json
  1. response
organization*
curl -X GET 'https://capydb.dev/api/capydb/v1/organizations/string'
{  "organization": {    "billing_customer_id": "string",    "billing_email": "string",    "billing_name": "string",    "billing_period_end": "2019-08-24T14:15:22Z",    "billing_plan": "none",    "billing_product_id": "string",    "billing_provider": "string",    "billing_status": "string",    "billing_status_since": "2019-08-24T14:15:22Z",    "billing_standing": "good",    "billing_grace_ends_at": "2019-08-24T14:15:22Z",    "billing_subscription_id": "string",    "clerk_organization_id": "string",    "clerk_organization_slug": "string",    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "name": "string",    "slug": "string",    "suspended_at": "2019-08-24T14:15:22Z",    "suspended_reason": "billing_lapsed",    "suspension_rung": 0,    "suspension_rung_since": "2019-08-24T14:15:22Z",    "suspension_next_rung_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "vercel_installation_id": "string",    "cloudflare_account_id": "string"  }}

Update an organization

PATCH
/v1/organizations/{orgID}

Authorization

headerAuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

Path Parameters

orgID*string

Organization id.

Request Body

application/json
  1. body
billing_email?string|null
billing_name?string|null
name?string|null
slug?string|null

Response Body

Updated organization.

application/json
  1. response
organization*
curl -X PATCH 'https://capydb.dev/api/capydb/v1/organizations/string' \  -H 'Content-Type: application/json' \  -d '{}'
{  "organization": {    "billing_customer_id": "string",    "billing_email": "string",    "billing_name": "string",    "billing_period_end": "2019-08-24T14:15:22Z",    "billing_plan": "none",    "billing_product_id": "string",    "billing_provider": "string",    "billing_status": "string",    "billing_status_since": "2019-08-24T14:15:22Z",    "billing_standing": "good",    "billing_grace_ends_at": "2019-08-24T14:15:22Z",    "billing_subscription_id": "string",    "clerk_organization_id": "string",    "clerk_organization_slug": "string",    "created_at": "2019-08-24T14:15:22Z",    "id": "string",    "name": "string",    "slug": "string",    "suspended_at": "2019-08-24T14:15:22Z",    "suspended_reason": "billing_lapsed",    "suspension_rung": 0,    "suspension_rung_since": "2019-08-24T14:15:22Z",    "suspension_next_rung_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "vercel_installation_id": "string",    "cloudflare_account_id": "string"  }}
GET
/v1/organizations/{orgID}/notification-preferences

Authorization

headerAuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

Path Parameters

orgID*string

Organization id.

Response Body

The organization's notification preferences.

application/json
  1. response
notification_preferences*
curl -X GET 'https://capydb.dev/api/capydb/v1/organizations/string/notification-preferences'
{  "notification_preferences": {    "organization_id": "string",    "alert_emails_enabled": true,    "alert_email_recipients": [      "user@example.com"    ],    "billing_email_recipients": [      "user@example.com"    ],    "updated_at": "2019-08-24T14:15:22Z"  }}
PUT
/v1/organizations/{orgID}/notification-preferences

Authorization

headerAuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

Path Parameters

orgID*string

Organization id.

Request Body

application/json
  1. body
alert_emails_enabled*boolean
alert_email_recipients*array<>
Itemsitems <= 10
billing_email_recipients*array<>
Itemsitems <= 10

Response Body

The saved notification preferences.

application/json
  1. response
notification_preferences*
curl -X PUT 'https://capydb.dev/api/capydb/v1/organizations/string/notification-preferences' \  -H 'Content-Type: application/json' \  -d '{  "alert_emails_enabled": true,  "alert_email_recipients": [    "user@example.com"  ],  "billing_email_recipients": [    "user@example.com"  ]}'
{  "notification_preferences": {    "organization_id": "string",    "alert_emails_enabled": true,    "alert_email_recipients": [      "user@example.com"    ],    "billing_email_recipients": [      "user@example.com"    ],    "updated_at": "2019-08-24T14:15:22Z"  }}

Get organization usage

GET
/v1/organizations/{orgID}/usage

Authorization

headerAuthorizationBearer <token>

Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.

Path Parameters

orgID*string

Organization id.

Response Body

Organization usage rollup.

application/json
  1. response
usage*

Org-wide usage rollup assembled from metadata the platform already collects: latest periodic metrics samples per project, plan entitlements, retained backups, and 7-day job/webhook outcomes. No live database collection happens on this path.

curl -X GET 'https://capydb.dev/api/capydb/v1/organizations/string/usage'
{  "usage": {    "totals": {      "storage_bytes": 0,      "storage_limit_bytes": 0,      "storage_overage_bytes": 0,      "connections": 0,      "projects": 0,      "projects_limit": 0,      "previews": 0,      "previews_limit": 0,      "backups_storage_bytes": 0,      "job_success_rate_7d": 0,      "webhook_delivery_rate_7d": 0    },    "projects": [      {        "project_id": "string",        "name": "string",        "state": "provisioning",        "storage_bytes": 0,        "storage_limit_bytes": 0,        "connections": 0      }    ],    "storage_history": [      {        "sampled_at": "2019-08-24T14:15:22Z",        "storage_bytes": 0      }    ],    "storage_overage_billing": {      "period_end": "2019-08-24T14:15:22Z",      "reported_gigabytes": 0,      "projected_gigabytes": 0    }  }}