{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/converly-io/json-schema/converly-io-handoff-schema.json",
  "title": "Handoff",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/converly-io-openapi.yml#/components/schemas/Handoff",
  "type": "object",
  "properties": {
    "id": {
      "$ref": "#/$defs/HandoffId"
    },
    "purpose": {
      "type": "string",
      "enum": [
        "connect_destination",
        "connect_trigger_source",
        "add_card",
        "complete_signup",
        "device_code_signup"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "completed",
        "cancelled",
        "expired"
      ]
    },
    "url": {
      "type": "string",
      "description": "For `/v1/handoffs` and Google Ads `/v1/destinations/oauth-handoffs`: a Converly-hosted connect page. Opening is read-only; the human starts authorization there. GA4 `/v1/destinations/oauth-handoffs` retains a direct Google consent URL."
    },
    "short_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "result": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {},
      "description": "Populated when status === 'completed'. For connect_destination: { destination_id, destination_type, customer_id?, descriptive_name?, connected_email? } — destination_id is the `dest_<slug>` id used by GET /v1/destinations/{id}/conversions. Prepared Google Ads and Meta completions also include reconnect with its immutable receipt and connection_revision. The result stays historical after a later renewal; current access, setup and intake are separate connection_snapshot facts. Meta retains its fixed pixel through disconnect and token replacement. Google Analytics (GA4) connections additionally carry { property_id?, stream_id?, measurement_id? }, and customer_id mirrors property_id. For connect_trigger_source (created via the MCP surface): { integration_id, integration_label, connected_email? }."
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "purpose",
    "status",
    "url",
    "short_code",
    "result",
    "expires_at",
    "completed_at",
    "created_at"
  ],
  "$defs": {
    "HandoffId": {
      "type": "string",
      "pattern": "^hdf_[0-9A-Za-z]{22}$"
    }
  }
}