Record a receipt on a log
curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step": "<string>",
"key": "<string>",
"role": "<string>",
"detail": "<unknown>"
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts"
payload = {
"step": "<string>",
"key": "<string>",
"role": "<string>",
"detail": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({step: '<string>', key: '<string>', role: '<string>', detail: '<unknown>'})
};
fetch('https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'step' => '<string>',
'key' => '<string>',
'role' => '<string>',
'detail' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts"
payload := strings.NewReader("{\n \"step\": \"<string>\",\n \"key\": \"<string>\",\n \"role\": \"<string>\",\n \"detail\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"step\": \"<string>\",\n \"key\": \"<string>\",\n \"role\": \"<string>\",\n \"detail\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step\": \"<string>\",\n \"key\": \"<string>\",\n \"role\": \"<string>\",\n \"detail\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"at": "<string>",
"by": {
"role": "<string>",
"id": "<string>"
},
"step": "<string>",
"key": "<string>",
"outcome": "performed",
"basedOn": 123,
"detail": null
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}Your programs
Record a receipt on a log
Keeps what a system outside the log did on its final act: the step (such as issue-refund), the idempotency key it was sent under, performed or failed, and what the system answered. The log is final once bound or closed, so no entry can say it; a receipt is kept beside the log instead, naming the final entry. A log that is not final refuses it (409, conflict). A step that failed may be recorded again; a step already performed keeps its first receipt, which is answered again, so a retried step records once. A receipt sent again with its Idempotency-Key is answered from the one kept; the key with another receipt is 409 idempotency_conflict. The caller acts in a program role it holds.
POST
/
rsl
/
{id}
/
logs
/
{log}
/
receipts
Record a receipt on a log
curl --request POST \
--url https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"step": "<string>",
"key": "<string>",
"role": "<string>",
"detail": "<unknown>"
}
'import requests
url = "https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts"
payload = {
"step": "<string>",
"key": "<string>",
"role": "<string>",
"detail": "<unknown>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({step: '<string>', key: '<string>', role: '<string>', detail: '<unknown>'})
};
fetch('https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'step' => '<string>',
'key' => '<string>',
'role' => '<string>',
'detail' => '<unknown>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts"
payload := strings.NewReader("{\n \"step\": \"<string>\",\n \"key\": \"<string>\",\n \"role\": \"<string>\",\n \"detail\": \"<unknown>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"step\": \"<string>\",\n \"key\": \"<string>\",\n \"role\": \"<string>\",\n \"detail\": \"<unknown>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.canary.effectiveai.app/api/v2/rsl/{id}/logs/{log}/receipts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"step\": \"<string>\",\n \"key\": \"<string>\",\n \"role\": \"<string>\",\n \"detail\": \"<unknown>\"\n}"
response = http.request(request)
puts response.read_body{
"at": "<string>",
"by": {
"role": "<string>",
"id": "<string>"
},
"step": "<string>",
"key": "<string>",
"outcome": "performed",
"basedOn": 123,
"detail": null
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}{
"error": "<string>",
"code": "<string>",
"details": [
{
"location": "path",
"path": [
"<string>"
],
"code": "required",
"message": "<string>"
}
],
"requestId": "<string>",
"dataset": "naic",
"businessCode": "<string>",
"violations": [
{
"code": "<string>",
"message": "<string>",
"path": "<string>",
"value": "<unknown>",
"constraint": "<string>",
"cite": "<string>"
}
],
"violationsTruncated": true,
"executionId": "<string>",
"accessUrl": "<string>"
}Authorizations
Headers
Path Parameters
Body
application/json