Platform guide
Create a receipt from StackAI
Use a StackAI action or custom API-style step to record what an agent or workflow did.
Add the receipt step after the agent output
Create the receipt after StackAI has generated, searched, classified, drafted, or acted, so the payload can describe the work in practical language.
Use the Automation Receipts API endpoint
Send create-run requests to https://automationreceipts.com/api/v1/runs. If your account uses a different workspace or environment endpoint, use the endpoint shown in your Automation Receipts setup.
Use the StackAI action payload
Starter fileDownload this JSON body for an action/custom API-style step, then map node outputs into run_uid, summaries, tools_used, and final_action.
What you need
Automation Receipts access
Use an active account and an active API key. The key is sent as a bearer token.
StackAI workflow
Start with a controlled workflow run and safe example values before connecting private data, customer-facing actions, or live approval steps.
Basic workflow shape
Put the receipt step after the workflow has enough information to summarize the trigger, output, review state, and final action.
StackAI input
->
LLM, knowledge, or app nodes
->
Action / Custom API step
->
Receipt appears in Automation Receipts
Request settings
- Step
- Action or Custom API-style request
- Method
POST- URL
https://automationreceipts.com/api/v1/runs- Content type
application/json- Headers
- Authorization and Content-Type
- Body
- JSON payload built from node outputs
Headers
Authorization: Bearer aar_live_REPLACE_ME
Content-Type: application/json
Sample payload
Use the platform's mapped values where the example says to replace a value. Keep summaries readable and avoid sending raw secrets, full customer messages, or unnecessary private payloads.
Create-run JSON
{
"automation_name": "StackAI Policy Assistant",
"run_uid": "stackai-REPLACE_WITH_RUN_ID",
"source_type": "stackai",
"trigger_type": "agent_run",
"status": "needs_review",
"risk_level": "medium",
"input_summary": "A teammate asked the agent to summarize a policy question.",
"output_summary": "StackAI generated an answer using the configured knowledge sources.",
"tools_used": "StackAI workflow, knowledge base, LLM",
"approval_required": true,
"approval_status": "pending",
"final_action": "Answer saved for review before sharing.",
"events": [
{
"event_type": "data_accessed",
"event_label": "Knowledge checked",
"event_summary": "The workflow searched the configured knowledge source."
},
{
"event_type": "output_generated",
"event_label": "Answer generated",
"event_summary": "The agent generated a draft answer for review."
}
]
}
Make run_uid unique
Map a StackAI run ID, conversation/message ID, timestamp, or another unique workflow value into run_uid. Automation Receipts rejects duplicate run_uid values within the same workspace.
Optional timeline events
For the first controlled run, include a short events array in the create-run payload. If the workflow continues later, append an event with the original run_uid.
Append an event later
POST https://automationreceipts.com/api/v1/runs/stackai-sample-run-001/eventsAuthorization: Bearer aar_live_REPLACE_ME
Content-Type: application/json
{
"event_type": "action_taken",
"event_label": "Workflow finished",
"event_summary": "The workflow finished and the receipt was updated."
}
StackAI notes
Starter file scope
This download is a copy-ready action payload. It is not a full StackAI project export or marketplace template.
Record the agent result, not every token
Receipts should summarize what the agent did and what happened next, not store complete prompts, private documents, or full model output unless needed.
Use node outputs deliberately
Map only the fields that help a person understand the run: input summary, output summary, tools used, review status, and final action.
Review is optional
Use approval_required true only when someone needs to record a review outcome. Otherwise use approval_status not_required.
Start with a manual test
Run the agent with safe example data before wiring customer-facing actions or internal knowledge sources.
Troubleshooting
| Problem | Likely cause | What to check |
|---|---|---|
| 401 unauthorized | The bearer token is missing, revoked, or not the full API key. | Use the complete key value shown when it was created, prefixed with Bearer. |
| 409 duplicate run_uid | A receipt already exists with that run ID in the workspace. | Use a dynamic value that changes for each workflow run. |
| 422 validation error | A required field is missing or a machine value is not allowed. | Check automation_name, run_uid, summaries, source_type, status, and approval_status. |