Ask the workspace’s data a question
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.
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.
apiKey readAuthorizationBearer <token>A workspace API key (pf_…), created under Developers → API keys.
Scope: read
application/json- body
object*string"profile""customer""order""line_item""event""product""product_variant""coupon""coupon_code""store"fields?array<>items <= 50[]where?array<>items <= 20[]profiles?|||||||||groupBy?array<>items <= 5[]aggregates?array<>items <= 10[]sort?array<>items <= 3[]limit?integer1 <= value <= 1000100locale?stringLocale: a language and a country, e.g. nl-NL or en-US
length <= 35dryRun?booleanfalseOK
application/json- response
rows*array<>status*string"complete""truncated""not_run"definitions*array<>sql*curl -X POST 'https://api.postforge.dev/v1/query' \ -H 'Content-Type: application/json' \ -d '{ "object": "profile"}'{ "rows": [ { "property1": null, "property2": null } ], "status": "complete", "definitions": [ { "kind": "segment", "id": "string", "name": "string" } ], "sql": { "text": "string", "params": [ null ] }}Restore a segment version POST
Saves a copy of an older version as the new draft; publish it to use it. Restoring the published version discards the draft’s changes: it is the draft again.
Compute a trait for one profile POST
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.