Creates a new folder in the media storage
POST https://services.leadconnectorhq.com/medias/folder
Authorization
Body
Responses
200 - Returns the newly created folder object
altId (string, required): Account identifier that owns this folder Example: sx6wyHhbFdRXh302LLNR
altType (string, required): Type of entity that owns the folder Possible values: 'account' Example: account
name (string, required): Name of the folder Example: New Folder
parentId (string): ID of the parent folder (null for root folders) Example: 64af50c42d567a3b4f5989e0
type (string, required): Type of the object (always 'folder' for folders) Example: folder
deleted (boolean): Whether the folder has been deleted Example: False
pendingUpload (boolean): Whether there are pending uploads to this folder Example: False
category (string): Primary category of content stored in the folder Example: image
subCategory (string): Sub-category of content stored in the folder Example: logo
isPrivate (boolean): Whether the folder is private and not publicly accessible Example: False
relocatedFolder (boolean): Whether the folder has been moved from its original account Example: False
migrationCompleted (boolean): Whether the data migration process has been completed for this folder Example: True
appFolder (boolean): Whether this is a system-generated application folder Example: False
isEssential (boolean): Whether the folder is essential and should not be deleted Example: False
status (string): Current status of the folder
lastUpdatedBy (string): ID of the user who last updated the folder Example: user-uuid-123
{
"altId": "sx6wyHhbFdRXh302LLNR",
"altType": "account",
"name": "New Folder",
"parentId": "64af50c42d567a3b4f5989e0",
"type": "folder",
"deleted": false,
"pendingUpload": false,
"category": "image",
"subCategory": "logo",
"isPrivate": false,
"relocatedFolder": false,
"migrationCompleted": true,
"appFolder": false,
"isEssential": false,
"status": "string",
"lastUpdatedBy": "user-uuid-123"
}
Example
curl -X POST 'https://services.leadconnectorhq.com/medias/folder' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "sx6wyHhbFdRXh302LLNR",
"altType": "account",
"name": "New Folder",
"parentId": "64af50c42d567a3b4f5989e0"
}'
const response = await fetch('https://services.leadconnectorhq.com/medias/folder', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "sx6wyHhbFdRXh302LLNR", "altType": "account", "name": "New Folder", "parentId": "64af50c42d567a3b4f5989e0"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/medias/folder',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "sx6wyHhbFdRXh302LLNR", "altType": "account", "name": "New Folder", "parentId": "64af50c42d567a3b4f5989e0"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/medias/folder');
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({'altId': 'sx6wyHhbFdRXh302LLNR', 'altType': 'account', 'name': 'New Folder', 'parentId': '64af50c42d567a3b4f5989e0'}),
]);
$data = json_decode(curl_exec($ch), true);