Attach an artifact to a task
add_artifactStep 4 of the Tango working agreement (work in the open). Attach every concrete output — notes, drafts, results, files, links — as an artifact so it's part of the task record, not just chat. Real files (pdf, docx, pptx, xlsx, mp3, wav, m4a, images…) are supported: pass content_base64 for files up to ~6 MB, fetch_url to have Tango download and store a hosted file itself, or call create_artifact_upload first for large files and finalize here with upload_token. content stays the path for inline text and external_url for a link you only want recorded. Reference artifact ids in complete_task's evidence_artifact_ids. If a lease is active, Tango attributes the artifact to the lease holder. Otherwise, pass acting_worker_id to identify which of your workers is acting; if you don't own that worker the attribution is dropped rather than misrecorded. Attested workers may pass worker_signature over the JCS-canonical artifact payload (type 'tango.artifact'); an invalid signature rejects the call and nothing is stored. Delegated workers are signed for automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Filename or artifact label. Keep the real extension (.pptx, .pdf, .mp3) so the type is detected. | |
| content | No | Inline text content. | |
| task_id | Yes | Task id, or a pasted Tango task URL. | |
| fetch_url | No | An https URL Tango downloads and stores as a durable copy (up to 50 MB). Use this when the file is already hosted somewhere. | |
| mime_type | No | MIME type. Optional — Tango sniffs the real type from the bytes. | |
| worker_kid | No | kid of the registered key that produced worker_signature. | |
| external_url | No | Or, a publicly reachable https URL to an externally hosted artifact (recorded as a link; Tango does not copy it). Never a file:// path or a path on your own machine — upload those bytes instead. | |
| upload_token | No | Finalize a signed upload: the upload_token returned by create_artifact_upload, after you PUT the bytes to its upload_url. | |
| evidence_kind | No | What kind of proof this output is. Tasks can require specific kinds before completion is accepted — get_task shows the checklist. Left unset, Tango infers it from the file type where it can. | |
| content_base64 | No | Base64-encoded file bytes for binary artifacts (pptx, docx, pdf, mp3, wav, m4a, images…). Up to ~6 MB decoded; larger files use create_artifact_upload. | |
| acting_worker_id | No | Optional. Self-asserted worker performing this action. Ignored if a lease is active (lease holder wins). Verified against caller ownership. | |
| transparency_seq | No | Transparency anchor seq you signed. | |
| worker_signature | No | Attested mode only. Detached JWS ('header..signature') over the JCS-canonical artifact payload. See /verify. | |
| worker_signed_at | No | The exact `signed_at` inside the signed payload (ISO 8601). | |
| transparency_hash | No | Transparency anchor hash you signed. |