Folders and filenames are the tree the file manager shows. Behind each filename is a file or an image, which keeps its content in revisions. A filename has a type, file or image, and points at that record; uploading again under the same name adds a revision rather than a new filename. The routes here rename and move filenames, and manage those revisions: show one’s content, make an older one live, delete one, or purge every revision older than the live one.
Filenames and revisions
The entries in the file manager, and the revisions of the file or image behind each.
About filenames and revisions
An upload under an existing name adds a revision; the live one is what URLs serve.
Media and filesMembers are refused: a 404 by default, a 403 where the site’s access-denied setting says so. Call it from a server with an admin user’s OAuth token or API key.
Authentication and authorisationLearn more
List filenames#
/cdna-api/files/filenames
Lists filenames across every folder. Without limit every match comes back, which on a large site is thousands; filter by folder.id.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Filename, in the Reference
Parameters
propertiesquery- selector
- The fields and relations to return, such as
{id,name,path,type}. filtersquery- name=value
- Any stored field, or a relation with a dot, such as
parent.id=12. Prefix the name with!,>,<,%or|. Use stored field names exactly as in the model, and comparetotalCountwith the unfiltered list's to confirm a filter applied. orderByquery- string
field:ASCorfield:DESC, comma-separated. Stored fields only.limitquery- integer
- Records per response. There is no default.
offsetquery- integer
- Records to skip.
Example
GET /cdna-api/files/filenames?limit=2&properties={id,name,path,type} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json{
"result": "success",
"totalCount": 973,
"data": [
{
"id": 1,
"name": "CW-blog-h1.jpg",
"path": "testx/CW-blog-h1.jpg",
"type": "image"
},
{
"id": 2,
"name": "497-h1jpg",
"path": "images/blogs/6/497/497-h1jpg",
"type": "image"
}
]
}Show a filename#
/cdna-api/files/filename/{id}
Reads one filename by its id.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Filename, in the Reference
Parameters
idpathrequired- integer
- The filename id.
propertiesquery- selector
- The fields and relations to return, such as
{id,name,path,type}.
Example
GET /cdna-api/files/filename/1?properties={id,name,path,type} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json{
"result": "success",
"data": {
"id": 1,
"name": "CW-blog-h1.jpg",
"path": "testx/CW-blog-h1.jpg",
"type": "image"
}
}Rename or move a filename#
/cdna-api/files/filename/{id}
Changes a filename. Fields left out keep their values.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Returns
- The saved filename under
data.filename, and amessage.
Parameters
idpathrequired- integer
- The filename id.
namebody- string
- The new name.
folderbody- integer
- The folder to move it to.
Example
PUT /cdna-api/files/filename/950 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"name": "price-list-2026.pdf",
"folder": 12
}Delete a filename#
/cdna-api/files/filename/{id}
Deletes a filename.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
idpathrequired- integer
- The filename id.
Example
DELETE /cdna-api/files/filename/950 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/jsonDownload a revision#
/cdna-api/files/revision-content/{filename.id}/{revision.id}
Answers with the bytes of one revision of a file or image, not JSON, with its content type, length and an ETag; a matching If-None-Match answers 304.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
filename.idpathrequired- integer
- The filename id.
revision.idpathrequired- integer
- The revision id.
Example
GET /cdna-api/files/revision-content/1184/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/jsonMake a revision live#
/cdna-api/files/revisions/{filename.id}/{revision.id}
Makes an older revision of a file or image the live one. There is no body.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
filename.idpathrequired- integer
- The filename id.
revision.idpathrequired- integer
- The revision id.
Example
PUT /cdna-api/files/revisions/1184/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/jsonDelete a revision#
/cdna-api/files/revisions/{filename.id}/{revision.id}
Deletes one revision. The live revision cannot be deleted: that answers 409.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
filename.idpathrequired- integer
- The filename id.
revision.idpathrequired- integer
- The revision id.
Example
DELETE /cdna-api/files/revisions/1184/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/jsonPurge a file’s old revisions#
/cdna-api/files/purge-file-revisions/{file.id}
Deletes every revision of a file older than its live one. Nothing to purge is a 404. The path takes the file’s id, the filename’s file.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
file.idpathrequired- integer
- The file id.
Example
DELETE /cdna-api/files/purge-file-revisions/40 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/jsonPurge an image’s old revisions#
/cdna-api/files/purge-image-revisions/{image.id}
As for a file, for an image: the path takes the filename’s image.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
image.idpathrequired- integer
- The image id.
Example
DELETE /cdna-api/files/purge-image-revisions/1184 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json