> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openmail.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Get attachment

> Returns a 302 redirect to a signed URL for the attachment.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/attachments/{messageId}/{filename}
openapi: 3.0.3
info:
  title: OpenMail 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: pods
    description: Isolated sub-accounts for your end users or tenants
  - name: inboxes
    description: Email inboxes and their webhook configuration
  - name: messages
    description: Sending and listing messages
  - name: threads
    description: Conversation threads and read status
  - name: attachments
    description: Downloading and extracting text from attachments
paths:
  /v1/attachments/{messageId}/{filename}:
    get:
      tags:
        - attachments
      summary: Get attachment
      description: Returns a 302 redirect to a signed URL for the attachment.
      operationId: getAttachment
      parameters:
        - schema:
            type: string
          in: path
          name: messageId
          required: true
        - schema:
            type: string
          in: path
          name: filename
          required: true
      responses:
        '302':
          description: Redirect to attachment URL
        '404':
          description: Attachment not found
          content:
            application/json:
              schema:
                description: Attachment not found
                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

````