API reference · Receipts

Attest an action

POST/v1/receipts/attest

Record and sign that you acted on an event, bound to the event's hash.

On this page

Auth. An API token: Authorization: Bearer lb_… (create one). Signed-in web sessions work too.

Limits. Counts against your plan's API requests (60, 600 or 3,000 a minute on Free, Builder and Standard).

Parameters

Body

NameTypeRequiredDescription
evt_idstringyesThe event you acted on (evt_…).
hashstringnoThe event hash you hold; refused with 409 when it differs from the record.
actionobjectyesYour action as JSON, at most 4 KiB. Private to you; never put venue credentials in it.
t_actedintegernoWhen you acted, ms epoch; default the time of the call.

Request

Terminal
curl -X POST "https://api.langbot.ai/v1/receipts/attest" \
  -H "Authorization: Bearer $LANGBOT_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"evt_id": "evt_01K7Q0000000000000000000A2", "hash": "5d0e05c3…", "action": {"side": "yes", "qty": 20, "price": 0.57}, "t_acted": 1760050125000}'

Response

201 Created

JSON
{ "id": "att_01K7Q…", "user_id": "usr_…", "evt_id": "evt_01K7Q0000000000000000000A2", "event_hash": "5d0e05c3…", "action_hash": "9f2c…", "t_acted": 1760050125000, "created_at": 1760050125500, "key_id": "56475aa75463474c", "signature": "…" }

Errors

StatuscodeWhen
404not_foundUnknown event.
409conflicthash does not match the record.
413too_largeaction is over 4 KiB.
401auth_requiredNo token was sent.
401token_invalidThe token was not recognised (mistyped, revoked or expired).
422validation_errorA parameter failed validation; detail[].loc names it.
429rate_limitedOver your request budget; wait Retry-After seconds.

Every error body is {"detail": …, "code": "…"}; branch on code. All codes: Errors.