upload_artifact
Attach files, code, logs, or images to an EVC Mesh task; supports text/base64 content, metadata, and optional SHA-256 integrity checks.
Instructions
Upload an artifact (file, code, log, etc.) to a task. Downloading an artifact is two GETs. Step 1: GET /api/v1/artifacts//download with header X-Agent-Key: -> 200 JSON {"url": ""}. Step 2: GET that url with NO headers -> 200, the file bytes. Pitfalls: on step 1 only X-Agent-Key is accepted (X-API-Key and Authorization: Bearer give 401); on step 2 any extra header, Authorization in particular, breaks the presigned signature (400). The artifact's download_path is step 1's path. Never fetch browser_only_url with an agent key: it is a human page and answers 401 by design. Inline content travels through the model context, so for a binary larger than a few KB prefer the REST endpoint instead: POST /api/v1/tasks/<task_id>/artifacts as multipart/form-data with -H 'X-Agent-Key: $MESH_AGENT_KEY' -F 'name=' -F 'artifact_type=image' -F 'file=@;type=image/png' — the bytes then never enter the context and cannot be truncated on the way.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Artifact filename. | |
| sha256 | No | Optional hex sha256 of the DECODED bytes. Verified before upload; a mismatch fails the call. Recommended for binary, since it is the only check that catches a payload truncated in transit. | |
| content | Yes | Artifact content. Plain text by default; set encoding="base64" to send binary. | |
| task_id | Yes | Task ID. | |
| encoding | No | How to interpret content: "text" (stored as-is) or "base64" (decoded before storing). Required for binary — without it a base64 string is stored literally as the file body. | text |
| metadata | No | Additional metadata, stored on the artifact as JSON. | |
| mime_type | No | MIME type. Auto-detected from name if omitted. For png/jpeg/gif/pdf/zip the content is checked against the type's magic bytes and the upload is refused on a mismatch. | |
| artifact_type | No | Type: file, code, log, report, link, image, data. | file |