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

# Download stored media

> Downloads a stored media file.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/media-storage.yml get /media/{media_name}/download
openapi: 3.1.0
info:
  title: Telnyx Media Storage API
  version: 2.0.0
  description: API for Media storage.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /media/{media_name}/download:
    get:
      tags:
        - Media Storage API
      summary: Download stored media
      description: Downloads a stored media file.
      operationId: DownloadMedia
      parameters:
        - $ref: '#/components/parameters/MediaName'
      responses:
        '200':
          $ref: '#/components/responses/MediaDownloadResponse'
        '401':
          $ref: '#/components/responses/media-storage_GenericErrorResponse'
        '404':
          $ref: '#/components/responses/media-storage_GenericErrorResponse'
        '422':
          $ref: '#/components/responses/media-storage_GenericErrorResponse'
        default:
          $ref: '#/components/responses/media-storage_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.media.download('media_name');

            console.log(response);

            const content = await response.blob();
            console.log(content);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.media.download(
                "media_name",
            )
            print(response)
            content = response.read()
            print(content)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.Media.Download(context.TODO(), \"media_name\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.core.http.HttpResponse;
            import com.telnyx.sdk.models.media.MediaDownloadParams;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    HttpResponse response = client.media().download("media_name");
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            response = telnyx.media.download("media_name")

            puts(response)
        - lang: CLI
          source: |-
            telnyx media download \
              --api-key 'My API Key' \
              --media-name media_name
components:
  parameters:
    MediaName:
      name: media_name
      description: Uniquely identifies a media resource.
      in: path
      required: true
      schema:
        type: string
  responses:
    MediaDownloadResponse:
      description: A response describing a media resource
      content:
        application/octet-stream:
          schema:
            type: string
            format: binary
    media-storage_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/media-storage_Errors'
  schemas:
    media-storage_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/media-storage_Error'
      type: object
    media-storage_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````