{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/hummingdeck/main/json-schema/hummingdeck-share-link-schema.json",
  "title": "ShareLink",
  "x-generated": "2026-10-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hummingdeck-openapi.json#/components/schemas/ShareLink",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the share link"
    },
    "slug": {
      "type": "string",
      "description": "URL slug for the share link"
    },
    "type": {
      "type": "string",
      "enum": [
        "personal",
        "anonymous"
      ],
      "description": "Link type"
    },
    "recipientName": {
      "type": [
        "string",
        "null"
      ],
      "description": "Recipient name, for personal links"
    },
    "recipientEmail": {
      "type": [
        "string",
        "null"
      ],
      "description": "Recipient email, for personal links"
    },
    "contact": {
      "oneOf": [
        {
          "$ref": "#/$defs/Contact"
        },
        {
          "type": "null"
        }
      ],
      "description": "Contact attached to the link, when personal account resolution was requested"
    },
    "contactCreated": {
      "type": "boolean",
      "description": "True when this request created the returned contact"
    },
    "company": {
      "oneOf": [
        {
          "$ref": "#/$defs/Company"
        },
        {
          "type": "null"
        }
      ],
      "description": "Company attached to the link, when resolved"
    },
    "companyCreated": {
      "type": "boolean",
      "description": "True when this request created the returned company"
    },
    "shareUrl": {
      "type": "string",
      "format": "uri",
      "description": "Full trackable URL to view the shared document, using the workspace's eligible active custom domain when configured"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "id",
    "slug",
    "type",
    "contactCreated",
    "companyCreated",
    "shareUrl",
    "createdAt"
  ],
  "$defs": {
    "Company": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the company"
        },
        "name": {
          "type": "string"
        },
        "domain": {
          "type": [
            "string",
            "null"
          ]
        },
        "logoUrl": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "industry": {
          "type": [
            "string",
            "null"
          ]
        },
        "size": {
          "type": [
            "string",
            "null"
          ]
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "name",
        "domain",
        "logoUrl",
        "industry",
        "size",
        "createdAt",
        "updatedAt"
      ]
    },
    "Contact": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the contact"
        },
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "format": "email"
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "description": "Job title"
        },
        "leadId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Deprecated alias for companyId",
          "deprecated": true
        },
        "leadName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Deprecated alias for companyName",
          "deprecated": true
        },
        "companyId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Associated company ID, null when the contact has no company in this workspace"
        },
        "companyName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Associated company name"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "firstName",
        "lastName",
        "email",
        "companyId",
        "companyName"
      ]
    }
  }
}