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
| Method | Path | Scope |
|---|---|---|
| GET | /v1/file/category | file:read |
| GET | /v1/file | file:read |
| GET | /v1/file/<file_id> | file:read |
| POST | /v1/file | file: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
| Field | Type | Description |
|---|---|---|
id | string | The file identifier, prefixed file_. |
object | string | Always file. |
name | string | The file's name. |
format | string | The file's format. |
mime | string | The MIME type. |
width | integer | Width in pixels for an image, or null. |
height | integer | Height in pixels for an image, or null. |
size | integer | Size in bytes. |
url | string | The delivery URL, ready to use. |
category | object | The category, as id and name. |
status | string | The file's status. |
created_at | integer | Creation time, in Unix seconds. |
updated_at | integer | Last change, in Unix seconds. |
List the categories
GET /v1/file/category returns the categories a file can belong to, at most
- They are the same for every project.
curl https://api.thinkhx.com/v1/file/category \
-H "Authorization: Bearer sk-project-YOUR_KEY" {
"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 https://api.thinkhx.com/v1/file \
-H "Authorization: Bearer sk-project-YOUR_KEY" {
"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 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 a404that 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 -X DELETE https://api.thinkhx.com/v1/file/file_d81e4afa6c8bf11fa881 \
-H "Authorization: Bearer sk-project-YOUR_KEY" {
"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.