{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prospectapis/json-schema/prospectapis-connect-link-schema.json",
  "title": "ConnectLink",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prospectapis-connected-account-api-openapi.yml#/components/schemas/ConnectLink",
  "type": "object",
  "required": [
    "link_id",
    "url",
    "type",
    "account_id",
    "name",
    "expires_on",
    "success_redirect_url",
    "failure_redirect_url",
    "notify_url"
  ],
  "properties": {
    "link_id": {
      "type": "string",
      "format": "uuid",
      "description": "Revoke the link with DELETE /v1/accounts/connect-link/{link_id}."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Send this to your end user. It is single use, works until expires_on, and is shown only in this answer: we store only a hash of its token. The token sits in the URL fragment, so it reaches no server log."
    },
    "type": {
      "type": "string",
      "enum": [
        "create",
        "reconnect"
      ]
    },
    "account_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The account a reconnect link reconnects; null for a create link (the account_id comes back on the redirect and in account.connected)."
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "expires_on": {
      "type": "string",
      "format": "date-time"
    },
    "success_redirect_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "failure_redirect_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "notify_url": {
      "type": [
        "string",
        "null"
      ]
    },
    "webhook_secret": {
      "type": "string",
      "pattern": "^whsec_[0-9a-f]{48}$",
      "description": "Only when notify_url was set, and only in this answer: the key the account's events are signed with."
    }
  }
}