palbaseDocs

Palbase Analytics · API

POST/analytics/people

Set a person's properties

Sets properties of a person: the signed-in user, with no one signed in the app's anonymous id, or — the project's server — whom it names. set replaces, set_once sets what is not set (where they first came from), unset removes, add adds a number. The anonymous id's properties are the user's once it is identified as them.

Called by your app, with the publishable key; or a signed-in user of your app, with their token and the publishable key; or your server, with the project's secret key.

Request body

addobject · optionalNumbers added to what is set (none is 0).
distinct_idstring · optionalWhose properties: the anonymous id with no one signed in; the person the server means. An app (the publishable key) names its signed-in user's id and its own anonymous ids (anon_…, as the SDKs make them) only: any other id is someone else's and is refused (400 distinct_id_not_yours); the project's server names whom it means.
sent_atinteger · optionalWhen the device sent it, in unix milliseconds: its clock is corrected by it.
setobject · optionalA JSON object.
set_onceobject · optionalSet when not set already: where a person first came from.
timestampinteger · optionalWhen, in unix milliseconds; now when absent.
unsetstring[] · optional
curl
curl -X POST "https://<your-ref>.palbase.studio/analytics/people" \
  -H "apikey: $PALBASE_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"add":{},"distinct_id":"string","sent_at":0,"set":{},"set_once":{},"timestamp":0,"unset":["string"]}'

Responses

202Kept

400The request is malformed, or what it sends breaks a limit (the error names which: the SDKs' codes)

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

413The body is over this operation's limit (payload_too_large), or an upload's record or batch is (record_too_large, batch_too_large)

429The project is sending analytics faster than its per-second limit (rate_limited), or its quota for the period is used up (quota_exceeded); Retry-After says when to try again

503The platform could not take or answer this now; nothing was kept, and retrying is safe (Retry-After)

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

Operation SetPersonProperties of analytics's contract.