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

# Update File/ Folder

> Updates a single file or folder by ID

Updates a single file or folder by ID

```http theme={null}
POST https://services.leadconnectorhq.com/medias/{id}
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="id" type="string" required default="686f9817f0d3165be9fbcef6">
  Unique identifier of the file or folder to update
</ParamField>

## Body

<ParamField body="name" type="string" required default="Updated File Name.pdf">
  New name for the file or folder
</ParamField>

<ParamField body="altType" type="string" required default="account">
  Type of entity that owns the file or folder Posibles valores: 'account'
</ParamField>

<ParamField body="altId" type="string" required default="sx6wyHhbFdRXh302LLNR">
  Account identifier that owns the file or folder
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  ```json theme={null}
  {
    "updated": true,
    "traceId": "33a641a2-c4a6-4123-aa82-c5b84f1a14ee"
  }
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST 'https://services.leadconnectorhq.com/medias/YOUR_id' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "name": "Updated File Name.pdf",
    "altType": "account",
    "altId": "sx6wyHhbFdRXh302LLNR"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/medias/YOUR_id', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"name": "Updated File Name.pdf", "altType": "account", "altId": "sx6wyHhbFdRXh302LLNR"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'POST',
      'https://services.leadconnectorhq.com/medias/YOUR_id',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"name": "Updated File Name.pdf", "altType": "account", "altId": "sx6wyHhbFdRXh302LLNR"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/medias/YOUR_id');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'POST',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'name': 'Updated File Name.pdf', 'altType': 'account', 'altId': 'sx6wyHhbFdRXh302LLNR'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
