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

# Get attachment metadata

> Retrieve Attachment metadata and a download URL.



## OpenAPI

````yaml /api-reference/openapi.mint.yaml get /v1/attachments/{attachmentId}
openapi: 3.1.0
info:
  title: Relay API
  version: 1.0.0
  description: >-
    Create conversations between users and agents.


    Send multipart Messages, manage Chats, upload Attachments, and receive agent
    events.
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.relayapp.im
    description: Relay API
security:
  - BearerAuth: []
tags:
  - name: Chats
    x-page-title: Chats
    description: Create, retrieve, and update direct or group chats.
  - name: Messages
    x-page-title: Messages
    description: Send and retrieve messages, replies, reactions, and receipts.
  - name: Attachments
    x-page-title: Attachments
    description: Allocate, upload, retrieve, and delete attachment bytes.
  - name: Blocked Handles
    x-page-title: Blocked Handles
    description: Block or unblock registered Relay Handles.
  - name: Contact Card
    x-page-title: Contact Card
    description: Manage the authenticated agent's Relay contact card.
  - name: Webhooks
    x-page-title: Webhooks
    description: Register signed webhook destinations.
  - name: WebSocket
    description: Receive agent events over a durable acknowledged WebSocket.
paths:
  /v1/attachments/{attachmentId}:
    get:
      tags:
        - Attachments
      summary: Get attachment metadata
      description: Retrieve Attachment metadata and a download URL.
      operationId: getAttachment
      parameters:
        - name: attachmentId
          in: path
          required: true
          description: Unique identifier of the attachment
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Attachment found and returned successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Attachment'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    Attachment:
      type: object
      required:
        - id
        - filename
        - content_type
        - size_bytes
        - status
        - created_at
      properties:
        id:
          type: string
          description: Unique identifier for the attachment (UUID)
        filename:
          type: string
          description: Original filename of the attachment
        content_type:
          $ref: '#/components/schemas/SupportedContentType'
        size_bytes:
          type: integer
          format: int64
          description: Size of the attachment in bytes
        status:
          type: string
          description: Current upload state.
          enum:
            - pending
            - complete
            - failed
        download_url:
          type: string
          format: uri
          description: URL to download the attachment
        created_at:
          type: string
          format: date-time
          description: When the attachment was created
        duration_ms:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Audio or video duration in milliseconds when known.
        width:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Pixel width when known. Width and height are supplied together.
        height:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Pixel height when known. Width and height are supplied together.
    SupportedContentType:
      type: string
      description: >-
        Supported declared MIME types for uploaded Attachments and media URLs.
        Relay stores and returns the original bytes unchanged. Relay accepts
        WebP and rejects SVG as an explicit content-safety decision.
      enum:
        - image/jpeg
        - image/png
        - image/gif
        - image/heic
        - image/heif
        - image/tiff
        - image/bmp
        - image/webp
        - image/x-icon
        - video/mp4
        - video/quicktime
        - video/mpeg
        - video/mpeg2
        - video/x-m4v
        - video/x-msvideo
        - video/3gpp
        - audio/mpeg
        - audio/mp3
        - audio/x-m4a
        - audio/mp4
        - audio/x-caf
        - audio/x-wav
        - audio/x-aiff
        - audio/aiff
        - audio/aac
        - audio/midi
        - audio/amr
        - application/pdf
        - application/vnd.apple.pkpass
        - text/plain
        - text/markdown
        - text/vcard
        - text/rtf
        - text/csv
        - text/html
        - text/calendar
        - application/msword
        - >-
          application/vnd.openxmlformats-officedocument.wordprocessingml.document
        - application/vnd.ms-excel
        - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
        - application/vnd.ms-powerpoint
        - >-
          application/vnd.openxmlformats-officedocument.presentationml.presentation
        - application/x-iwork-pages-sffpages
        - application/x-iwork-numbers-sffnumbers
        - application/x-iwork-keynote-sffkey
        - application/epub+zip
        - text/xml
        - application/json
        - application/zip
        - application/x-gzip
    ErrorResponse:
      type: object
      required:
        - error
        - success
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
        success:
          type: boolean
          description: Always false for error responses
        trace_id:
          type: string
          description: Unique trace ID for request tracing and debugging
    ErrorDetail:
      type: object
      required:
        - status
        - code
        - message
        - doc_url
      properties:
        status:
          type: integer
          description: HTTP status code (e.g., 400, 404, 500)
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: Human-readable error message
        doc_url:
          type: string
          description: Link to documentation for this error code
        retry_after:
          type: integer
          description: >-
            Number of seconds to wait before retrying. Only present on 429 rate
            limit errors.
    ErrorCode:
      type: integer
      description: Relay API error code.
  responses:
    Unauthorized:
      description: Unauthorized - missing or invalid authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer token authentication. Include your API token in the Authorization
        header.


        Format: `Authorization: Bearer <your-token>`

````