zumpo/docs
Dashboard
Skip to content
usage / API reference
GETgetUsageStatsDeprecated

Get quota usage snapshot

Deprecated path alias of a bare GET /v1/usage call. It returns the same durable snapshot from the tenant, mode, account, and profile-scoped quota ledger. Zumpo has no cached external subscription snapshot, so reconcile does not change the read; this compatibility endpoint does not invent plan or payment fields that are not present in local durable data.

Authentication

The following security requirement applies to this operation.

  1. bearerhttp

    scheme
    bearer
    bearerFormat
    zumpo-api-key
Read the authentication guide

Parameters

reconcilequeryoptional

Accepted for target compatibility. The local quota ledger is read directly on every request and therefore has no cached plan state to reconcile.

reconcileboolean
Original schema
{
  "type": "boolean"
}

Responses

Status codes and shapes declared for this operation. Read each description for the meaning of that response.

200Response schema
application/json
Response 200object
#/components/schemas/UsageSnapshotDto
additionalProperties
false
required
[ "quota" ]
quotaarrayrequired
Array itemobject
#/components/schemas/PlatformQuotaUsageDto
additionalProperties
false
required
[ "platform", "accountId", "profileId", "platformAccountId", "quotaModel", "window", "unitsUsed", "deferredCount", "unitsRemaining", "unitsRemainingReason" ]
platformstringrequired

Platform id

enum
[ "instagram", "facebook", "threads", "whatsapp", "twitter", "linkedin", "youtube", "tiktok", "pinterest", "reddit", "bluesky", "telegram", "discord", "slack", "google_business", "snapchat", "mastodon", "shopify", "google_ads", "tiktok_ads", "pinterest_ads", "x_ads", "openai_ads" ]
accountIdstringrequired

The internal account id that produced the consumption (accounts.id).

pattern
^[0-9a-f]{24}$
profileIdstringrequired

The profile the consumption is attributed to. The counter is kept per profile: if the same platform account is linked to more than one profile in the same team, each profile sees ITS OWN counter. The response contains only the profiles in the scope of the caller.

pattern
^[0-9a-f]{24}$
platformAccountIdstringrequired

The account id on the provider side. The same value can appear on more than one row (if the same account is linked to more than one profile); the counters of those rows are SEPARATE and the provider-level total is their sum.

quotaModeloneOfrequired

The quota model declaration of the adapter. null if the adapter of the platform is not registered in this mode - a declaration is not invented.

nullable
true
oneOf / 1object
additionalProperties
false
required
[ "type", "dailyUnits", "costPerPost" ]
typestringrequired
enum
[ "shared" ]
dailyUnitsnumberrequired
minimum
0
costPerPostnumberrequired
minimum
0
oneOf / 2object
additionalProperties
false
required
[ "type" ]
typestringrequired
enum
[ "per-tenant" ]
oneOf / 3object
additionalProperties
false
required
[ "type", "unitCost" ]
typestringrequired
enum
[ "metered" ]
unitCostnumberrequired
minimum
0
oneOf / 4object
additionalProperties
false
required
[ "type" ]
typestringrequired
enum
[ "unlimited" ]
windowobjectrequired
#/components/schemas/UsageWindowDto
additionalProperties
false
required
[ "start", "end" ]
startstringrequired
format
date-time
example
2026-08-04T00:00:00.000Z
endstringrequired
format
date-time
example
2026-08-05T00:00:00.000Z
unitsUsedintegerrequired

The quota units THIS PROFILE spent over this platform account in this window, as written to the ledger. The counter is keyed by (team, mode, profile, platform, platform account, window): the consumption of another profile that has linked the same platform account DOES NOT ENTER this number. IT IS NOT EXACT, IT IS A LOWER BOUND: a quota unit is spent when the limiter token is taken, while the ledger row is written afterwards and in three cases cannot be written - (1) the transaction of the publish result is rolled back, (2) the publish result can never be committed (the target has meanwhile been taken over by another worker), (3) the write of the row itself fails (the publish is not affected, the event is reported operationally). In all three the unit was spent and is nevertheless not counted. The drift has one direction only: it can undercount, it NEVER overcounts.

minimum
0
deferredCountintegerrequired

The number of publish attempts DEFERRED because of quota in this window. It comes from the same ledger and the same row as unitsUsed, so the same three drift paths apply to it as well: IT IS A LOWER BOUND, it can undercount, it never overcounts. Limiter unavailability is not written here - that is an infrastructure event.

minimum
0
unitsRemainingintegerrequired

A number if an honest remainder belonging to the tenant can be derived, otherwise null. On a shared pool dailyUnits - your own usage IS NOT COMPUTED: because the pool is shared across all tenants, that computation would promise a capacity that does not exist. The real remainder of the pool is not returned either, because it would leak the aggregate cross-tenant traffic.

nullable
true
example
null
unitsRemainingReasonstringrequired

A machine-readable rationale saying WHY unitsRemaining is null; null when a number is returned.

enum
[ "shared_pool_not_tenant_scoped", "per_tenant_limit_undeclared", "metered_usage_uncapped", "unlimited_quota_model", "quota_model_unavailable" ]
nullable
true
example
shared_pool_not_tenant_scoped
Original schema
{
  "$ref": "#/components/schemas/UsageSnapshotDto"
}
400Invalid or unknown query parameter

Invalid or unknown query parameter

No response body schema is specified for this entry.

401Authentication failed

Authentication failed

application/json
Response 401object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
403Permission denied

Permission denied

application/json
Response 403object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
404Resource not found

Resource not found

application/json
Response 404object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
409Conflict

Conflict

application/json
Response 409object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
429Rate limit exceeded

Rate limit exceeded

application/json
Response 429object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Response headers

X-RateLimit-Limit

Request ceiling that applied to this request. Authenticated requests use the team tier ceiling; unauthenticated identity endpoints use a per-IP ceiling. Usage is measured continuously against a trailing period rather than tallied and cleared at a boundary, so the full ceiling never becomes available again in one step.

X-RateLimit-Limitinteger
minimum
1
Original schema
{
  "type": "integer",
  "minimum": 1
}

X-RateLimit-Remaining

Requests still allowed against that ceiling; never negative. On a 429 produced by the request throttler this is 0. Such a refused request is not counted, so retrying too early costs you no capacity and does not push your recovery further away.

X-RateLimit-Remaininginteger
minimum
0
Original schema
{
  "type": "integer",
  "minimum": 0
}

X-RateLimit-Reset

Absolute Unix epoch time, in SECONDS, at which the current counting period turns over. This is NOT the number of seconds left: subtract the current time to obtain that. It is also NOT the moment your capacity returns: earlier usage keeps weighing on the ceiling across the turnover, so after a 429 wait for Retry-After instead, which is usually later than this value.

X-RateLimit-Resetinteger
format
int64
minimum
0
Original schema
{
  "type": "integer",
  "format": "int64",
  "minimum": 0
}

Retry-After

Seconds to wait before retrying. Always a positive integer delta (never an HTTP-date), at least 1. On a 429 from the request throttler it is the wait until your usage actually drops back under the ceiling; prefer it over any delay you compute from X-RateLimit-Reset.

Retry-Afterinteger
minimum
1
maximum
86400
Original schema
{
  "type": "integer",
  "minimum": 1,
  "maximum": 86400
}
500Server error

Server error

application/json
Response 500object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
502Platform error

Platform error

application/json
Response 502object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}
503Service unavailable

Service unavailable

application/json
Response 503object
#/components/schemas/ZumpoErrorDto
required
[ "error", "type", "code", "docUrl", "requestId" ]
errorstringrequired

Human-readable message. UNSTABLE — do not branch on it.

example
WhatsApp session window expired; use a template message.
typestringrequired

Stable error category (does not change across versions).

enum
[ "invalid_request_error", "authentication_error", "permission_error", "not_found", "conflict", "rate_limit_error", "platform_error", "platform_rejected", "account_disconnected", "media_error", "api_error" ]
example
invalid_request_error
codestringrequired

Stable machine-readable code.

example
whatsapp_window_expired
paramstring

Offending parameter, present only when relevant.

example
body
docUrlstringrequired

https://docs.zumpo.io/errors/{code}

example
https://docs.zumpo.io/errors/whatsapp_window_expired
requestIdstringrequired

Support correlation id: req_ + 16 hex.

example
req_7f3a9c2e1b8d4056
detailsobject

Additional structured context, present only when an error has more to say than a single param can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.

additionalProperties
true
example
{ "created": [ { "kind": "campaign", "platformId": "120210000000000001" }, { "kind": "adSet", "platformId": "120210000000000002" } ] }
Original schema
{
  "$ref": "#/components/schemas/ZumpoErrorDto"
}

Referenced schemas

Original local definitions used by this operation. Recursive and deeply nested references can be inspected here without expanding them repeatedly.

UsageSnapshotDto

#/components/schemas/UsageSnapshotDto

{
  "type": "object",
  "properties": {
    "quota": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/PlatformQuotaUsageDto"
      }
    }
  },
  "additionalProperties": false,
  "required": [
    "quota"
  ]
}
PlatformQuotaUsageDto

#/components/schemas/PlatformQuotaUsageDto

{
  "type": "object",
  "properties": {
    "platform": {
      "type": "string",
      "enum": [
        "instagram",
        "facebook",
        "threads",
        "whatsapp",
        "twitter",
        "linkedin",
        "youtube",
        "tiktok",
        "pinterest",
        "reddit",
        "bluesky",
        "telegram",
        "discord",
        "slack",
        "google_business",
        "snapchat",
        "mastodon",
        "shopify",
        "google_ads",
        "tiktok_ads",
        "pinterest_ads",
        "x_ads",
        "openai_ads"
      ],
      "description": "Platform id"
    },
    "accountId": {
      "type": "string",
      "pattern": "^[0-9a-f]{24}$",
      "description": "The internal account id that produced the consumption (accounts.id)."
    },
    "profileId": {
      "type": "string",
      "pattern": "^[0-9a-f]{24}$",
      "description": "The profile the consumption is attributed to. The counter is kept per profile: if the same platform account is linked to more than one profile in the same team, each profile sees ITS OWN counter. The response contains only the profiles in the scope of the caller."
    },
    "platformAccountId": {
      "type": "string",
      "description": "The account id on the provider side. The same value can appear on more than one row (if the same account is linked to more than one profile); the counters of those rows are SEPARATE and the provider-level total is their sum."
    },
    "quotaModel": {
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "dailyUnits",
            "costPerPost"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "shared"
              ]
            },
            "dailyUnits": {
              "type": "number",
              "minimum": 0
            },
            "costPerPost": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "per-tenant"
              ]
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type",
            "unitCost"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "metered"
              ]
            },
            "unitCost": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "type"
          ],
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "unlimited"
              ]
            }
          }
        }
      ],
      "nullable": true,
      "description": "The quota model declaration of the adapter. null if the adapter of the platform is not registered in this mode - a declaration is not invented."
    },
    "window": {
      "$ref": "#/components/schemas/UsageWindowDto"
    },
    "unitsUsed": {
      "type": "integer",
      "minimum": 0,
      "description": "The quota units THIS PROFILE spent over this platform account in this window, as written to the ledger. The counter is keyed by (team, mode, profile, platform, platform account, window): the consumption of another profile that has linked the same platform account DOES NOT ENTER this number. IT IS NOT EXACT, IT IS A LOWER BOUND: a quota unit is spent when the limiter token is taken, while the ledger row is written afterwards and in three cases cannot be written - (1) the transaction of the publish result is rolled back, (2) the publish result can never be committed (the target has meanwhile been taken over by another worker), (3) the write of the row itself fails (the publish is not affected, the event is reported operationally). In all three the unit was spent and is nevertheless not counted. The drift has one direction only: it can undercount, it NEVER overcounts."
    },
    "deferredCount": {
      "type": "integer",
      "minimum": 0,
      "description": "The number of publish attempts DEFERRED because of quota in this window. It comes from the same ledger and the same row as `unitsUsed`, so the same three drift paths apply to it as well: IT IS A LOWER BOUND, it can undercount, it never overcounts. Limiter unavailability is not written here - that is an infrastructure event."
    },
    "unitsRemaining": {
      "type": "integer",
      "nullable": true,
      "example": null,
      "description": "A number if an honest remainder belonging to the tenant can be derived, otherwise null. On a shared pool `dailyUnits - your own usage` IS NOT COMPUTED: because the pool is shared across all tenants, that computation would promise a capacity that does not exist. The real remainder of the pool is not returned either, because it would leak the aggregate cross-tenant traffic."
    },
    "unitsRemainingReason": {
      "type": "string",
      "enum": [
        "shared_pool_not_tenant_scoped",
        "per_tenant_limit_undeclared",
        "metered_usage_uncapped",
        "unlimited_quota_model",
        "quota_model_unavailable"
      ],
      "nullable": true,
      "example": "shared_pool_not_tenant_scoped",
      "description": "A machine-readable rationale saying WHY `unitsRemaining` is null; null when a number is returned."
    }
  },
  "additionalProperties": false,
  "required": [
    "platform",
    "accountId",
    "profileId",
    "platformAccountId",
    "quotaModel",
    "window",
    "unitsUsed",
    "deferredCount",
    "unitsRemaining",
    "unitsRemainingReason"
  ]
}
UsageWindowDto

#/components/schemas/UsageWindowDto

{
  "type": "object",
  "properties": {
    "start": {
      "type": "string",
      "format": "date-time",
      "example": "2026-08-04T00:00:00.000Z"
    },
    "end": {
      "type": "string",
      "format": "date-time",
      "example": "2026-08-05T00:00:00.000Z"
    }
  },
  "additionalProperties": false,
  "required": [
    "start",
    "end"
  ]
}
ZumpoErrorDto

#/components/schemas/ZumpoErrorDto

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "Human-readable message. UNSTABLE — do not branch on it.",
      "example": "WhatsApp session window expired; use a template message."
    },
    "type": {
      "type": "string",
      "description": "Stable error category (does not change across versions).",
      "enum": [
        "invalid_request_error",
        "authentication_error",
        "permission_error",
        "not_found",
        "conflict",
        "rate_limit_error",
        "platform_error",
        "platform_rejected",
        "account_disconnected",
        "media_error",
        "api_error"
      ],
      "example": "invalid_request_error"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable code.",
      "example": "whatsapp_window_expired"
    },
    "param": {
      "type": "string",
      "description": "Offending parameter, present only when relevant.",
      "example": "body"
    },
    "docUrl": {
      "type": "string",
      "description": "https://docs.zumpo.io/errors/{code}",
      "example": "https://docs.zumpo.io/errors/whatsapp_window_expired"
    },
    "requestId": {
      "type": "string",
      "description": "Support correlation id: req_ + 16 hex.",
      "example": "req_7f3a9c2e1b8d4056"
    },
    "details": {
      "type": "object",
      "additionalProperties": true,
      "description": "Additional structured context, present only when an error has more to say than a single `param` can carry. Values are generated by this API (identifiers, node names); provider text and raw upstream payloads are never placed here. Example: a multi-step ad create that fails part-way performs no compensating delete and returns what it already built, so the caller can attach to the surviving ad set instead of losing it.",
      "example": {
        "created": [
          {
            "kind": "campaign",
            "platformId": "120210000000000001"
          },
          {
            "kind": "adSet",
            "platformId": "120210000000000002"
          }
        ]
      }
    }
  },
  "required": [
    "error",
    "type",
    "code",
    "docUrl",
    "requestId"
  ]
}