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

# Bulk Update Files/ Folders

> Updates metadata or status of multiple files and folders

Updates metadata or status of multiple files and folders

```http theme={null}
PUT https://services.leadconnectorhq.com/medias/update-files
```

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

## Body

<ParamField body="altId" type="string" required default="sx6wyHhbFdRXh302LLNR">
  Account identifier
</ParamField>

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

<ParamField body="filesToBeUpdated" type="object[]" required>
  Array of file objects to be updated

  <Expandable title="cada item">
    <ParamField body="id" type="string" required default="686f9817f0d3165be9fbcef6">
      Unique identifier of the file or folder to be updated
    </ParamField>

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

## Respuestas

<Accordion title="200 - Successful response">
  ```json theme={null}
  [
    {
      "updated": true,
      "id": "686f9817f0d3165be9fbcef6"
    }
  ]
  ```
</Accordion>

## Ejemplo

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

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

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

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