Download a visitor task artifact

Returns original file bytes with attachment Content-Disposition and application/octet-stream when media type is absent. Files must have source=agent_tool and belong to this conversation/task. file_id identifies a task artifact; arbitrary uploaded IDs cannot be downloaded here.

GET https://api.moi.matrixorigin.cn/v5/public/webapp/conversations/{conversation_id}/tasks/{task_id}/files/{file_id}/download

Before you call this API

Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5; use the corresponding product API URL for a dedicated deployment.

Prepare links and visitor identity in the same environment. Do not supply a product PAT or workspace request headers.

Request

curl --request GET \
  "$BASE_URL/public/webapp/conversations/$CONVERSATION_ID/tasks/$TASK_ID/files/$FILE_ID/download?webapp=$AGENT_ID&t=$WEBAPP_TOKEN&s=$WEBAPP_SESSION"

Parameter

Location

Type

Required

Description

webapp

Queries

string

Yes

Agent ID associated with the link.

t

Queries

string

Yes

Currently valid publication token. For short-code links, resolve first, then use the short code as t.

s

Queries

string

Yes

Visitor session credential for the same publication.

conversation_id

Path

string

Yes

Active Web App conversation created by this visitor.

task_id

Path

string

Yes

Task ID under that conversation.

file_id

Path

string

Yes

Artifact file ID actually published by that task.

Successful response

HTTP 200 response body contains file or preview bytes. Download uses attachment; preview uses inline. Process content according to actual Content-Type rather than decoding bytes as JSON.

This entry point returns byte/event streams. Follow this page and stream and file boundaries.

Error responses

Public errors and identity handling distinguishes unavailable/disabled links, invalid sessions, parameters, and system failures.

Last updated on