API Reference

Filenames and revisions

The entries in the file manager, and the revisions of the file or image behind each.

Prefix /cdna-api/files ReferenceFilename model GuideMedia and files

About filenames and revisions

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.

Revisions Yes

An upload under an existing name adds a revision; the live one is what URLs serve.

Media and files
Access Admin users

Members 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 authorisation

List filenames#

GET /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 compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List filenames
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
Response 200 OK
{
  "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"
    }
  ]
}
Real response from this documentation site

Show a filename#

GET /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

Show a filename
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
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 1,
    "name": "CW-blog-h1.jpg",
    "path": "testx/CW-blog-h1.jpg",
    "type": "image"
  }
}
Real response from this documentation site

Rename or move a filename#

PUT /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 a message.

Parameters

idpathrequired
integer
The filename id.
namebody
string
The new name.
folderbody
integer
The folder to move it to.

Example

Rename or move a filename
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#

DELETE /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 a filename
DELETE /cdna-api/files/filename/950 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Download a revision#

GET /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

Download a revision
GET /cdna-api/files/revision-content/1184/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Make a revision live#

PUT /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

Make a revision live
PUT /cdna-api/files/revisions/1184/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Delete a revision#

DELETE /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 a revision
DELETE /cdna-api/files/revisions/1184/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Purge a file’s old revisions#

DELETE /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

Purge a file’s old revisions
DELETE /cdna-api/files/purge-file-revisions/40 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Purge an image’s old revisions#

DELETE /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

Purge an image’s old revisions
DELETE /cdna-api/files/purge-image-revisions/1184 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json