openmail-sh Attachments API

Downloading and extracting text from attachments

Operations 2

GET /v1/attachments/{messageId}/{filename} Download attachment #
GET /v1/attachments/{messageId}/{filename}/text Extract attachment text #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/openmail-sh:openmail-sh-attachments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

openmail-sh-attachments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenMail Attachments API
  description: Email infrastructure API for AI agents. Create inboxes, send and receive email, and get real-time notifications via webhooks.
  version: 1.0.0
  license:
    name: Proprietary
servers:
- url: https://api.openmail.sh
security:
- bearerAuth: []
tags:
- name: Attachments
  description: Downloading and extracting text from attachments
paths:
  /v1/attachments/{messageId}/{filename}:
    get:
      operationId: getAttachment
      summary: Download attachment
      tags:
      - Attachments
      description: 'Returns the attachment bytes. Authenticate with `Authorization: Bearer `. The response is the file itself (not a redirect), so clients can fetch the URL from `attachments[].url` with the same API key they use for the rest of the API.'
      parameters:
      - schema:
          type: string
        in: path
        name: messageId
        required: true
      - schema:
          type: string
        in: path
        name: filename
        required: true
      responses:
        '200':
          description: Attachment file bytes
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: Attachment not found
          content:
            application/json:
              schema:
                description: Attachment not found
                allOf:
                - $ref: '#/components/schemas/Error'
  /v1/attachments/{messageId}/{filename}/text:
    get:
      operationId: getAttachmentText
      summary: Extract attachment text
      tags:
      - Attachments
      description: Extracts and returns the plain text content of an attachment. Supports PDF, DOCX, XLSX, PPTX, images (via OCR), and other common formats. The result is cached on the message after the first extraction.
      parameters:
      - schema:
          type: string
        in: path
        name: messageId
        required: true
      - schema:
          type: string
        in: path
        name: filename
        required: true
      responses:
        '200':
          description: Extracted text content
          content:
            application/json:
              schema:
                description: Extracted text content
                type: object
                additionalProperties: true
                properties:
                  filename:
                    type: string
                  inboxId:
                    type: string
                    description: Inbox the parent message belongs to
                  contentType:
                    type: string
                  extractionMethod:
                    type: string
                    description: Method used to extract text (e.g. pdf, docx, ocr)
                  text:
                    type: string
        '404':
          description: Attachment not found
          content:
            application/json:
              schema:
                description: Attachment not found
                allOf:
                - $ref: '#/components/schemas/Error'
        '422':
          description: Text could not be extracted from the attachment
          content:
            application/json:
              schema:
                description: Text could not be extracted from the attachment
                allOf:
                - $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      additionalProperties: true
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key