{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mailbox-bot/json-schema/mailbox-bot-inbound-list-items-response-schema.json",
  "title": "InboundListItemsResponse",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/mailbox-bot-api-openapi.json#/components/schemas/InboundListItemsResponse",
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "reference": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "letter",
              "package"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "received",
              "action_requested",
              "in_progress",
              "scanned",
              "forwarded",
              "discarded",
              "exception"
            ]
          },
          "sample": {
            "type": "boolean"
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "sender": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "mailbox": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "pmb_number": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": -9007199254740991,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "public_mailbox_id": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "pmb_number",
                  "public_mailbox_id"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "agent": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "exterior": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "exterior",
                      "interior",
                      "evidence"
                    ]
                  },
                  "page_number": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "sha256": {
                    "type": "string",
                    "pattern": "^[0-9a-f]{64}$"
                  },
                  "ocr_status": {
                    "type": "string",
                    "enum": [
                      "none",
                      "queued",
                      "processing",
                      "ready",
                      "needs_review",
                      "failed"
                    ]
                  },
                  "text": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "is_blank": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "uncertain_spans": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "start": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "end": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "start",
                        "end"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "url_expires_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "content_trust": {
                    "type": "string",
                    "const": "untrusted_document"
                  }
                },
                "required": [
                  "id",
                  "kind",
                  "page_number",
                  "sha256",
                  "ocr_status",
                  "text",
                  "is_blank",
                  "uncertain_spans",
                  "url",
                  "url_expires_at",
                  "content_trust"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "open_action": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "scan",
                      "forward",
                      "discard"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "proposed",
                      "approved",
                      "in_progress",
                      "done",
                      "rejected",
                      "failed",
                      "cancelled"
                    ]
                  },
                  "requested_by": {
                    "type": "string",
                    "enum": [
                      "member",
                      "agent",
                      "staff",
                      "rule"
                    ]
                  },
                  "price_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "billable": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "destination": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "company": {
                            "default": null,
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 100
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "line1": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "line2": {
                            "default": null,
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 120
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "city": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "state": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          },
                          "postal_code": {
                            "type": "string",
                            "pattern": "^\\d{5}(-\\d{4})?$"
                          },
                          "country": {
                            "default": "US",
                            "type": "string",
                            "const": "US"
                          }
                        },
                        "required": [
                          "name",
                          "line1",
                          "city",
                          "state",
                          "postal_code"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mail_class": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "first_class",
                          "priority",
                          "certified",
                          "certified_return_receipt",
                          "fedex_ground",
                          "fedex_express",
                          "fedex_2day",
                          "fedex_overnight"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tracking_number": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "failure_reason": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "damaged",
                          "wrong_renter",
                          "missing",
                          "other"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "evidence_page_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "version": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "approved_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "started_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "completed_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "type",
                  "state",
                  "requested_by",
                  "price_cents",
                  "billable",
                  "destination",
                  "mail_class",
                  "tracking_number",
                  "failure_reason",
                  "evidence_page_ids",
                  "version",
                  "created_at",
                  "approved_at",
                  "started_at",
                  "completed_at"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "reference",
          "kind",
          "status",
          "sample",
          "environment",
          "sender",
          "received_at",
          "version",
          "mailbox",
          "agent",
          "exterior",
          "open_action"
        ],
        "additionalProperties": false
      }
    },
    "pagination": {
      "type": "object",
      "properties": {
        "total": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "offset": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000
        },
        "has_more": {
          "type": "boolean"
        }
      },
      "required": [
        "total",
        "limit",
        "offset",
        "has_more"
      ],
      "additionalProperties": false
    },
    "search": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "query": {
              "type": "string"
            },
            "mode": {
              "type": "string",
              "const": "literal_and"
            }
          },
          "required": [
            "query",
            "mode"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "notice": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "const": "sample_unavailable"
        },
        "message": {
          "type": "string"
        }
      },
      "required": [
        "reason",
        "message"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "items",
    "pagination",
    "search"
  ],
  "additionalProperties": false
}