{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/converly-io/json-schema/converly-io-destination-schema.json",
  "title": "Destination",
  "description": "Proxy view over the delivery service's destination state. Destinations live in the delivery service, not the frontend DB.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/converly-io-openapi.yml#/components/schemas/Destination",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "enum": [
        "dest_google-ads",
        "dest_meta",
        "dest_google-analytics",
        "dest_reddit-ads",
        "dest_linkedin-ads",
        "dest_tiktok-ads",
        "dest_chatgpt-ads"
      ],
      "description": "Literal destination id — NOT a UUID. One per destination type; hardcoded, globally unique."
    },
    "integration": {
      "type": "string",
      "enum": [
        "google-ads",
        "meta",
        "google-analytics",
        "reddit-ads",
        "linkedin-ads",
        "tiktok-ads",
        "chatgpt-ads"
      ]
    },
    "name": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "description": "Detail beyond `connected`, when the delivery service reports it: `pending` | `rejected` | `cancelled` | `connection_broken`. Omitted for never-touched destinations. A `connection_broken` destination still HAS a stored credential and is still disconnectable, even though `connected` is false."
    },
    "connection_type": {
      "type": "string",
      "description": "`oauth` | `oauth_or_paste_token`. Differs from `/v1/destination-types.connection_types[]` — that one is the list of methods that exist; this is the current preferred path."
    },
    "connected": {
      "type": "boolean"
    },
    "connection_metadata": {
      "type": "object",
      "additionalProperties": {},
      "description": "Non-secret destination metadata. Google Ads and Meta include connection_snapshot version 2: fixed target, binding_id, connection_revision and independent access, setup and intake facts. A retained target remains after disconnect; completion does not prove attribution or reporting."
    },
    "reconnect": {
      "type": "object",
      "additionalProperties": {},
      "description": "Meta manual-connect result. Complete includes an immutable receipt for the exact attempt and connection revision; it is independent of later current-state reads."
    }
  },
  "required": [
    "id",
    "integration",
    "name",
    "connection_type",
    "connected",
    "connection_metadata"
  ]
}