{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/crevio-co/json-schema/crevio-co-connection-link-schema.json",
  "title": "ConnectionLink",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/crevio-co-connections-api-openapi.yml#/components/schemas/ConnectionLink",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "connection_link"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "INITIATED"
      ]
    },
    "toolkit": {
      "type": "string"
    },
    "redirect_url": {
      "type": "string",
      "description": "Hosted OAuth URL to send the user to"
    },
    "external_account_id": {
      "type": "string"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "setup_fields": {
      "type": "array",
      "description": "Fields the connect page asks the user for besides the OAuth login (e.g. Shopify's shop ID and the client ID/secret of a custom app they must create first, with the redirect URI to register). Empty for plain OAuth apps. Walk the user through these before sending them to `redirect_url`.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "Setup instructions for this field, in Markdown"
          },
          "optional": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "optional"
        ]
      }
    }
  },
  "required": [
    "object",
    "status",
    "toolkit",
    "redirect_url"
  ]
}