Skip to Content
DocsAPITerminal Level APIsAsset Management API

Asset Management API

This document describes how to use the terminal-level Asset Management API, which allows you to upload and delete files using your terminal key. These APIs are typically used to upload images, PDFs, and other files collected by terminals to the cloud for subsequent processing by services such as Agent Responses.

Upload File API

API Description

POST https://api.ticos.ai/v1/assets

Request Headers

ParameterRequiredDescription
Content-TypeYesFixed value: multipart/form-data
AuthorizationYesFormat: Bearer <TerminalKey>, terminal key can be obtained from the terminal details page
acceptNoSpecifies the return format as JSON: application/json

Request Body

The request body should be formatted as multipart/form-data with the following fields:

FieldTypeRequiredDescription
fileFileYesThe file to upload. Supports common document and media formats

Response

After a successful upload, the service returns JSON:

{ "url": "https://assets.ticos.ai/relative/path/to_file.pdf", "contentType": "application/pdf", "path": "relative/path/to_file.pdf" }

The url field is the public access address of the file that can be used in other API calls.

Delete File API

API Description

DELETE https://api.ticos.ai/v1/assets

Request Headers

ParameterRequiredDescription
AuthorizationYesFormat: Bearer <TerminalKey>, terminal key can be obtained from the terminal details page

Query Parameters

ParameterTypeRequiredDescription
urlstringYesURL of the file to delete

Response

A successful deletion will return an HTTP 200 OK status code.

Example Code

cURL

Upload File

curl -X 'POST' 'https://api.ticos.ai/v1/assets' \ -H 'Authorization: Bearer <TerminalKey>' \ -H 'accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@"/path/to/your/file.pdf"'

Delete File

curl -X 'DELETE' \ 'https://api.ticos.ai/v1/assets?url=https://assets.ticos.ai/relative/path/to_file.pdf' \ -H 'Authorization: Bearer <TerminalKey>'

Python

Upload File

import requests url = "https://api.ticos.ai/v1/assets" headers = { "accept": "application/json", "Authorization": "Bearer <TerminalKey>" } files = { "file": open("/path/to/your/file.pdf", "rb") } response = requests.post(url, headers=headers, files=files) print(response.json())

Delete File

import requests url = "https://api.ticos.ai/v1/assets" params = { "url": "https://assets.ticos.ai/asset_123456789.pdf" } headers = { "Authorization": "Bearer <TerminalKey>" } response = requests.delete(url, headers=headers, params=params) print(response.status_code)

Common Issues

IssueSolution
Returns 401 UnauthorizedCheck if the terminal key in the Authorization header is correct and has not expired
Returns 400 Bad RequestEnsure the file format is supported and the file size is within limits
Returns 404 Not FoundVerify that the URL provided for deletion is correct and the file exists