{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smarterdata/json-schema/smarterdata-envelope-schema.json",
  "title": "Envelope",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smarterdata-openapi.json#/components/schemas/Envelope",
  "type": "object",
  "required": [
    "ok"
  ],
  "properties": {
    "ok": {
      "type": "boolean"
    },
    "entity": {
      "type": "string"
    },
    "count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Records in this answer. null on a contact count or estimate of a segment under 25 companies."
    },
    "credits_used": {
      "type": "integer"
    },
    "credits_remaining": {
      "type": "integer"
    },
    "estimate": {
      "type": "boolean",
      "description": "true on an answer to estimate=true."
    },
    "credit_cost": {
      "type": [
        "integer",
        "null"
      ],
      "description": "On estimate=true."
    },
    "credits_per_record": {
      "type": "integer",
      "description": "On a contact estimate."
    },
    "has_more": {
      "type": "boolean"
    },
    "total_matching": {
      "type": "integer"
    },
    "pagination_mode": {
      "type": "string"
    },
    "definition": {
      "type": "string",
      "description": "On contact answers: named_dm_strict or any_reachable_person."
    },
    "already_delivered": {
      "type": [
        "boolean",
        "integer"
      ],
      "description": "true on a record you bought in the last 12 months; on a reveal, how many contacts were withheld for that reason."
    },
    "replayed": {
      "type": "boolean",
      "description": "true on a retry with the same idempotency-key."
    },
    "original_credits_used": {
      "type": "integer",
      "description": "On a replay: what the first call paid."
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "On GET /v1/me/list."
    },
    "window_days": {
      "type": "integer",
      "description": "On GET /v1/me/list."
    },
    "note": {
      "type": "string"
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "records": {
      "type": "array",
      "items": {}
    }
  }
}