Updates a single file or folder by ID
http
POST https://services.leadconnectorhq.com/medias/{id}Authorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
id | string | Yes | 686f9817f0d3165be9fbcef6 | Unique identifier of the file or folder to update |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
name | string | Yes | Updated File Name.pdf | New name for the file or folder |
altType | string | Yes | account | Type of entity that owns the file or folder Possible values: 'account' |
altId | string | Yes | sx6wyHhbFdRXh302LLNR | Account identifier that owns the file or folder |
Responses
200 - Successful response
json
{
"updated": true,
"traceId": "33a641a2-c4a6-4123-aa82-c5b84f1a14ee"
}Example
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"
}'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();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
$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);