All requests below will use this key. Your API key is sent directly to api.cueapi.ai and never stored by the docs site.

PATCH/v1/executions/{execution_id}/evidence

Append 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

bash
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

json
{
  "execution_id": "exec_abc",
  "outcome_state": "verified_success",
  "evidence_updated": true
}

Body fields (all optional, all merge-only)

FieldTypeNotes
external_idstringID in your system.
result_urlstringWhere the artifact lives.
result_refstringShort opaque reference.
result_typestringTag ("report", "lead-batch", etc.).
summarystringTruncated to 500 chars.
artifactsarrayList of {name, url, ...} objects.
metadataobjectFree-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.modeTriggers outcome_state = "verified_success" when
require_external_idexternal_id is present
require_result_urlresult_url is present
require_artifactsartifacts is non-empty

Verification only upgrades — never downgrades. An outcome_success=false execution can never become verified_success.

Errors

StatusCodeCause
401not_authenticatedMissing/invalid bearer token
404execution_not_foundexecution_id doesn't exist or isn't yours
409no_outcomeNo outcome has been reported yet — call POST /outcome first
PATCH/v1/executions/{execution_id}/evidence
Try it
Replace path parameters (e.g. {cue_id}) in the URL before sending.
Request Body
Enter your API key above to send requests
How do I know if my agent ran successfully?
Ctrl+K