mosoodocs

Files

Upload files and mount them into Mosoo API Threads.

Files uploaded through the public API are draft file resources scoped to an Agent API Endpoint App. Mount them when creating a Thread or sending a user message. Files produced by the Agent are artifacts. Both appear in the Thread file list when visible to the API token caller.

Upload flow

Public uploads use multipart/form-data and accept files up to 67108864 bytes.

  1. Upload the file to the Agent with POST /agents/{agentId}/files.
  2. Store the returned file.id.
  3. Mount the file with resources when creating a Thread or sending a later user message.

Upload a file

printf 'Customer asks for an implementation plan.' > brief.txt

curl -X POST "https://try.mosoo.ai/api/v1/agents/$MOSOO_AGENT_ID/files" \
  -H "Authorization: Bearer $MOSOO_API_TOKEN" \
  -F "file=@brief.txt;type=text/plain"

The response is a PublicFileResponse. Store file.id:

{
  "file": {
    "id": "01J0000000000000000000000J",
    "name": "brief.txt",
    "mimeType": "text/plain",
    "size": 41,
    "createdAt": "2026-05-19T00:02:00.000Z"
  }
}

Use a file in the first message

curl -X POST "https://try.mosoo.ai/api/v1/agents/$MOSOO_AGENT_ID/threads" \
  -H "Authorization: Bearer $MOSOO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "resources": [
      {
        "type": "file",
        "file_id": "01J0000000000000000000000J"
      }
    ],
    "input": {
      "type": "user.message",
      "content": [
        {
          "type": "text",
          "text": "Summarize the attached file."
        }
      ]
    }
  }'

Use a file in a later message

Send the file ID in resources on a later user message:

{
  "events": [
    {
      "type": "user_message",
      "resources": [
        {
          "type": "file",
          "file_id": "01J0000000000000000000000J"
        }
      ],
      "text": "Summarize the attached file."
    }
  ]
}

On this page