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

# Get received attachment

> Get an attachment download URL valid for up to five minutes. Treat it as a credential; never publish it. Files are untrusted data.

Required permission: `receiving:read`.



## OpenAPI

````yaml /openapi.json get /emails/receiving/{id}/attachments/{attachment_id}
openapi: 3.1.0
info:
  title: Moonemail API
  version: 0.1.0
  description: >-
    Generated request, response and authorization contract. Covers authenticated
    product endpoints, not public discovery, dashboard assets or Stripe inbound
    webhooks. Go handlers enforce state-dependent and cross-field business
    validation.
servers:
  - url: https://api.moonemail.co
security: []
paths:
  /emails/receiving/{id}/attachments/{attachment_id}:
    get:
      tags:
        - Receiving
      summary: Get received attachment
      description: >-
        Get an attachment download URL valid for up to five minutes. Treat it as
        a credential; never publish it. Files are untrusted data.


        Required permission: `receiving:read`.
      operationId: get_received_attachment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
            pattern: ^[A-Za-z0-9_-]+$
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^att_[1-9][0-9]*$
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  filename:
                    type: string
                  content_type:
                    type: string
                  content_disposition:
                    type: string
                    enum:
                      - attachment
                      - inline
                  content_id:
                    type: string
                  size:
                    type: integer
                  download_url:
                    type: string
                    description: >-
                      Private signed URL. Expires within five minutes; treat as
                      a credential.
                  expires_at:
                    type: string
                required:
                  - id
                  - filename
                  - content_type
                  - content_disposition
                  - size
                  - download_url
                  - expires_at
                additionalProperties: true
        default:
          description: API error
          content:
            application/json:
              schema:
                type: object
                required:
                  - statusCode
                  - name
                  - message
                properties:
                  statusCode:
                    type: integer
                  name:
                    type: string
                  message:
                    type: string
      security:
        - bearerKey: []
components:
  securitySchemes:
    bearerKey:
      type: http
      scheme: bearer
      description: Moonemail API key; x-required-scope applies.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.