palbaseDocs

Palbase Realtime · API

POST/realtime/state

Write state as the server

Writes or removes entries of the project's channels' state, as the project's server (1 to 100 operations): durable entries, read by every subscriber with state access as a diff. A write past a channel's budget is refused (422) and the operations before it stay applied.

Called by your server, with the project's secret key.

Request body

opsobject[] · required1 to 100 operations.
curl
curl -X POST "https://<your-ref>.palbase.studio/realtime/state" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"ops":[{"key":"string","topic":"string"}]}'

Responses

200Applied

400The request is malformed: a field, a channel or a pattern is wrong

401No key, or not a key of this project, or a token that is not valid (the edge's answer)

403Not the project's secret key

422A state write past the channel's budget (512 keys, 16 KiB a value, 256 KiB a channel)

429The project's request rate, its realtime quota for the period, or the connections it allows are used up; Retry-After says when to try again

503The platform could not answer now; retrying is safe (Retry-After)

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation WriteState of realtime's contract.