The /folder
endpoint of the Disguise Cloud Drive API allows you to create a new folder within a specified drive and parent folder. A folder represents a directory within a drive that can contain files and other folders.
A successful response from the /folder
endpoint will be the same as the Content endpoint, but without the pagination wrapper.
Field | Type | Description |
---|---|---|
id | string | The unique identifier of the content. |
drive_id | string | The unique identifier of the drive. |
parent_id | string | The unique identifier of the parent content, if applicable. Root folders will be the only piece of content that is missing this field. |
name | string | The name of the content. |
versions | array | A list of versions of the content. See the Versions table for more information. |
is_locked | boolean | Whether the content is locked. When locked, the content can not be updated or deleted. |
locked_by_id | string | The unique identifier of the user who locked the content, if applicable. |
uploaded_by_id | string | The unique identifier of the user who uploaded the content, if applicable. |
url | string | The URL of the content, if applicable. |
format | string | The format of the content, if applicable. |
thumbnail | string | The URL of the thumbnail image of the content, if applicable. |
thumbnail_tiny | string | The URL of the tiny thumbnail image of the content, if applicable. |
type | string | The type of the content (e.g., folder , file , image , scene , video , previz ). |
length | integer | The length of the content, if applicable. |
width | integer | The width of the content, if applicable. |
height | integer | The height of the content, if applicable. |
dimensions | string | The dimensions of the content, if applicable. |
size_bytes | integer | The size of the content in bytes. For folders, this will be the total size of all content in the folder. |
status | string | The status of the content (e.g., pending , ready ). Refers to if the content has been finished processing (such as video encoding). |
meta | object | Additional metadata about the content, if applicable. Data structure is not guaranteed. |
file_extension | string | The file extension of the content, if applicable. |
is_shared | boolean | Whether the content is shared. |
share_slug | string | The share slug of the content, if applicable. Only applies if the content was shared previously. |
share_url | string | The share URL of the content, if applicable. Only applies if the content was shared previously. |
description | string | The description of the content, if applicable. |
created_at | datetime | The date and time when the content was created. |
updated_at | datetime | The date and time when the content was last updated. |
children | array | A list of child content items see the Children table for more information. |
curl -X POST https://drive-api.disguise.cloud/v1/drives/{{drive_id}}/content/{{content_id}}/folder \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My Folder"
}'
A successful response will return a 201 Created
with the following JSON:
{
"id": "1cb5e233-908b-4799-80d7-943b86d3916c",
"drive_id": "3b5b9cab-073d-416a-bcf1-f2b3154fb0ee",
"parent_id": null,
"name": "My Folder",
"versions": [],
"is_locked": false,
"locked_by_id": null,
"uploaded_by_id": null,
"url": null,
"format": null,
"thumbnail": null,
"thumbnail_tiny": null,
"type": "folder",
"length": null,
"width": null,
"height": null,
"dimensions": null,
"size_bytes": 0,
"status": "pending",
"meta": null,
"file_extension": null,
"is_shared": false,
"share_slug": null,
"share_url": null,
"description": null,
"created_at": "2024-11-27T21:05:01.000000Z",
"updated_at": "2024-11-27T21:05:01.000000Z",
"children": []
}
If the drive is not found, the API will return a 404 Not Found
status code and the following JSON:
{
"error": {
"message": "Drive not found",
"details": "Drive not found"
}
}
If the parent folder is not found, the API will return a 404 Not Found
status code and the following JSON:
{
"error": {
"message": "Parent folder not found",
"details": "Parent folder not found"
}
}
If you try to create a folder not inside another folder, the API will return a 400 Bad Request
status code and the following JSON:
{
"error": {
"message": "Cannot upload to selected location",
"details": "Parent asset is not a folder"
}
}
The following parameters can be used with the /folder
endpoint for POST requests:
Parameter | Type | Description |
---|---|---|
name | string | The name of the folder to be created. |
description | string | A description of the folder. |
Below is an example of making a POST request to the /folder
endpoint to create a new folder within a drive and parent folder:
curl -X POST https://drive-api.disguise.cloud/v1/drives/{{drive_id}}/content/{{content_id}}/folder \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "New Folder",
"description": "This is a new folder"
}'