THINKHX

Files

A file is an asset stored in the project's delivery scope — most often an app logo. This resource reads the project's files and their categories, and deletes them. Uploading is not exposed.

Endpoints

MethodPathScope
GET/v1/file/categoryfile:read
GET/v1/filefile:read
GET/v1/file/<file_id>file:read
POST/v1/filefile:write
DELETE/v1/file/<file_id>file:write

<file_id> is accepted as either the file identifier, prefixed file_, or the delivery identifier, prefixed cdnf_. category is a reserved word in that position and lists the categories instead of reading a file.

The file object

FieldTypeDescription
idstringThe file identifier, prefixed file_.
objectstringAlways file.
namestringThe file's name.
formatstringThe file's format.
mimestringThe MIME type.
widthintegerWidth in pixels for an image, or null.
heightintegerHeight in pixels for an image, or null.
sizeintegerSize in bytes.
urlstringThe delivery URL, ready to use.
categoryobjectThe category, as id and name.
statusstringThe file's status.
created_atintegerCreation time, in Unix seconds.
updated_atintegerLast change, in Unix seconds.

List the categories

GET /v1/file/category returns the categories a file can belong to, at most

  1. They are the same for every project.
curl
curl https://api.thinkhx.com/v1/file/category \
  -H "Authorization: Bearer sk-project-YOUR_KEY"
json
{
  "code": 200,
  "title": "OK",
  "response": {
    "object": "list",
    "data": [
      {
        "id": "cdca_7a1c93e5b204df8617ca",
        "object": "file_category",
        "name": "Logos"
      }
    ],
    "total": 1
  }
}

List the files

GET /v1/file returns the project's files, newest first, at most 100. It takes no paging parameters; total carries the real count.

curl
curl https://api.thinkhx.com/v1/file \
  -H "Authorization: Bearer sk-project-YOUR_KEY"
json
{
  "code": 200,
  "title": "OK",
  "response": {
    "object": "list",
    "data": [
      {
        "id": "file_d81e4afa6c8bf11fa881",
        "object": "file",
        "name": "support-triage-logo",
        "format": "png",
        "mime": "image/png",
        "width": 512,
        "height": 512,
        "size": 24817,
        "url": "https://cdn-ef56d.owoxo.media/d/cdnu_6b2e91f47a05c3d8e142/file_d81e4afa6c8bf11fa881.png",
        "category": { "id": "cdca_7a1c93e5b204df8617ca", "name": "Logos" },
        "status": "activated",
        "created_at": 1754205600,
        "updated_at": 1754205600
      }
    ],
    "total": 1
  }
}

Read one file

GET /v1/file/<file_id> returns a single file of your project. A file of another project gives 404 and File not found.

curl
curl https://api.thinkhx.com/v1/file/file_d81e4afa6c8bf11fa881 \
  -H "Authorization: Bearer sk-project-YOUR_KEY"

Uploading

POST /v1/file exists but does not upload. It answers 501 and explains that files have to go through the delivery pipeline, which the API does not carry. Upload from the workspace, then read the file back here to get its identifier and URL.

Note — This is the only endpoint in the reference that answers 501. It is published so that a client discovers a clear refusal rather than a 404 that looks like a routing mistake.

Delete a file

DELETE /v1/file/<file_id> withdraws the file. It stops appearing in the listing and stops being served.

curl
curl -X DELETE https://api.thinkhx.com/v1/file/file_d81e4afa6c8bf11fa881 \
  -H "Authorization: Bearer sk-project-YOUR_KEY"
json
{
  "code": 200,
  "title": "OK",
  "response": {
    "deleted": true,
    "id": "file_d81e4afa6c8bf11fa881"
  }
}

Deleting the logo of a published app leaves the app without an image, which is one of the conditions publishing requires. Replace the logo before you delete the old one. Deletions are recorded — see Events.

Need help? Contact Support.