{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/esignsimple-com/json-schema/esignsimple-com-document-with-events-schema.json",
  "title": "DocumentWithEvents",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/esignsimple-com-openapi.yml#/components/schemas/DocumentWithEvents",
  "allOf": [
    {
      "$ref": "#/$defs/Document"
    },
    {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "at": {
                "type": "string",
                "format": "date-time"
              },
              "signer_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ip": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "Document": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "title": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "draft",
            "sent",
            "finalizing",
            "completed",
            "voided",
            "declined"
          ]
        },
        "status_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "sequential": {
          "type": "boolean"
        },
        "pages": {
          "type": "integer"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "sent_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "original_sha256": {
          "type": [
            "string",
            "null"
          ]
        },
        "final_sha256": {
          "type": [
            "string",
            "null"
          ]
        },
        "download_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "signers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Signer"
          }
        }
      }
    },
    "Signer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "order": {
          "type": "integer"
        },
        "status": {
          "type": "string"
        },
        "signed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    }
  }
}