> ## 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.

# Get presigned media URL

> Resolves a media record by `id` and returns a temporary presigned download URL along with the media metadata.



## OpenAPI

````yaml openapi.evolution-v2.json POST /s3/getMediaUrl/{instance}
openapi: 3.1.0
info:
  title: Evolution V2 Layer
  version: 1.0.0
  description: >-
    Pilot Status API Layer — Evolution V2. Base URL
    `https://pilotstatus.com.br/api/layer/evolution-v2`. Authenticate with the
    `apikey` header (your Pilot Status `ps_` key). Instance/session endpoints
    are NOT available through the layer.
servers:
  - url: https://pilotstatus.com.br/api/layer/evolution-v2
security:
  - apiKey: []
tags:
  - name: Call & Business
  - name: Chat
  - name: Group
  - name: Label
  - name: Message
  - name: Profile
  - name: Settings & Proxy
  - name: Storage (S3)
  - name: Template
paths:
  /s3/getMediaUrl/{instance}:
    post:
      tags:
        - Storage (S3)
      summary: Get presigned media URL
      description: >-
        Resolves a media record by `id` and returns a temporary presigned
        download URL along with the media metadata.
      operationId: post__s3_getMediaUrl_instance
      parameters:
        - name: instance
          in: path
          required: true
          schema:
            type: string
          description: The number's display name in the Pilot Status dashboard.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: Media record identifier (numeric string).
                  example: '12345'
                expiry:
                  type: string
                  description: >-
                    Lifetime of the presigned URL, in seconds (numeric string,
                    e.g. `"3600"`).
                  example: '3600'
              required:
                - id
      responses:
        '200':
          description: Success — provider-native response body.
          content:
            application/json:
              schema:
                type: object
                description: >-
                  A single media record plus a freshly generated presigned URL
                  for downloading the object from S3/MinIO.
                properties:
                  mediaUrl:
                    type: string
                    description: >-
                      Presigned URL to download the stored media object (valid
                      for the requested expiry, in seconds).
                  id:
                    type: string
                    description: Media record id (cuid).
                  fileName:
                    type: string
                    description: >-
                      Object key / path of the file stored in the S3/MinIO
                      bucket.
                  type:
                    type: string
                    description: >-
                      Media category (e.g. image, video, audio, document,
                      sticker).
                  mimetype:
                    type: string
                    description: MIME type of the stored file.
                  createdAt:
                    type: string
                    format: date-time
                    description: Date the media record was created.
                  Message:
                    type: object
                    description: The Message this media belongs to.
                    properties:
                      id:
                        type: string
                        description: Message record id (cuid).
                      key:
                        type: object
                        description: Baileys message key.
                        properties:
                          remoteJid:
                            type: string
                          fromMe:
                            type: boolean
                          id:
                            type: string
                          participant:
                            type: string
                      pushName:
                        type:
                          - string
                          - 'null'
                      participant:
                        type:
                          - string
                          - 'null'
                      messageType:
                        type: string
                        description: >-
                          Type of message (e.g. imageMessage, videoMessage,
                          audioMessage, documentMessage).
                      message:
                        type: object
                        description: Raw Baileys message content object.
                        additionalProperties: true
                      contextInfo:
                        type:
                          - object
                          - 'null'
                        additionalProperties: true
                      source:
                        type: string
                        enum:
                          - android
                          - ios
                          - web
                          - unknown
                          - desktop
                      messageTimestamp:
                        type: integer
                        description: Unix epoch (seconds) of the message.
                      chatwootMessageId:
                        type:
                          - integer
                          - 'null'
                      chatwootInboxId:
                        type:
                          - integer
                          - 'null'
                      chatwootConversationId:
                        type:
                          - integer
                          - 'null'
                      chatwootContactInboxSourceId:
                        type:
                          - string
                          - 'null'
                      chatwootIsRead:
                        type:
                          - boolean
                          - 'null'
                      instanceId:
                        type: string
                      webhookUrl:
                        type:
                          - string
                          - 'null'
                      status:
                        type:
                          - string
                          - 'null'
                      sessionId:
                        type:
                          - string
                          - 'null'
              example:
                mediaUrl: >-
                  https://s3.pilotstatus.com.br/evolution/evolution-instance/5511999999999@s.whatsapp.net/3EB0F8A1C2D3E4F5A6B7.jpeg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=EVOACCESSKEY%2F20260709%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260709T000000Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=4c1f0b2a9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c1d0e9f8a7b6c5d4e3f2a
                id: clyz9k3m10001x8a1b2c3d4e5
                fileName: >-
                  evolution-instance/5511999999999@s.whatsapp.net/3EB0F8A1C2D3E4F5A6B7.jpeg
                type: image
                mimetype: image/jpeg
                createdAt: '2026-07-09T00:00:00.000Z'
                Message:
                  id: clyz9k3m10000x8a1a0b1c2d3
                  key:
                    id: 3EB0F8A1C2D3E4F5A6B7
                    remoteJid: 5511999999999@s.whatsapp.net
                    fromMe: false
                  pushName: João Silva
                  participant: null
                  messageType: imageMessage
                  message:
                    imageMessage:
                      url: https://mmg.whatsapp.net/v/t62.7118-24/enc.jpg
                      mimetype: image/jpeg
                      caption: Segue a foto do produto
                      fileLength: '84213'
                      height: 1280
                      width: 720
                  contextInfo: null
                  source: android
                  messageTimestamp: 1752019200
                  chatwootMessageId: null
                  chatwootInboxId: null
                  chatwootConversationId: null
                  chatwootContactInboxSourceId: null
                  chatwootIsRead: null
                  instanceId: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  webhookUrl: null
                  status: DELIVERY_ACK
                  sessionId: null
        default:
          description: Error — provider or layer error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                  error:
                    type: string
                  message:
                    type: string
                  response:
                    type: object
              example:
                status: 400
                error: Bad Request
                message: Invalid payload
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: >-
        Your Pilot Status API key (ps_...). Evolution GO also accepts
        `Authorization: Bearer <key>`.

````