mosoodocs

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.

POST/agents/{agentId}/files

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.

Authorization

publicApiBearer
AuthorizationBearer <token>

Use Authorization: Bearer mst_... . API tokens identify an account and do not carry scopes.

In: header

Path Parameters

agentId*string

Agent API Endpoint ID from the Agent's API Access panel. v1 IDs are bare ULIDs.

Match^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$
Formatulid

Request 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"  }}