sessions_append
const url = 'https://api.canopyhq.dev/sessions/000000000000000000000000000000000000000000000000000000000000000000000000/events';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"body":"example","kind":{"name":"example","version":1}}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.canopyhq.dev/sessions/000000000000000000000000000000000000000000000000000000000000000000000000/events \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "body": "example", "kind": { "name": "example", "version": 1 } } ]'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A stream id: 72 hex chars, the shard then the owner digest.
The session to land on.
Request Bodyrequired
Section titled “Request Bodyrequired”A record as a client offers it over the wire: kind and body, nothing the door or the log stamps.
object
object
Examplegenerated
[ { "body": "example", "kind": { "name": "example", "version": 1 } }]Responses
Section titled “Responses”The landed envelopes, including each record cursor.
The envelope: the only surface the filter is evaluated on. Trellis never reads beneath it.
object
Unix milliseconds, minted with the cursor at the single point of intake.
Monotonic per-stream position, minted at the single point of intake. Producers never carry or assert one.
A kind string and the version of its body, one unit.
object
Who landed a record. Asserted on the offer, checked by the write clause.
A stream id: 72 hex chars, the shard then the owner digest.
Example
[ { "stream": "000000000000000000000000000000000000000000000000000000000000000000000000" }]A malformed body, or a kind that is not well formed; parse errors identify the field and reason when available.
No session token, or one that did not verify.
The token does not attach, or the filter refused a record.
No such session.
The session is archived, or the token’s key already holds a different record.