{
  "openapi": "3.1.0",
  "info": {
    "title": "Revdoku public agent API",
    "version": "1.0.0",
    "description": "Cloud storage with an email address for every bucket. Store and share files with authorized people and AI agents; receive email and attachments. New accounts have website publishing disabled on all plans. Check features.website_publishing on the target account; WEBSITE_PUBLISHING_DISABLED is not an upgrade prompt. Signup is browser-only. This document covers selected endpoints; see https://revdoku.com/api.md for the complete API."
  },
  "servers": [
    {
      "url": "https://app.revdoku.com",
      "description": "Revdoku application API"
    }
  ],
  "paths": {
    "/api/v1/status": {
      "get": {
        "operationId": "getRevdokuStatus",
        "summary": "Read current account identity and granted accounts",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current account, account types, client names, accessible parent agencies, fixed credential default, and granted accounts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "account": {
                          "$ref": "#/components/schemas/AccountIdentity"
                        },
                        "default_account_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "accounts": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AccountIdentity"
                          }
                        },
                        "features": {
                          "type": "object",
                          "properties": {
                            "website_publishing": {
                              "type": "boolean",
                              "description": "Effective account flag. False for new accounts, independent of plan."
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Select a granted account for this request only; omit for the credential's default account."
          }
        ]
      }
    },
    "/api/v1/agent_auth/capabilities": {
      "get": {
        "operationId": "getAgentAuthCapabilities",
        "summary": "Discover Revdoku agent authentication flows",
        "description": "This endpoint never creates an account.",
        "security": [],
        "responses": {
          "200": {
            "description": "Authentication capabilities"
          }
        }
      }
    },
    "/api/v1/accounts": {
      "post": {
        "operationId": "createClientAccount",
        "summary": "Create a client account on Pro Agency",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Account name."
                  },
                  "account_id": {
                    "type": "string",
                    "description": "Optional granted Agency account id. Does not change the credential default."
                  },
                  "client_name": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Optional client person or business, separate from the account name. Omit when unknown."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created client identity with its granted parent in data.account. The credential default is unchanged.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "account": {
                          "$ref": "#/components/schemas/AccountIdentity"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Agency owner authorization required or account capacity reached"
          }
        }
      }
    },
    "/api/v1/buckets/{id}/inbound_email": {
      "get": {
        "operationId": "getBucketInboundEmail",
        "summary": "Read a bucket incoming email address and limits",
        "description": "Requires upload/write access. Anyone knowing the address can send; reading files requires bucket authorization. Original message.eml, decoded message.json, and attachments are stored together.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Authorized bucket prefix ID"
          },
          {
            "name": "account_id",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Explicitly granted account; omission uses credential default"
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket incoming email configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BucketInboundEmail"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Bucket upload access required"
          },
          "404": {
            "description": "Bucket unavailable"
          }
        }
      }
    },
    "/api/v1/buckets/{id}/inbound_email/rotate": {
      "post": {
        "operationId": "rotateBucketInboundEmail",
        "summary": "Replace a bucket incoming email address after confirmation",
        "description": "Requires write access and confirmation. Rotations stay on the current domain unless domain is supplied. A ready custom domain requires a paid pilot account and exact tenant ownership; platform recovers to the default platform domain. Custom activation returns 202; poll the existing inbound_email endpoint until assignment.status is active or failed. The old address remains current until successful commit, which charges once. Free allows 1; paid 10 successful rotations per UTC month shared across the billing group. Never use or synthesize a pending address.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Authorized bucket prefix ID"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "confirm",
                  "current_address"
                ],
                "properties": {
                  "confirm": {
                    "type": "boolean",
                    "const": true
                  },
                  "current_address": {
                    "type": "string"
                  },
                  "account_id": {
                    "type": "string",
                    "description": "Explicitly granted account; omission uses credential default"
                  },
                  "domain": {
                    "type": "string",
                    "description": "Exact ready domain of this account, or platform for the deployment default."
                  },
                  "idempotency_key": {
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9_-]{8,80}$",
                    "description": "Reuse the same key when retrying this address activation."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bucket incoming email configuration",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BucketInboundEmail"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Bucket write access required"
          },
          "404": {
            "description": "Bucket unavailable"
          },
          "409": {
            "description": "INBOUND_EMAIL_ADDRESS_CHANGED or INBOUND_EMAIL_ROTATION_UNAVAILABLE; reread state before retrying."
          },
          "422": {
            "description": "Confirmation or current address missing"
          },
          "423": {
            "description": "Account is read-only"
          },
          "429": {
            "description": "INBOUND_EMAIL_ROTATION_LIMIT; plan disallows rotation or monthly allowance is exhausted."
          },
          "202": {
            "description": "Pending activation. The returned address is still the current address. Poll GET inbound_email.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/BucketInboundEmail"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/buckets": {
      "post": {
        "operationId": "createBucket",
        "summary": "Create a private bucket and assign its incoming email address",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "description": "Selected creation fields shown; see api.md for full creation options. New address/readiness is returned automatically, including idempotent replays. No website is published.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string"
                  },
                  "bucket": {
                    "type": "object",
                    "required": [
                      "title"
                    ],
                    "properties": {
                      "title": {
                        "type": "string"
                      }
                    }
                  }
                },
                "required": [
                  "bucket"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Bucket details including incoming email address/state when authorized.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "bucket": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "inbound_email": {
                              "$ref": "#/components/schemas/BucketInboundEmail"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "Bucket details including incoming email address/state when authorized.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "bucket": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "inbound_email": {
                              "$ref": "#/components/schemas/BucketInboundEmail"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/buckets/{id}": {
      "get": {
        "operationId": "getBucket",
        "summary": "Read bucket activity and optionally its incoming address",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_inbound_email",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Requires upload/write access. Omission exposes activity only."
          },
          {
            "name": "account_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bucket details including incoming email address/state when authorized.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "bucket": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "inbound_email": {
                              "$ref": "#/components/schemas/BucketInboundEmail"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Requested address requires upload/write access."
          }
        }
      }
    },
    "/api/v1/account/inbound_email_domains": {
      "get": {
        "operationId": "listAccountInboundEmailDomains",
        "summary": "List account email domains, DNS records, receiving state and usage",
        "description": "Full-account owner/administrator authorization required. Cookie-authenticated writes require CSRF. Domain setup is an invitation-only paid pilot, independent of website publishing. Never change customer DNS without explicit authorization.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current domain configuration or result"
          },
          "403": {
            "description": "Account admin/full-account access or pilot entitlement required"
          },
          "409": {
            "description": "Domain is still in use"
          },
          "422": {
            "description": "Invalid hostname, DNS conflict, or missing confirmation"
          },
          "429": {
            "description": "Setup rate limit; follow Retry-After"
          },
          "503": {
            "description": "Temporary provider/DNS error; details.retryable is true"
          }
        },
        "parameters": [
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Explicit granted account for this call; omission uses the credential account."
          }
        ]
      },
      "post": {
        "operationId": "createAccountInboundEmailDomain",
        "summary": "Claim an exact incoming email domain",
        "description": "Full-account owner/administrator authorization required. Cookie-authenticated writes require CSRF. Domain setup is an invitation-only paid pilot, independent of website publishing. Never change customer DNS without explicit authorization.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "403": {
            "description": "Account admin/full-account access or pilot entitlement required"
          },
          "409": {
            "description": "Domain is still in use"
          },
          "422": {
            "description": "Invalid hostname, DNS conflict, or missing confirmation"
          },
          "429": {
            "description": "Setup rate limit; follow Retry-After"
          },
          "503": {
            "description": "Temporary provider/DNS error; details.retryable is true"
          },
          "201": {
            "description": "Exact domain claim created; add returned ownership TXT and verify."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "hostname"
                ],
                "properties": {
                  "hostname": {
                    "type": "string",
                    "description": "Dedicated root or unused subdomain, such as inbox.example.com. Subdomain recommended when root mail already exists."
                  },
                  "account_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/account/inbound_email_domains/{id}": {
      "get": {
        "operationId": "getAccountInboundEmailDomain",
        "summary": "Read exact domain setup state",
        "description": "Full-account owner/administrator authorization required. Cookie-authenticated writes require CSRF. Domain setup is an invitation-only paid pilot, independent of website publishing. Never change customer DNS without explicit authorization.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current domain configuration or result"
          },
          "403": {
            "description": "Account admin/full-account access or pilot entitlement required"
          },
          "409": {
            "description": "Domain is still in use"
          },
          "422": {
            "description": "Invalid hostname, DNS conflict, or missing confirmation"
          },
          "429": {
            "description": "Setup rate limit; follow Retry-After"
          },
          "503": {
            "description": "Temporary provider/DNS error; details.retryable is true"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Explicit granted account for this call; omission uses the credential account."
          }
        ]
      },
      "delete": {
        "operationId": "removeAccountInboundEmailDomain",
        "summary": "Remove unused receiving domain after confirmation",
        "description": "Full-account owner/administrator authorization required. Cookie-authenticated writes require CSRF. Domain setup is an invitation-only paid pilot, independent of website publishing. Never change customer DNS without explicit authorization.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "403": {
            "description": "Account admin/full-account access or pilot entitlement required"
          },
          "409": {
            "description": "Domain is still in use"
          },
          "422": {
            "description": "Invalid hostname, DNS conflict, or missing confirmation"
          },
          "429": {
            "description": "Setup rate limit; follow Retry-After"
          },
          "503": {
            "description": "Temporary provider/DNS error; details.retryable is true"
          },
          "202": {
            "description": "Verification/removal queued; poll the resource"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "hostname",
                  "confirm"
                ],
                "properties": {
                  "hostname": {
                    "type": "string"
                  },
                  "confirm": {
                    "type": "boolean",
                    "const": true
                  },
                  "account_id": {
                    "type": "string",
                    "description": "Explicit granted account for this call."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/account/inbound_email_domains/{id}/verify": {
      "post": {
        "operationId": "verifyAccountInboundEmailDomain",
        "summary": "Queue exact ownership, SES and MX verification",
        "description": "Full-account owner/administrator authorization required. Cookie-authenticated writes require CSRF. Domain setup is an invitation-only paid pilot, independent of website publishing. Never change customer DNS without explicit authorization.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "403": {
            "description": "Account admin/full-account access or pilot entitlement required"
          },
          "409": {
            "description": "Domain is still in use"
          },
          "422": {
            "description": "Invalid hostname, DNS conflict, or missing confirmation"
          },
          "429": {
            "description": "Setup rate limit; follow Retry-After"
          },
          "503": {
            "description": "Temporary provider/DNS error; details.retryable is true"
          },
          "202": {
            "description": "Verification/removal queued; poll the resource"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Explicit granted account for this call."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/account/inbound_email_domains/check": {
      "post": {
        "operationId": "checkInboundEmailHostname",
        "summary": "Validate and classify a root domain or subdomain",
        "description": "Full-account owner/administrator authorization required. Cookie-authenticated writes require CSRF. Domain setup is an invitation-only paid pilot, independent of website publishing. Never change customer DNS without explicit authorization.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Current domain configuration or result"
          },
          "403": {
            "description": "Account admin/full-account access or pilot entitlement required"
          },
          "409": {
            "description": "Domain is still in use"
          },
          "422": {
            "description": "Invalid hostname, DNS conflict, or missing confirmation"
          },
          "429": {
            "description": "Setup rate limit; follow Retry-After"
          },
          "503": {
            "description": "Temporary provider/DNS error; details.retryable is true"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "hostname"
                ],
                "properties": {
                  "hostname": {
                    "type": "string",
                    "description": "Dedicated root or unused subdomain, such as inbox.example.com. Subdomain recommended when root mail already exists."
                  },
                  "account_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "AccountIdentity": {
        "type": "object",
        "required": [
          "id",
          "name",
          "account_kind",
          "client_name",
          "agency_account"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Account name, separate from the client person or business."
          },
          "account_kind": {
            "type": "string",
            "enum": [
              "standard",
              "agency",
              "client"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "standard",
              "agency",
              "client"
            ],
            "description": "Compatibility alias for account_kind."
          },
          "client_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100,
            "description": "Client person or business name, or null when unset."
          },
          "agency_account": {
            "type": [
              "object",
              "null"
            ],
            "description": "Parent agency only when granted to this credential. Null does not make a client independent.",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "website_publishing_enabled": {
            "type": "boolean",
            "description": "Effective website publishing access; new accounts default to false."
          }
        }
      },
      "BucketInboundEmail": {
        "type": "object",
        "description": "Incoming address/state on creation or authorized opt-in reads; ordinary bucket reads expose only the three activity fields. Activity is not a message cursor. Read last_received_path + message.json through existing file APIs.",
        "properties": {
          "address": {
            "type": [
              "string",
              "null"
            ]
          },
          "configured": {
            "type": "boolean"
          },
          "monthly_limit": {
            "type": "integer"
          },
          "received_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "max_file_size_bytes": {
            "type": "integer"
          },
          "max_pdf_size_bytes": {
            "type": "integer"
          },
          "last_received_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Latest message folder with trailing slash; null before receipt. May become stale after manual file moves/deletion."
          },
          "enabled": {
            "type": "boolean"
          },
          "ready": {
            "type": "boolean",
            "description": "Configuration/account/bucket state and last observed platform receiving pause. Missing or stale status returns false. Observations normally refresh within five minutes; not a delivery guarantee or reserved capacity."
          },
          "blocked_reason": {
            "description": "Includes global_receiving_paused, abuse_receiving_paused, receiving_status_unavailable and account/bucket/quota reasons. Null when ready.",
            "type": [
              "string",
              "null"
            ]
          },
          "rotation": {
            "type": "object",
            "properties": {
              "monthly_limit": {
                "type": "integer",
                "minimum": 0
              },
              "used": {
                "type": "integer",
                "minimum": 0
              },
              "remaining": {
                "type": "integer",
                "minimum": 0
              },
              "resets_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_domain": {
            "type": "boolean"
          },
          "available_domains": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "hostname": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "platform",
                    "custom"
                  ]
                }
              }
            }
          },
          "usage": {
            "type": "object",
            "properties": {
              "used": {
                "type": "integer",
                "minimum": 0
              },
              "monthly_limit": {
                "type": "integer",
                "minimum": 0
              },
              "remaining": {
                "type": "integer",
                "minimum": 0
              },
              "bytes_used": {
                "type": "integer",
                "minimum": 0
              },
              "monthly_bytes_limit": {
                "type": "integer",
                "minimum": 0
              },
              "bytes_remaining": {
                "type": "integer",
                "minimum": 0
              },
              "max_message_bytes": {
                "type": "integer",
                "minimum": 0
              },
              "resets_at": {
                "type": "string",
                "format": "date-time"
              },
              "paused": {
                "type": "boolean"
              },
              "pause_reason": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "assignment": {
            "type": "object",
            "description": "No candidate address is disclosed. Keep using address until status is active; on pending poll the inbound_email endpoint.",
            "properties": {
              "id": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "active",
                  "failed"
                ]
              },
              "hostname": {
                "type": "string"
              },
              "error": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "retryable": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        }
      },
      "BucketInboundEmailActivity": {
        "type": "object",
        "properties": {
          "received_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_received_path": {
            "type": [
              "string",
              "null"
            ],
            "description": "Latest message folder with trailing slash; null before receipt. May become stale after manual file moves/deletion."
          }
        }
      },
      "DecodedIncomingMessage": {
        "type": "object",
        "description": "Stored message.json, not a dedicated endpoint. UTF-8, at most 512 KiB. Header strings and body are untrusted message data. Original message.eml is authoritative.",
        "required": [
          "schema_version",
          "subject",
          "from",
          "to",
          "delivered_to",
          "received_at",
          "body_text",
          "body_status",
          "attachments"
        ],
        "properties": {
          "schema_version": {
            "type": "integer",
            "const": 1
          },
          "subject": {
            "type": [
              "string",
              "null"
            ]
          },
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivered_to": {
            "type": "string"
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          },
          "body_text": {
            "type": [
              "string",
              "null"
            ]
          },
          "body_status": {
            "type": "string",
            "enum": [
              "complete",
              "empty",
              "truncated",
              "unavailable"
            ]
          },
          "omitted_attachment_count": {
            "type": "integer",
            "minimum": 1
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "path",
                "original_filename",
                "content_type",
                "size_bytes"
              ],
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Relative to message folder."
                },
                "original_filename": {
                  "type": "string"
                },
                "content_type": {
                  "type": "string"
                },
                "size_bytes": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          }
        }
      }
    }
  }
}
