Compute a trait for one profile
Computes a definition (saved or not) for one profile now, read live, with the type of its value: to check a trait before publishing it.
Computes a definition (saved or not) for one profile now, read live, with the type of its value: to check a trait before publishing it.
apiKey readAuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: read
idempotency-key?stringRun this write once: a retry with the same key gets the first answer (24 hours).
1 <= length <= 255application/json- body
definition*profileId*stringuuidOK
application/json- response
type*string"number""money""datetime""string""array""boolean"value*number|string|array<string>|boolean|nullcurl -X POST 'https://api.postforge.dev/v1/computed-traits/preview' \ -H 'Content-Type: application/json' \ -d '{ "definition": { "description": "string", "source": "events", "event": "string", "aggregate": "count", "field": "string", "window": { "type": "ever" }, "currency": "str" }, "profileId": "faebe71b-2bf8-4bdb-9b67-258e4d6aa00a"}'{ "type": "number", "value": 0}Ask the workspace’s data a question POST
A typed query, compiled to one SQL query scoped to the workspace and run read-only with a 60-second limit: an object (see `/v1/catalog` for each one’s fields, which can be filtered and grouped), the fields to return or to group by, filters on its fields and on the person it belongs to (the condition language of segments), aggregates (money grouped by currency, never added across currencies), a sort and a limit of at most 1,000 rows. Answers with the rows, whether they’re all of them, the definitions used and the SQL to read. `dryRun` compiles without running. 422 `query_too_slow` when it runs out of time: narrow it.
List a profile’s computed traits GET
The workspace’s published computed traits with the profile’s value of each now, read live in one query, by name. The built-in ones (orders, total spent, …) are the profile’s metrics.