{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/100hires-com/json-schema/100hires-com-candidate-message-list-response-schema.json",
  "title": "CandidateMessageListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/100hires-com-messages-api-openapi.yml#/components/schemas/CandidateMessageListResponse",
  "type": "object",
  "required": [
    "messages",
    "pagination"
  ],
  "properties": {
    "messages": {
      "type": "array",
      "description": "Array of messages.",
      "items": {
        "$ref": "#/$defs/CandidateMessage"
      }
    },
    "pagination": {
      "$ref": "#/$defs/Pagination"
    }
  },
  "$defs": {
    "ApiAttachment": {
      "type": "object",
      "description": "Unified attachment shape returned by apiV2 endpoints (resumes, candidate files, application attachments, message attachments, call recordings, voicemail audio in nurture campaigns).\n\n`url` is an absolute URL served by the API host (`https://api.100hires.com/v2/attachments/{category}/{uuid}/{file_name}`) and serves the raw file bytes with `Authorization: Bearer <API_KEY>`. The response on `url` sets `Content-Disposition: attachment; filename=\"...\"` with the human-readable filename.\n\nUse `uuid` to reference the attachment in other endpoints (e.g. nurture voicemail step).\n",
      "required": [
        "uuid",
        "url",
        "relative_time",
        "file"
      ],
      "properties": {
        "uuid": {
          "type": "string",
          "format": "uuid",
          "description": "Unique attachment identifier. Stable across API calls; use in referencing endpoints."
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Absolute download URL (e.g. `https://api.100hires.com/v2/attachments/application/{uuid}/{file_name}`). Hit with `Authorization: Bearer <API_KEY>`."
        },
        "relative_time": {
          "type": "string",
          "description": "Human-readable time since upload (e.g. `\"2 days ago\"`)."
        },
        "file": {
          "$ref": "#/$defs/AttachmentFile"
        }
      }
    },
    "Attachment": {
      "description": "Message attachment (deprecated name, alias for `ApiAttachment`).",
      "allOf": [
        {
          "$ref": "#/$defs/ApiAttachment"
        }
      ]
    },
    "AttachmentFile": {
      "type": "object",
      "required": [
        "is_image",
        "orig_file_name",
        "file_ext",
        "file_type",
        "readable_size"
      ],
      "properties": {
        "is_image": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the file is an image."
        },
        "orig_file_name": {
          "type": "string",
          "description": "Original file name."
        },
        "file_ext": {
          "type": "string",
          "description": "File extension."
        },
        "file_type": {
          "type": "string",
          "description": "File type category."
        },
        "readable_size": {
          "type": "string",
          "description": "Human-readable file size."
        }
      },
      "additionalProperties": false
    },
    "CandidateInitialMailMessage": {
      "type": "object",
      "required": [
        "type",
        "is_sent_by_candidate",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Message type discriminator.",
          "enum": [
            "candidate_initial_mail_message"
          ]
        },
        "is_sent_by_candidate": {
          "type": "boolean",
          "description": "Whether the candidate sent this message."
        },
        "message": {
          "$ref": "#/$defs/InitialMailMessage"
        }
      },
      "additionalProperties": false
    },
    "CandidateMailboxMessage": {
      "type": "object",
      "required": [
        "type",
        "is_sent_by_candidate",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Message type discriminator.",
          "enum": [
            "mailbox"
          ]
        },
        "is_sent_by_candidate": {
          "type": "boolean",
          "description": "Whether the candidate sent this message."
        },
        "message": {
          "$ref": "#/$defs/MailboxMessage"
        }
      },
      "additionalProperties": false
    },
    "CandidateMessage": {
      "oneOf": [
        {
          "$ref": "#/$defs/CandidateMailboxMessage"
        },
        {
          "$ref": "#/$defs/CandidateTextingMessage"
        },
        {
          "$ref": "#/$defs/CandidateVoicemailMessage"
        },
        {
          "$ref": "#/$defs/CandidateInitialMailMessage"
        },
        {
          "$ref": "#/$defs/CandidateNotificationMessage"
        }
      ]
    },
    "CandidateNotificationMessage": {
      "type": "object",
      "required": [
        "type",
        "is_sent_by_candidate",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Message type discriminator.",
          "enum": [
            "notification"
          ]
        },
        "is_sent_by_candidate": {
          "type": "boolean",
          "description": "Whether the candidate sent this message."
        },
        "message": {
          "$ref": "#/$defs/NotificationMessage"
        }
      },
      "additionalProperties": false
    },
    "CandidateTextingMessage": {
      "type": "object",
      "required": [
        "type",
        "is_sent_by_candidate",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Message type discriminator.",
          "enum": [
            "texting"
          ]
        },
        "is_sent_by_candidate": {
          "type": "boolean",
          "description": "Whether the candidate sent this message."
        },
        "message": {
          "$ref": "#/$defs/TextingMessage"
        }
      },
      "additionalProperties": false
    },
    "CandidateVoicemailMessage": {
      "type": "object",
      "required": [
        "type",
        "is_sent_by_candidate",
        "message"
      ],
      "properties": {
        "type": {
          "type": "string",
          "description": "Message type discriminator.",
          "enum": [
            "voicemail"
          ]
        },
        "is_sent_by_candidate": {
          "type": "boolean",
          "description": "Whether the candidate sent this message."
        },
        "message": {
          "$ref": "#/$defs/VoicemailMessage"
        }
      },
      "additionalProperties": false
    },
    "InitialMailMessage": {
      "type": "object",
      "required": [
        "id",
        "from",
        "to",
        "subject",
        "body",
        "date"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Message ID."
        },
        "from": {
          "type": "string",
          "description": "Sender address."
        },
        "to": {
          "type": "string",
          "description": "Recipient address."
        },
        "subject": {
          "type": "string",
          "description": "Message subject."
        },
        "body": {
          "type": "string",
          "description": "Message body as HTML that is safe to render. The markup of the email is kept after sanitizing."
        },
        "date": {
          "type": "string",
          "description": "Message date."
        }
      },
      "additionalProperties": false
    },
    "MailboxMessage": {
      "type": "object",
      "required": [
        "id",
        "from",
        "to",
        "cc",
        "subject",
        "date",
        "schedule",
        "opensCount",
        "opens",
        "autoJobId",
        "isNurtured"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Message ID."
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "description": "Sender address."
        },
        "to": {
          "type": "string",
          "description": "Recipient address."
        },
        "cc": {
          "type": "string",
          "description": "CC recipients."
        },
        "subject": {
          "type": "string",
          "description": "Message subject."
        },
        "body": {
          "type": "string",
          "description": "Message body content. Present only when `view=full` (default); omitted entirely when `view=summary` — message bodies can run into tens of KB."
        },
        "date": {
          "type": "string",
          "description": "Message date."
        },
        "attachments": {
          "type": "array",
          "description": "Message attachments. Present only when `view=full` (default); omitted entirely when `view=summary`.",
          "items": {
            "$ref": "#/$defs/Attachment"
          }
        },
        "schedule": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                ""
              ]
            },
            {
              "$ref": "#/$defs/MailboxSchedule"
            }
          ]
        },
        "opensCount": {
          "type": "integer",
          "description": "Number of times opened."
        },
        "opens": {
          "type": "array",
          "description": "Array of open tracking events.",
          "items": {
            "$ref": "#/$defs/MailboxOpenEvent"
          }
        },
        "autoJobId": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ]
        },
        "isNurtured": {
          "type": "boolean",
          "description": "Whether sent via nurture campaign."
        }
      },
      "additionalProperties": false
    },
    "MailboxOpenEvent": {
      "type": "object",
      "required": [
        "label"
      ],
      "properties": {
        "label": {
          "type": "string",
          "description": "Open event label."
        }
      },
      "additionalProperties": false
    },
    "MailboxSchedule": {
      "type": "object",
      "required": [
        "senderId",
        "isForceSend",
        "isFailed",
        "scheduleSendError",
        "isScheduled",
        "scheduledDay",
        "sendAt",
        "humanDatetime",
        "systemDatetime"
      ],
      "properties": {
        "senderId": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Sender mail account ID."
        },
        "isForceSend": {
          "type": "boolean",
          "description": "Whether forced to send immediately."
        },
        "isFailed": {
          "type": "boolean",
          "description": "Whether send failed."
        },
        "scheduleSendError": {
          "type": [
            "string",
            "null"
          ],
          "description": "Error message on failure."
        },
        "isScheduled": {
          "type": "boolean",
          "description": "Whether currently scheduled."
        },
        "scheduledDay": {
          "type": "string",
          "description": "Scheduled date."
        },
        "sendAt": {
          "type": "integer",
          "format": "int64",
          "description": "Scheduled send time."
        },
        "humanDatetime": {
          "type": "string",
          "description": "Human-readable scheduled time."
        },
        "systemDatetime": {
          "type": "string",
          "description": "System scheduled time."
        }
      },
      "additionalProperties": false
    },
    "NotificationMessage": {
      "type": "object",
      "required": [
        "id",
        "from",
        "to",
        "subject",
        "body",
        "date",
        "schedule"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Message ID."
        },
        "from": {
          "type": "string",
          "description": "Sender address."
        },
        "to": {
          "type": "string",
          "description": "Recipient address."
        },
        "subject": {
          "type": "string",
          "description": "Message subject."
        },
        "body": {
          "type": "string",
          "description": "Message body as HTML that is safe to render. The markup of the email is kept after sanitizing."
        },
        "date": {
          "type": "string",
          "description": "Message date."
        },
        "schedule": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                ""
              ]
            },
            {
              "$ref": "#/$defs/NotificationMessageSchedule"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "NotificationMessageSchedule": {
      "type": "object",
      "required": [
        "id",
        "isScheduled",
        "isFailed",
        "humanDatetime",
        "isNotificationMessage"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Schedule ID."
        },
        "isScheduled": {
          "type": "boolean",
          "description": "Whether currently scheduled."
        },
        "isFailed": {
          "type": "boolean",
          "description": "Whether send failed."
        },
        "humanDatetime": {
          "type": "string",
          "description": "Human-readable scheduled time."
        },
        "isNotificationMessage": {
          "type": "boolean",
          "description": "Always true for notification messages."
        }
      },
      "additionalProperties": false
    },
    "Pagination": {
      "type": "object",
      "required": [
        "page_size",
        "page_count",
        "page",
        "total_count"
      ],
      "properties": {
        "page_size": {
          "type": "integer",
          "description": "Items per page."
        },
        "page_count": {
          "type": "integer",
          "description": "Total number of pages."
        },
        "page": {
          "type": "integer",
          "description": "Current page number."
        },
        "total_count": {
          "type": "integer",
          "description": "Total number of items."
        }
      }
    },
    "TextingMessage": {
      "type": "object",
      "required": [
        "id",
        "body",
        "date",
        "isFailed",
        "sendError",
        "schedule",
        "autoJobId",
        "isNurtured",
        "to"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Message ID."
        },
        "body": {
          "type": "string",
          "description": "Message body as HTML that is safe to render. Text of an incoming SMS is HTML-escaped, and its line breaks become `<br />`. An outgoing SMS keeps the editor markup after sanitizing."
        },
        "date": {
          "type": "string",
          "description": "Message date."
        },
        "isFailed": {
          "type": "boolean",
          "description": "Whether delivery failed."
        },
        "sendError": {
          "type": [
            "string",
            "null"
          ],
          "description": "Error message on failure."
        },
        "schedule": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                ""
              ]
            },
            {
              "$ref": "#/$defs/TextingSchedule"
            }
          ]
        },
        "autoJobId": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ]
        },
        "isNurtured": {
          "type": "boolean",
          "description": "Whether sent via nurture campaign."
        },
        "to": {
          "type": "string",
          "description": "Recipient address."
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "description": "Sender address."
        }
      },
      "additionalProperties": false
    },
    "TextingSchedule": {
      "type": "object",
      "required": [
        "isScheduled",
        "scheduledDay",
        "sendAt",
        "humanDatetime",
        "systemDatetime"
      ],
      "properties": {
        "isScheduled": {
          "type": "boolean",
          "description": "Whether currently scheduled."
        },
        "scheduledDay": {
          "type": "string",
          "description": "Scheduled date."
        },
        "sendAt": {
          "type": "integer",
          "format": "int64",
          "description": "Scheduled send time."
        },
        "humanDatetime": {
          "type": "string",
          "description": "Human-readable scheduled time."
        },
        "systemDatetime": {
          "type": "string",
          "description": "System scheduled time."
        }
      },
      "additionalProperties": false
    },
    "VoicemailMessage": {
      "type": "object",
      "required": [
        "id",
        "date",
        "to",
        "from",
        "attachment",
        "isFailed",
        "sendError",
        "schedule",
        "isCallTook",
        "autoJobId",
        "isNurtured"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "description": "Message ID."
        },
        "date": {
          "type": "string",
          "description": "Message date."
        },
        "to": {
          "type": "string",
          "description": "Recipient address."
        },
        "from": {
          "type": [
            "string",
            "null"
          ],
          "description": "Sender address."
        },
        "attachment": {
          "$ref": "#/$defs/Attachment"
        },
        "isFailed": {
          "type": "boolean",
          "description": "Whether delivery failed."
        },
        "sendError": {
          "type": [
            "string",
            "null"
          ],
          "description": "Error message on failure."
        },
        "schedule": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                ""
              ]
            },
            {
              "$ref": "#/$defs/VoicemailSchedule"
            }
          ]
        },
        "isCallTook": {
          "type": "boolean",
          "description": "Whether the call was answered."
        },
        "autoJobId": {
          "oneOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ]
        },
        "isNurtured": {
          "type": "boolean",
          "description": "Whether sent via nurture campaign."
        }
      },
      "additionalProperties": false
    },
    "VoicemailSchedule": {
      "type": "object",
      "required": [
        "isScheduled",
        "humanDatetime",
        "systemDatetime"
      ],
      "properties": {
        "isScheduled": {
          "type": "boolean",
          "description": "Whether currently scheduled."
        },
        "humanDatetime": {
          "type": "string",
          "description": "Human-readable scheduled time."
        },
        "systemDatetime": {
          "type": "string",
          "description": "System scheduled time."
        }
      },
      "additionalProperties": false
    }
  }
}