{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/medsender/json-schema/medsender-sent-fax-schema.json",
  "title": "SentFax",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/medsender-openapi.json#/components/schemas/SentFax",
  "type": "object",
  "required": [
    "sendToken",
    "fromNumber",
    "toNumber",
    "sentStatus",
    "isTest"
  ],
  "properties": {
    "sendToken": {
      "type": "string"
    },
    "fromNumber": {
      "type": "string",
      "description": "Fax number in E.164 format.",
      "pattern": "^\\+[1-9]\\d{1,14}$"
    },
    "toNumber": {
      "type": "string",
      "description": "Fax number in E.164 format.",
      "pattern": "^\\+[1-9]\\d{1,14}$"
    },
    "sentStatus": {
      "type": "string",
      "enum": [
        "queued",
        "inprogress",
        "success",
        "failure"
      ]
    },
    "sentAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "numPages": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    },
    "errorDetails": {
      "$ref": "#/$defs/FaxErrorDetails"
    },
    "isTest": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Null for forwarded faxes when no test flag was set."
    },
    "patientName": {
      "type": [
        "string",
        "null"
      ]
    },
    "patientDob": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "senderName": {
      "type": [
        "string",
        "null"
      ]
    },
    "recipientName": {
      "type": [
        "string",
        "null"
      ]
    },
    "note": {
      "type": [
        "string",
        "null"
      ]
    },
    "recordStatus": {
      "type": "string",
      "enum": [
        "activated",
        "archived",
        "revoked"
      ]
    },
    "documentType": {
      "type": "string",
      "enum": [
        "both",
        "document_only",
        "access_code_sheet_only"
      ]
    },
    "expiry": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "viewCount": {
      "type": "integer",
      "minimum": 0
    },
    "secureLink": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    }
  },
  "$defs": {
    "FaxErrorDetails": {
      "type": [
        "object",
        "null"
      ],
      "required": [
        "errorMessage"
      ],
      "properties": {
        "errorMessage": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}