GET · Bearer

GET /api/v1/inboxes/:id/messages/:msgId/attachments/:attId/text

Summary

Extract attachment text as text/plain; charset=utf-8. Content-Disposition is attachment, because this body is not a passive image, audio, or video type. The filename drops quotes, CR, LF, other control characters, and path separators, and a non-ASCII name also sets filename* (RFC 5987 UTF-8). The response sets X-Content-Type-Options: nosniff, Content-Security-Policy: default-src 'none'; sandbox; frame-ancestors 'none', X-Frame-Options: DENY, and Referrer-Policy: no-referrer. Cache-Control is private. There is no Cross-Origin-Resource-Policy header. Supported types are text/*, JSON, CSV, PDF (text layer), DOCX, XLSX, and XLS. The input cap is 10 MB (400 attachment_too_large). A DOCX or spreadsheet whose inflated bytes expand past 50 MB, whose compression ratio is over 100, or that declares more than 10,000 rows by 256 columns is 400 attachment_too_large. The inflated size is measured from the bytes, a lying central directory does not bypass the check, and a zip is checked even when the declared type is the legacy spreadsheet type. A file that cannot be read is 400 text_extraction_failed. Extraction stops after 10 seconds. The output cap is 200,000 characters, and a longer result sets x-cooper-text-truncated: 1. An image-only PDF returns HTTP 200 with an empty body and x-cooper-text-empty: 1. An unsupported type returns HTTP 415 text_extraction_unsupported. Successful and failed extractions are cached, and a failed cache hit returns the same error. Attachment metadata includes text_url when the type is supported. A held message returns HTTP 409 message_held until release. Another account's attachment is 404.

Request

GET /api/v1/inboxes/inb_example/messages/msg_example/attachments/att_example/text

Response

The OpenAPI document does not declare a JSON response schema for this call. The summary is the contract.

Errors

  • HTTP 400 attachment_too_large
  • HTTP 400 text_extraction_failed
  • HTTP 415 text_extraction_unsupported
  • HTTP 409 message_held

Idempotency

This route does not document Idempotency-Key or client_id.