{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prodantix-com/json-schema/prodantix-com-integration-connection-dto-schema.json",
  "title": "IntegrationConnectionDto",
  "description": "A connected tool.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prodantix-com-openapi.json#/components/schemas/IntegrationConnectionDto",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "provider": {
      "type": "string"
    },
    "mechanism": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "testMode": {
      "type": "string"
    },
    "scope": {
      "type": "string",
      "description": "`project` for a connection this project owns, `org` for one the\norganisation owns. What the page badges each row with."
    },
    "reach": {
      "type": [
        "string",
        "null"
      ],
      "description": "Absent on a project connection; `enforced`, `opt_in` or `subset` on an\norganisation one."
    },
    "hasSigningSecret": {
      "type": "boolean"
    },
    "hasBodyTemplate": {
      "type": "boolean"
    },
    "hasWorkspace": {
      "type": "boolean",
      "description": "Whether an OAuth connection holds an installed workspace's token. What\nthe page reads to offer Install instead of a channel list; always true\nis wrong for a row created and never installed, and the seal itself\nnever crosses."
    },
    "lastAttemptedAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "When a workflow step last tried this connection, whether or not the\nsend landed. Null until something has used it."
    },
    "lastDeliveredAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "When the provider last accepted a send. Null while every attempt has\nfailed, which is the case a single \"last used\" column cannot express:\nthe page reads this and falls back to `last_attempted_at`, so a\nconnection failing every send reads as used and delivering nothing."
    },
    "targets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/IntegrationTargetDto"
      }
    },
    "eventCount": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "How many events an event platform connection has brought in. Null on a\nconnection that sends rather than pulls."
    },
    "lastPulledAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "When an event platform connection last finished a pull. Null until its\nfirst, and on a connection that sends."
    },
    "needsReauthorization": {
      "type": "boolean",
      "description": "Whether the connection pulls nothing until someone signs it in: the\nplatform withdrew access, or no account was ever signed in."
    },
    "channelsPostedTo": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "How many channels the enabled, published workflows post to through an\ninstalled workspace. Null on a connection that stores its targets."
    }
  },
  "required": [
    "id",
    "provider",
    "mechanism",
    "name",
    "status",
    "testMode",
    "scope",
    "hasSigningSecret",
    "hasBodyTemplate",
    "hasWorkspace",
    "targets",
    "needsReauthorization"
  ],
  "$defs": {
    "IntegrationTargetDto": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "environment": {
          "type": "string"
        },
        "hint": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "environment",
        "hint"
      ],
      "description": "A destination on a connection. `hint` stands in for the secret; there is no\nfield that carries the secret itself."
    }
  }
}