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

# Get Media

> Retrieve a media file by ID

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer qwoty_your_token`
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the media file
</ParamField>

## Response

This endpoint returns a redirect (302) to the actual media file URL. The file can be directly accessed or embedded.

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://qwoty.app/api/medias/media_123abc \
    --location
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://qwoty.app/api/medias/media_123abc', {
    redirect: 'follow',
  })

  // Get the final URL after redirect
  const mediaUrl = response.url
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://qwoty.app/api/medias/media_123abc',
      allow_redirects=True
  )

  # Get the final URL
  media_url = response.url
  ```

  ```html HTML theme={null}
  <!-- Direct embedding -->
  <img src="https://qwoty.app/api/medias/media_123abc" alt="Media" />
  ```
</RequestExample>

<ResponseExample>
  ```json 302 theme={null}
  {
    "Location": "https://storage.qwoty.io/files/abc123..."
  }
  ```

  ```json 400 theme={null}
  {
    "error": "Media ID is required"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Media not found"
  }
  ```
</ResponseExample>

<Note>
  The media URL is temporary and may expire. Always use the API endpoint to
  retrieve the current URL.
</Note>
