Upload an Agent file
Uploads a file into the Agent API Endpoint's App draft scope before a Thread exists. Use the returned file ID in create-thread or send-events resources.
/agents/{agentId}/filesUploads a file into the Agent API Endpoint's App draft scope before a Thread exists. Use the returned file ID in create-thread or send-events resources.
Authorization
publicApiBearer Use Authorization: Bearer mst_... . API tokens identify an account and do not carry scopes.
In: header
Path Parameters
Agent API Endpoint ID from the Agent's API Access panel. v1 IDs are bare ULIDs.
^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$ulidRequest Body
multipart/form-data
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/agents/01J00000000000000000000001/files" \ -F file="string"{ "file": { "createdAt": "2026-05-19T00:02:00.000Z", "id": "01J0000000000000000000000J", "mimeType": "text/plain", "name": "brief.txt", "size": 19 }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}{ "error": { "code": "agent_not_published", "message": "string" }}Stream Thread events
Streams public Thread event log entries as Server-Sent Events. Each `thread.event` data payload uses the same ThreadEventLogEntry shape as GET /threads/{thre…
Retrieve file metadata
Returns public file metadata for a pre-Thread uploaded file or a file attached to a public Thread visible to the API token caller.