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

# Convert File

> Convert a file to a different format

## Overview

Requests a server-side conversion of a file to a different format (e.g., JPEG to PNG, DOCX to PDF).

## Query Parameters

<ParamField query="workspaceId" type="integer">
  Workspace context
</ParamField>

## Request Body

<ParamField body="url" type="string" required>
  Source URL of the file to convert
</ParamField>

<ParamField body="filename" type="string" required>
  Original filename
</ParamField>

<ParamField body="outputformat" type="string" required>
  Desired output format (e.g., `png`, `pdf`, `jpg`)
</ParamField>

## Response

Returns the converted file or a success status depending on the conversion type.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://app.drime.cloud/api/v1/entry/convert?workspaceId=0" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "url": "https://storage.example.com/file.jpeg",
      "filename": "photo.jpeg",
      "outputformat": "png"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://app.drime.cloud/api/v1/entry/convert?workspaceId=0',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        url: 'https://storage.example.com/file.jpeg',
        filename: 'photo.jpeg',
        outputformat: 'png'
      })
    }
  );

  const data = await response.json();
  ```

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

  response = requests.post(
      'https://app.drime.cloud/api/v1/entry/convert',
      params={'workspaceId': 0},
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'url': 'https://storage.example.com/file.jpeg',
          'filename': 'photo.jpeg',
          'outputformat': 'png'
      }
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": "success",
    "fileEntry": {
      "id": 123456,
      "name": "photo.png",
      "type": "image",
      "mime": "image/png"
    }
  }
  ```
</ResponseExample>

<Note>
  Supported conversions depend on the file type. Common conversions include image format changes and document to PDF.
</Note>
