API REFERENCE
History, sessions, feedback
Read a conversation back, clear it, or tell the agent how it did. Three small endpoints around a session.
Get history
GET
/v1/historyReturns the recent messages for one session, oldest first. Useful when you render your own transcript instead of the widget.
| Field | Type | Description |
|---|---|---|
session_idrequired | string | The session to read. Query parameter. |
limit | number | How many messages to return. Query parameter, defaults to 30. |
In signed identity mode, pass the signed
user_context URL-encoded in the X-Era-User header. There is no body on a GET, so the identity rides in the header.bash
curl "https://eerraa.online/v1/history?session_id=sess_9f3a&limit=30" \ -H "Authorization: Bearer era_your_project_key"
Response:
json
{
"messages": [
{ "role": "user", "content": "Where is order 1043?" },
{ "role": "assistant", "content": "Order 1043 shipped, ETA Sep 2." }
],
"session_id": "sess_9f3a"
}An unknown session returns SESSION_NOT_FOUND.
Delete a session
DELETE
/v1/sessions/{session_id}Deletes the session and its history. Use it for a clear-conversation action or when a user asks to be forgotten.
bash
curl -X DELETE https://eerraa.online/v1/sessions/sess_9f3a \ -H "Authorization: Bearer era_your_project_key"
Response:
json
{ "deleted": true, "session_id": "sess_9f3a" }Submit feedback
POST
/v1/feedbackRecords a thumbs up or down on a reply. Pair it with the trace_id from that turn's done event so the rating lands on the right response.
| Field | Type | Description |
|---|---|---|
session_idrequired | string | The session the reply belongs to. |
trace_idrequired | string | From the done event of the rated turn. |
ratingrequired | +1 | -1 | Thumbs up (+1) or thumbs down (-1). |
comment | string | Optional free-text note from the user. |
user_context | object | The end-user identity. Signed in signed mode. |
bash
curl -X POST https://eerraa.online/v1/feedback \
-H "Authorization: Bearer era_your_project_key" \
-H "Content-Type: application/json" \
-d '{
"session_id": "sess_9f3a",
"trace_id": "tr_7c1d",
"rating": 1,
"comment": "Nailed it.",
"user_context": { "id": "u_42" }
}'Response:
json
{ "ok": true }