Platform guide
Custom scripts
Send receipts from cron jobs, PHP scripts, Python scripts, and team tools.
When to use this
Use the API directly when your automation already runs in code. A script can log what triggered the run, what the AI produced, whether a person needs to review it, and what happened next.
Send summaries instead of full private payloads unless your workflow really needs the full content stored in the receipt. Do not paste API keys into screenshots, chat, public docs, or shared examples.
PHP example with curl
<?php
$apiKey = 'aar_live_REPLACE_ME';
$url = 'https://automationreceipts.com/api/v1/runs';
$payload = [
'automation_name' => 'Nightly Account Summary',
'run_uid' => 'cron-' . date('Ymd-His'),
'source_type' => 'custom_script',
'trigger_type' => 'scheduled_cron',
'status' => 'completed',
'risk_level' => 'low',
'input_summary' => 'Cron job checked accounts updated in the last 24 hours.',
'output_summary' => 'AI produced a short account activity summary.',
'model_used' => 'gpt-5.5',
'approval_required' => false,
'approval_status' => 'not_required',
'final_action' => 'Summary saved for the operations team.',
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $statusCode . PHP_EOL;
echo $response . PHP_EOL;
PHP example with file_get_contents
<?php
$apiKey = 'aar_live_REPLACE_ME';
$payload = json_encode([
'automation_name' => 'Team AI Tool',
'run_uid' => 'tool-' . bin2hex(random_bytes(8)),
'source_type' => 'custom_script',
'status' => 'needs_review',
'risk_level' => 'medium',
'input_summary' => 'A teammate asked the tool to draft a vendor follow-up.',
'output_summary' => 'AI drafted a vendor follow-up message.',
'approval_required' => true,
'approval_status' => 'pending',
'final_action' => 'Draft held for review.',
]);
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Authorization: Bearer {$apiKey}\r\nContent-Type: application/json\r\n",
'content' => $payload,
'ignore_errors' => true,
],
]);
echo file_get_contents('https://automationreceipts.com/api/v1/runs', false, $context);
PowerShell example
$headers = @{
Authorization = "Bearer aar_live_REPLACE_ME"
"Content-Type" = "application/json"
}
$body = @{
automation_name = "PowerShell Report Drafter"
run_uid = "ps-$(Get-Date -Format yyyyMMdd-HHmmss)"
source_type = "custom_script"
trigger_type = "manual_script"
status = "completed"
risk_level = "low"
input_summary = "Script gathered open tickets from the team report."
output_summary = "AI summarized the tickets for the support lead."
approval_required = $false
approval_status = "not_required"
final_action = "Summary posted to the team dashboard."
} | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "https://automationreceipts.com/api/v1/runs" -Headers $headers -Body $body