Media Library
APIs for managing the media library: folders, uploads, and asset metadata. Organize files, set tags, and move assets between folders.
Get Folders GET
Returns the folder structure of the media library for organizing assets.
GET /{project}/media-library/foldersPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
search | string | No | - |
searchSubdirectory | boolean | No | - |
folder | string | No | - |
page | integer | No | - |
size | integer | No | - |
sort | string | No | - |
Response (200 OK)
{
"id": "string",
"text": "string",
"path": "string",
"children": [
{
"id": "string",
"text": "string",
"path": "string",
"children": []
}
]
}cURL Example
curl -X GET "https://my-project.atlascms.io/{project}/media-library/folders" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json"Create Folder POST
Creates a new folder in the media library.
POST /{project}/media-library/foldersPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Request Body
{
"folder": "string"
}Response (200 OK)
{
"result": "string"
}cURL Example
curl -X POST "https://my-project.atlascms.io/{project}/media-library/folders" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"folder":"string"}'Delete Folder DELETE
Deletes a folder and all its contents. Use with caution.
DELETE /{project}/media-library/foldersPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
folder | string | Yes | - |
cURL Example
curl -X DELETE "https://my-project.atlascms.io/{project}/media-library/folders?folder=value" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json"Rename Folder POST
Renames an existing folder in the media library.
POST /{project}/media-library/folders/renamePath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Request Body
{
"folder": "string",
"newName": "string"
}Response (200 OK)
{
"result": "string"
}cURL Example
curl -X POST "https://my-project.atlascms.io/{project}/media-library/folders/rename" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"folder":"string","newName":"string"}'Move Folder POST
Moves a folder to a different parent folder.
POST /{project}/media-library/folders/movePath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Request Body
{
"folder": "string",
"moveTo": "string"
}Response (200 OK)
{
"result": "string"
}cURL Example
curl -X POST "https://my-project.atlascms.io/{project}/media-library/folders/move" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"folder":"string","moveTo":"string"}'Get Medias GET
Retrieves a paginated list of media assets. Supports filtering by folder and search.
GET /{project}/media-library/mediaPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
folder | string | No | - |
filter | string | No | Querystring parameters in the form of ?filter[field][operator]=values&filter[field][operator]=values |
search | string | No | - |
searchSubdirectory | boolean | No | - |
page | integer | No | - |
size | integer | No | - |
sort | string | No | - |
Response (200 OK)
{
"data": [
{
"id": "string",
"code": "string",
"folder": "string",
"type": "string",
"createdAt": "2024-01-15T12:00:00Z",
"createdBy": "string",
"modifiedAt": "2024-01-15T12:00:00Z",
"modifiedBy": "string",
"author": "string",
"copyright": "string",
"originalFileName": "string",
"name": "string",
"format": "string",
"hash": "string",
"mimeType": "string",
"size": 0,
"automaticTags": [],
"tags": [],
"url": "string",
"provider": "string",
"height": 0,
"width": 0,
"horizontalResolution": 0,
"verticalResolution": 0,
"duration": 0,
"fps": 0,
"codec": "string",
"exif": {
"key": "value"
}
}
],
"metadata": {
"currentPage": 0,
"pageSize": 0,
"hasPreviousPage": true,
"hasNextPage": true,
"totalPages": 0,
"count": 0
}
}cURL Example
curl -X GET "https://my-project.atlascms.io/{project}/media-library/media" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json"Get Media GET
Retrieves a single media asset by ID.
GET /{project}/media-library/media/{id}Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | - |
project | string | Yes | - |
Response (200 OK)
{
"id": "string",
"code": "string",
"folder": "string",
"type": "string",
"createdAt": "2024-01-15T12:00:00Z",
"createdBy": "string",
"modifiedAt": "2024-01-15T12:00:00Z",
"modifiedBy": "string",
"author": "string",
"copyright": "string",
"originalFileName": "string",
"name": "string",
"format": "string",
"hash": "string",
"mimeType": "string",
"size": 0,
"automaticTags": [
"string"
],
"tags": [
"string"
],
"url": "string",
"provider": "string",
"height": 0,
"width": 0,
"horizontalResolution": 0,
"verticalResolution": 0,
"duration": 0,
"fps": 0,
"codec": "string",
"exif": {
"key": "value"
}
}cURL Example
curl -X GET "https://my-project.atlascms.io/{project}/media-library/media/item-id" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json"Delete Media DELETE
Permanently deletes a media asset.
DELETE /{project}/media-library/media/{id}Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | - |
project | string | Yes | - |
cURL Example
curl -X DELETE "https://my-project.atlascms.io/{project}/media-library/media/item-id" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json"Set Media Tags POST
Updates the tags associated with a media asset.
POST /{project}/media-library/media/{id}/tagsPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | - |
project | string | Yes | - |
Request Body
{
"tags": [
"string"
]
}cURL Example
curl -X POST "https://my-project.atlascms.io/{project}/media-library/media/item-id/tags" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"tags":["string"]}'Upload File (form-data) POST
Uploads a new file to the media library. Use multipart/form-data with the file field.
POST /{project}/media-library/media/uploadPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Request Body
JSON object. See schema in OpenAPI spec for details.
Response (200 OK)
{
"result": "string"
}cURL Example
curl -X POST "https://my-project.atlascms.io/{project}/media-library/media/upload" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{}'Move Media POST
Moves a media asset to a different folder.
POST /{project}/media-library/media/movePath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
project | string | Yes | - |
Request Body
{
"mediaId": "string",
"moveTo": "string"
}Response (200 OK)
{
"result": "string"
}cURL Example
curl -X POST "https://my-project.atlascms.io/{project}/media-library/media/move" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"mediaId":"string","moveTo":"string"}'