Skip to main content
POST
Create a group

Authorizations

Authorization
string
header
required

An organization API key. Keys carry a role (read_write or read_only) and may be restricted to a namespace prefix such as acme/*, or to one namespace such as acme/prod/tenant_1. A prefix matches on a / boundary: acme/prod/tenant_1* covers acme/prod/tenant_1 and everything under acme/prod/tenant_1/, never acme/prod/tenant_12.

Headers

Idempotency-Key
string

One key per logical request, reused only on its retries. A key belongs to one request: within your organization, the same method, path, query and body. For 24 hours after a successful response, a request with the key and the same body gets that response back verbatim, with Idempotent-Replayed: true, and runs nothing. Only a successful response is kept, so the retry of a request that failed runs again. While the first request runs or its response is kept, the key with a different request is idempotency_key_reused (422). A request sent while one with its key is still running is rate_limited with Retry-After: 1, without running: retry it to get the first one's response. In the rare case the key can't be checked, the request runs as if it had none.

Required string length: 1 - 255

Path Parameters

ns
string
required

A namespace name, or a template prefix ending in /*, with any / sent as %2F: acme%2Fprod%2Ftenant_123 or acme%2Fprod%2F*.

A namespace name, or a template prefix: a namespace path ending in /*, such as acme/prod/*, which every namespace under acme/prod/ inherits judgments from. Up to 256 bytes. Never exactly . or .., which a URL path can't carry.

Required string length: 1 - 256
Pattern: ^(?!\.\.?$)[A-Za-z0-9._:/-]+(/\*)?$

Body

application/json

A group definition.

name
string
required

A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9_-]+$
key
string
required

The attribute whose values the group is kept per, such as attributes.plan. A document with no value there belongs to no key value.

Pattern: ^attributes\.[A-Za-z0-9_-]+$
aggregate
object
required

What the group keeps per key value, over the documents matching match, exact as of the group's as_of. At most 8 paths in total. count_where counts documents by one active, on_change judgment's answers, which may read other documents but not be a composite or have features, with the roll-up rules: answers.<j>.value or .thresholds.<name> by equality or {"not": <value>}, .p or .score by a cut. A judgment that chooses among candidates (options.from) is counted only by whether its value is none_of_the_above, such as the payments that settled any invoice, by month. While a group counts a judgment, activating a version of it that is a composite, has features, or chooses among candidates when the group counts more than that is conflict, and details.readers names group <name>, since a group counts the stored answers and would not count what other readers read. A group is one more level in the chain of answer reads, three deep at most. sum, avg, min and max read document paths only.

match
object

Which documents count. All documents when absent.

keep_keys
string

A key value whose newest matching document was created longer ago than this is not live, and leaves the rows and the 1,000 cap. Defaults to 90d.

Pattern: ^[1-9][0-9]*[smhd]$

Response

The group, building, with its group_build job in job_id.

A group, its status and, on get in a namespace, its rows.

name
string
required

A judgment, attribute or threshold name. Names are path segments in field references, so they never contain ..

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9_-]+$
key
string
required
Pattern: ^attributes\.[A-Za-z0-9_-]+$
aggregate
object
required

What the group keeps per key value, over the documents matching match, exact as of the group's as_of. At most 8 paths in total. count_where counts documents by one active, on_change judgment's answers, which may read other documents but not be a composite or have features, with the roll-up rules: answers.<j>.value or .thresholds.<name> by equality or {"not": <value>}, .p or .score by a cut. A judgment that chooses among candidates (options.from) is counted only by whether its value is none_of_the_above, such as the payments that settled any invoice, by month. While a group counts a judgment, activating a version of it that is a composite, has features, or chooses among candidates when the group counts more than that is conflict, and details.readers names group <name>, since a group counts the stored answers and would not count what other readers read. A group is one more level in the chain of answer reads, three deep at most. sum, avg, min and max read document paths only.

keep_keys
string
required

A whole number and a unit (s, m, h or d), such as 7d or 1h.

Pattern: ^[1-9][0-9]*[smhd]$
status
enum<string>
required

building until its group_build job has computed the aggregates, then ready.

Available options:
building,
ready
created_at
string<date-time>
required

RFC 3339, UTC.

match
object

Which documents something applies to, by their attributes. Each key is an attribute path; a value is equality, and a list of values is In, as in query filters. Keys combine with And.

template
string

Present when the group is inherited, the template prefix it comes from.

Required string length: 1 - 256
Pattern: ^(?!\.\.?$)[A-Za-z0-9._:/-]+(/\*)?$
job_id
string | null

The group_build job, while it runs.

live_keys
integer | null

Live key values now; null on a template's prefix path.

Required range: x >= 0
warnings
enum<string>[]

group_over_cap: more than 1,000 live key values. The rows hold the 1,000 largest by count until key values age out past keep_keys.

Available options:
group_over_cap
as_of
integer<int64> | null

The namespace position the rows are exact at. Absent from lists and on a template's prefix path.

Required range: x >= 0
rows
object[] | null

On get in a namespace, one row per live key value, the largest count first. Null on a template's prefix path, absent from lists.

Maximum array length: 1000