All requests below will use this key. Your API key is sent directly to api.cueapi.ai and never stored by the docs site.
/v1/executions/{execution_id}/evidenceAppend Evidence
Append evidence fields to an execution after the outcome is already recorded. Re-runs verification policy.
Appends evidence fields to an execution after the outcome has been recorded by POST /v1/executions/{id}/outcome. Unlike outcome reporting (write-once), evidence can be appended.
Primary use case: worker transport. The cueapi-worker daemon auto-reports outcome based on the handler's exit code before the agent has finished producing business artifacts. The agent then PATCHes evidence as it becomes available, and the verification policy re-runs server-side.
Note
Outcome success/failure is not changed. This endpoint only writes evidence fields; the original outcome stands.
Request
curl -X PATCH https://api.cueapi.ai/v1/executions/exec_abc/evidence \
-H "Authorization: Bearer cue_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_id": "lead-batch-7842",
"result_url": "https://my-app.com/batches/7842",
"result_ref": "batch-id:7842",
"result_type": "lead-batch",
"summary": "Generated 47 qualified leads",
"artifacts": [{"name": "leads.csv", "url": "https://..."}],
"metadata": {"agent_version": "v3.2.1"}
}'Response
{
"execution_id": "exec_abc",
"outcome_state": "verified_success",
"evidence_updated": true
}Body fields (all optional, all merge-only)
| Field | Type | Notes |
|---|---|---|
external_id | string | ID in your system. |
result_url | string | Where the artifact lives. |
result_ref | string | Short opaque reference. |
result_type | string | Tag ("report", "lead-batch", etc.). |
summary | string | Truncated to 500 chars. |
artifacts | array | List of {name, url, ...} objects. |
metadata | object | Free-form. |
Sending null or omitting a field leaves it unchanged. To clear a field, contact support — there is intentionally no way to scrub evidence client-side.
Verification policy re-runs
If the cue's verification.mode requires evidence, the policy re-evaluates after the PATCH:
verification.mode | Triggers outcome_state = "verified_success" when |
|---|---|
require_external_id | external_id is present |
require_result_url | result_url is present |
require_artifacts | artifacts is non-empty |
Verification only upgrades — never downgrades. An outcome_success=false execution can never become verified_success.
Errors
| Status | Code | Cause |
|---|---|---|
| 401 | not_authenticated | Missing/invalid bearer token |
| 404 | execution_not_found | execution_id doesn't exist or isn't yours |
| 409 | no_outcome | No outcome has been reported yet — call POST /outcome first |
/v1/executions/{execution_id}/evidence