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

# Download media (Meta)

> Downloads a Meta Cloud API media by mediaId (e.g. from an inbound webhook) and returns it as a base64 data URI + mimeType. Requires the phoneNumberId query param (a tenant Meta number's metaPhoneId). Requires a number-scoped key.

**Requires a number-scoped key.**



## OpenAPI

````yaml openapi.json GET /v1/media/{mediaId}
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/media/{mediaId}:
    get:
      tags:
        - Media
      summary: Download media (Meta)
      description: >-
        Downloads a Meta Cloud API media by mediaId (e.g. from an inbound
        webhook) and returns it as a base64 data URI + mimeType. Requires the
        phoneNumberId query param (a tenant Meta number's metaPhoneId). Requires
        a number-scoped key.


        **Requires a number-scoped key.**
      operationId: get_media_mediaId
      parameters:
        - name: mediaId
          in: path
          required: true
          description: Meta Cloud API media id.
          schema:
            type: string
          example: '1234567890123456'
        - name: phoneNumberId
          in: query
          required: true
          description: metaPhoneId of a tenant Meta number.
          schema:
            type: string
          example: '123456789012345'
      responses:
        '200':
          description: Download media
          content:
            application/json:
              example:
                base64: data:image/jpeg;base64,/9j/4AAQSkZJRg...
                mimeType: image/jpeg
                fileName: photo.jpg
                mediaId: '1234567890123456'
        '400':
          description: Invalid payload or parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Validation error
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: Tenant-scoped key used on a number-scoped endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Tenant-scoped keys cannot call number endpoints
                code: TENANT_SCOPE_NOT_ALLOWED
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````