> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serval.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Entity Aggregation Query

> Filter, group and aggregate the records of one entity type (table) in a single call: count, sum, average, minimum, maximum or percentile of number fields, grouped by up to three fields. Filters apply first and use the same filter_groups as Search Entities. A timestamp group-by field can be bucketed by day, week, month, quarter or year; fiscal_year_start_month moves the quarter and year boundaries. Each row holds the group values followed by the aggregate values, in request order. Without limit every group is returned, and more than 10000 groups is an error; with order_by and limit the top groups are returned and truncated reports that more matched. Use this for totals and breakdowns instead of paging Search Entities and adding up records. Only records the caller can read are counted, and archived records are left out. A hidden field is not found, and a sensitive field is refused. Key and name fields cannot be filtered, grouped or aggregated here.

## Authentication and permissions

> **Token requirements:** **User-based token (OAuth)** or **Organization-scoped API key** or **Workspace-scoped API key**.
>
> Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.

| Credential | Access requirements |
| - | - |
| Organization-scoped API key | `entities:read` |
| Workspace-scoped API key | `entities:read` |
| User-based token (OAuth) | Supported, subject to permissions |

Permissions joined by **+** are all required; **or** separates alternatives. Full-access keys still cannot call endpoints marked unsupported. Workspace keys must allow every workspace checked by the request. OAuth access depends on the user’s roles and resource access.

* **Read records as a workspace:** team\_id is the workspace the caller acts as. Records of databases shared with that workspace ("Can read" or "Can write") are returned from their owning workspaces; an entity type or schema the workspace cannot reach reads as not found (ListEntities, AggregateEntities, RunEntityAggregationQuery) or matches nothing (SearchEntities). Schema, field and row-access rules still apply: RunEntityAggregationQuery counts only the records the caller can read and refuses a filter, group-by or aggregate on a hidden or sensitive field.


## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml post /v2/entities/aggregation-query
openapi: 3.1.0
info:
  title: Serval Public API
  description: Serval Public API
  contact:
    name: Serval
    url: https://serval.com
    email: support@serval.com
  license:
    name: Serval License
    url: https://serval.com/license
  version: 2.0.0
servers:
  - url: https://public.api.serval.com
security:
  - BearerAuth: []
tags:
  - name: Access Membership API
  - name: Access Policy API
  - name: Access Policy Approval Procedure API
  - name: Access Profile API
  - name: Access Relationship API
  - name: Access Request API
  - name: Agent API
  - name: Alerts API
  - name: Analytics API
  - name: App Instance API
  - name: App Resource API
  - name: App Resource Role API
  - name: Approval Delegation API
  - name: Approval Procedure API
  - name: Approval Request API
  - name: Assignment Rules API
  - name: Audit Log API
  - name: Billing API
  - name: Browser API
  - name: Campaign API
  - name: Change Blackout API
  - name: Change Model API
  - name: Connected Channels API
  - name: Custom Field API
  - name: Custom Role API
  - name: Custom Service API
  - name: Dashboards API
  - name: Email Intake API
  - name: Entity API
  - name: Entity Field Mapping API
  - name: Entity Ingestion Config API
  - name: Entity Type API
  - name: Folder API
  - name: Forms API
  - name: Group API
  - name: Guidance API
  - name: Help Agent API
  - name: Improvement Request API
  - name: Journey API
  - name: Knowledge API
  - name: Knowledge Base API
  - name: One-Time Window API
  - name: Package API
  - name: Platform Migration API
  - name: Project API
  - name: Report API
  - name: Review API
  - name: Role Sync API
  - name: Roles API
  - name: SLA API
  - name: Schedule API
  - name: Skills API
  - name: Tag API
  - name: Ticket API
  - name: Ticket Import API
  - name: Ticket Type API
  - name: Topic API
  - name: User API
  - name: User Relationship API
  - name: Widgets API
  - name: Worker API
  - name: Workflow API
  - name: Workflow Approval Procedure API
  - name: Workflow Run API
  - name: Workspace API
  - name: Workspace Group API
  - name: Workspace SDLC Settings API
  - name: Workspace User API
paths:
  /v2/entities/aggregation-query:
    post:
      tags:
        - Entity API
      summary: Run Entity Aggregation Query
      description: >-
        Filter, group and aggregate the records of one entity type (table) in a
        single call: count, sum, average, minimum, maximum or percentile of
        number fields, grouped by up to three fields. Filters apply first and
        use the same filter_groups as Search Entities. A timestamp group-by
        field can be bucketed by day, week, month, quarter or year;
        fiscal_year_start_month moves the quarter and year boundaries. Each row
        holds the group values followed by the aggregate values, in request
        order. Without limit every group is returned, and more than 10000 groups
        is an error; with order_by and limit the top groups are returned and
        truncated reports that more matched. Use this for totals and breakdowns
        instead of paging Search Entities and adding up records. Only records
        the caller can read are counted, and archived records are left out. A
        hidden field is not found, and a sensitive field is refused. Key and
        name fields cannot be filtered, grouped or aggregated here.
      operationId: svrelay.publicv2.PublicAPIServiceV2.RunEntityAggregationQuery
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/svstore.publicapi.RunEntityAggregationQueryRequest
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/svstore.publicapi.RunEntityAggregationQueryResponse
      security:
        - BearerAuth: []
components:
  schemas:
    svstore.publicapi.RunEntityAggregationQueryRequest:
      type: object
      properties:
        teamId:
          type: string
          title: team_id
          description: The ID of the workspace the caller acts as.
          x-stainless-terraform-configurability: optional
        entityTypeId:
          type:
            - string
            - 'null'
          title: entity_type_id
          description: |-
            The entity type to aggregate, with its child types. Exactly one of
             entity_type_id and entity_type_key. A type outside the databases the
             workspace reaches (its own and those shared with it) is not found.
          x-stainless-terraform-configurability: optional
        entityTypeKey:
          type:
            - string
            - 'null'
          title: entity_type_key
          description: >-
            Resolved like SearchEntitiesRequest.entity_type_key: the workspace's
            own
             type wins over a shared type with the same key.
          x-stainless-terraform-configurability: optional
        query:
          $ref: '#/components/schemas/svstore.EntityAggregationQuery'
          title: query
          description: |-
            The filters, group-by fields and aggregates, over the type's records
             that are not archived. A filter names its field by field_key or by
             field_id, the form a saved view stores. A filter on the key or name
             field, and a source_filter, are refused. A hidden field is not found;
             a sensitive field is refused.
          x-stainless-terraform-configurability: optional
        orderBy:
          oneOf:
            - $ref: '#/components/schemas/svstore.publicapi.EntityAggregationOrder'
            - type: 'null'
          title: order_by
          description: >-
            Ranks the groups by one aggregate. Unset orders by each group-by
            value
             in turn, ascending, a group with no value last.
          x-stainless-terraform-configurability: optional
        limit:
          type:
            - integer
            - 'null'
          title: limit
          format: int32
          description: >-
            The most groups to return, 1 to 10000; with order_by, the top
            groups.
             Unset returns every group and fails when there are more than 10000, so
             a caller totalling the rows never totals a partial list.
          x-stainless-terraform-configurability: optional
      title: RunEntityAggregationQueryRequest
      additionalProperties: false
    svstore.publicapi.RunEntityAggregationQueryResponse:
      type: object
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.ListValue'
          title: rows
          description: |-
            One row per group: its group-by values in query.group_by_field_keys
             order, then its aggregate values in query.aggregates order. A group
             value is typed by its field: a number, a boolean, an RFC 3339 instant,
             the bucket's first day (YYYY-MM-DD) for a bucketed field, a record or
             user ID for a reference field, otherwise text. For an ENUM or
             MULTI_SELECT field it is the option's value, or the option's ID when a
             filter would not resolve that value back to the option; either form
             filters the field. A value is null when the group's
             records have none. With no group_by_field_keys there is exactly one
             row, even when no record matches.
          x-stainless-terraform-configurability: optional
        truncated:
          type: boolean
          title: truncated
          description: More groups matched than limit.
          x-stainless-terraform-configurability: computed_optional
      title: RunEntityAggregationQueryResponse
      additionalProperties: false
    svstore.EntityAggregationQuery:
      type: object
      properties:
        filterGroups:
          type: array
          items:
            $ref: '#/components/schemas/svstore.EntityFilterGroup'
          title: filter_groups
          x-stainless-terraform-configurability: optional
        groupByFieldKeys:
          type: array
          items:
            type: string
          title: group_by_field_keys
          description: >-
            Outermost first. Each distinct combination of values is one group;
            with
             none, the whole match is one group. Any field type groups: a TIMESTAMP
             per instant, and a MULTI_SELECT per pick, so an entity with two picks
             counts in both groups.
          x-stainless-terraform-configurability: optional
        aggregates:
          type: array
          items:
            $ref: '#/components/schemas/svstore.EntityAggregate'
          title: aggregates
          x-stainless-terraform-configurability: optional
        groupByBuckets:
          type: array
          items:
            $ref: '#/components/schemas/svstore.EntityGroupByBucket'
          title: group_by_buckets
          description: A bucketed group value is the bucket's first day, YYYY-MM-DD.
          x-stainless-terraform-configurability: optional
        timeZone:
          type:
            - string
            - 'null'
          title: time_zone
          description: |-
            IANA zone the buckets' days are counted in; UTC when unset. Refused
             without group_by_buckets.
          x-stainless-terraform-configurability: optional
        weekStart:
          type:
            - integer
            - 'null'
          title: week_start
          format: int32
          description: |-
            First day of a WEEK bucket, 0 = Sunday to 6 = Saturday; Monday when
             unset. Refused without a WEEK bucket.
          x-stainless-terraform-configurability: optional
        fiscalYearStartMonth:
          type:
            - integer
            - 'null'
          title: fiscal_year_start_month
          format: int32
          description: >-
            First month of the fiscal year, 1 = January to 12 = December;
            January
             when unset. Moves the first day of QUARTER and YEAR buckets: with 2, a
             YEAR bucket runs February to January and its value is that February 1.
             Refused without a QUARTER or YEAR bucket.
          x-stainless-terraform-configurability: optional
      title: EntityAggregationQuery
      additionalProperties: false
    svstore.publicapi.EntityAggregationOrder:
      type: object
      properties:
        aggregateIndex:
          type: integer
          title: aggregate_index
          format: int32
          description: |-
            Position in query.aggregates, from 0, of the aggregate to rank the
             groups by.
          x-stainless-terraform-configurability: optional
        descending:
          type: boolean
          title: descending
          description: >-
            false = smallest first, true = largest first. A group with no value
            for
             the aggregate is last either way.
          x-stainless-terraform-configurability: computed_optional
      title: EntityAggregationOrder
      additionalProperties: false
    google.protobuf.ListValue:
      type: object
      properties:
        values:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Value'
          title: values
          description: Repeated field of dynamically typed values.
          x-stainless-terraform-configurability: optional
      title: ListValue
      additionalProperties: false
      description: |-
        `ListValue` is a wrapper around a repeated field of values.

         The JSON representation for `ListValue` is JSON array.
    svstore.EntityFilterGroup:
      type: object
      properties:
        filters:
          type: array
          items:
            $ref: '#/components/schemas/svstore.EntityFieldFilter'
          title: filters
          description: AND within group
          x-stainless-terraform-configurability: optional
        sourceFilter:
          oneOf:
            - $ref: '#/components/schemas/svstore.EntitySourcePredicate'
            - type: 'null'
          title: source_filter
          x-stainless-terraform-configurability: optional
      title: EntityFilterGroup
      additionalProperties: false
    svstore.EntityAggregate:
      type: object
      properties:
        function:
          $ref: '#/components/schemas/svstore.AggregateFunction'
          title: function
          x-stainless-terraform-configurability: optional
        fieldKey:
          type:
            - string
            - 'null'
          title: field_key
          description: Required for every function but COUNT.
          x-stainless-terraform-configurability: optional
        percentile:
          type:
            - number
            - 'null'
          title: percentile
          format: double
          description: PERCENTILE only, in (0, 1].
          x-stainless-terraform-configurability: optional
      title: EntityAggregate
      additionalProperties: false
    svstore.EntityGroupByBucket:
      type: object
      properties:
        fieldKey:
          type: string
          title: field_key
          description: A TIMESTAMP field named in group_by_field_keys.
          x-stainless-terraform-configurability: optional
        unit:
          $ref: '#/components/schemas/svstore.EntityBucketUnit'
          title: unit
          x-stainless-terraform-configurability: optional
      title: EntityGroupByBucket
      additionalProperties: false
    google.protobuf.Value:
      oneOf:
        - type: 'null'
        - type: number
        - type: string
        - type: boolean
        - type: array
        - type: object
          additionalProperties: true
      description: |-
        `Value` represents a dynamically typed value which can be either
         null, a number, a string, a boolean, a recursive struct value, or a
         list of values. A producer of value is expected to set one of these
         variants. Absence of any variant indicates an error.

         The JSON representation for `Value` is JSON value.
    svstore.EntityFieldFilter:
      type: object
      allOf:
        - properties:
            fieldId:
              type:
                - string
                - 'null'
              title: field_id
              x-stainless-terraform-configurability: optional
            fieldKey:
              type:
                - string
                - 'null'
              title: field_key
              x-stainless-terraform-configurability: optional
        - oneOf:
            - type: object
              properties:
                boolValue:
                  $ref: '#/components/schemas/svstore.BoolPredicate'
                  title: bool_value
                  x-stainless-terraform-configurability: optional
              title: bool_value
              required:
                - boolValue
            - type: object
              properties:
                entityRef:
                  $ref: '#/components/schemas/svstore.ExactStringPredicate'
                  title: entity_ref
                  x-stainless-terraform-configurability: optional
              title: entity_ref
              required:
                - entityRef
            - type: object
              properties:
                enumValue:
                  $ref: '#/components/schemas/svstore.ExactStringPredicate'
                  title: enum_value
                  x-stainless-terraform-configurability: optional
              title: enum_value
              required:
                - enumValue
            - type: object
              properties:
                fileValue:
                  $ref: '#/components/schemas/svstore.ExactStringPredicate'
                  title: file_value
                  description: >-
                    FILE fields support only is-null / is-not-null; other
                    operations on
                     the predicate are rejected at the serialization boundary.
                  x-stainless-terraform-configurability: optional
              title: file_value
              required:
                - fileValue
            - type: object
              properties:
                groupRef:
                  $ref: '#/components/schemas/svstore.ExactStringPredicate'
                  title: group_ref
                  description: >-
                    GROUP_REF fields: eq / ne take an svauth group id or a group
                    name
                     in the organization; is_null / is_not_null check for a value.
                  x-stainless-terraform-configurability: optional
              title: group_ref
              required:
                - groupRef
            - type: object
              properties:
                multiSelectValue:
                  $ref: '#/components/schemas/svstore.MultiSelectPredicate'
                  title: multi_select_value
                  x-stainless-terraform-configurability: optional
              title: multi_select_value
              required:
                - multiSelectValue
            - type: object
              properties:
                number:
                  $ref: '#/components/schemas/svstore.NumberPredicate'
                  title: number
                  x-stainless-terraform-configurability: optional
              title: number
              required:
                - number
            - type: object
              properties:
                text:
                  $ref: '#/components/schemas/svstore.StringPredicate'
                  title: text
                  x-stainless-terraform-configurability: optional
              title: text
              required:
                - text
            - type: object
              properties:
                ticketRef:
                  $ref: '#/components/schemas/svstore.ExactStringPredicate'
                  title: ticket_ref
                  x-stainless-terraform-configurability: optional
              title: ticket_ref
              required:
                - ticketRef
            - type: object
              properties:
                timestamp:
                  $ref: '#/components/schemas/svstore.TimestampPredicate'
                  title: timestamp
                  x-stainless-terraform-configurability: optional
              title: timestamp
              required:
                - timestamp
            - type: object
              properties:
                timestampRange:
                  $ref: '#/components/schemas/svstore.TimestampRangePredicate'
                  title: timestamp_range
                  x-stainless-terraform-configurability: optional
              title: timestamp_range
              required:
                - timestampRange
            - type: object
              properties:
                userRef:
                  $ref: '#/components/schemas/svstore.ExactStringPredicate'
                  title: user_ref
                  x-stainless-terraform-configurability: optional
              title: user_ref
              required:
                - userRef
      title: EntityFieldFilter
      additionalProperties: false
    svstore.EntitySourcePredicate:
      type: object
      properties:
        eq:
          type: string
          title: eq
          description: '**Option: eq**'
          x-stainless-terraform-configurability: optional
        ne:
          type: string
          title: ne
          description: '**Option: ne**'
          x-stainless-terraform-configurability: optional
      title: EntitySourcePredicate
      description: |-
        Built-in entity source supports filtering by source_app_instance_id.

        **Set exactly ONE of:** eq, ne
      additionalProperties: false
    svstore.AggregateFunction:
      type: string
      title: AggregateFunction
      enum:
        - AGGREGATE_FUNCTION_UNSPECIFIED
        - AGGREGATE_FUNCTION_COUNT
        - AGGREGATE_FUNCTION_SUM
        - AGGREGATE_FUNCTION_AVG
        - AGGREGATE_FUNCTION_MIN
        - AGGREGATE_FUNCTION_MAX
        - AGGREGATE_FUNCTION_PERCENTILE
    svstore.EntityBucketUnit:
      type: string
      title: EntityBucketUnit
      enum:
        - ENTITY_BUCKET_UNIT_UNSPECIFIED
        - ENTITY_BUCKET_UNIT_DAY
        - ENTITY_BUCKET_UNIT_WEEK
        - ENTITY_BUCKET_UNIT_MONTH
        - ENTITY_BUCKET_UNIT_QUARTER
        - ENTITY_BUCKET_UNIT_YEAR
    svstore.BoolPredicate:
      type: object
      oneOf:
        - $ref: '#/components/schemas/svstore.BoolPredicate.Eq'
        - $ref: '#/components/schemas/svstore.BoolPredicate.IsNotNull'
        - $ref: '#/components/schemas/svstore.BoolPredicate.IsNull'
        - $ref: '#/components/schemas/svstore.BoolPredicate.Ne'
      title: BoolPredicate
    svstore.ExactStringPredicate:
      type: object
      oneOf:
        - $ref: '#/components/schemas/svstore.ExactStringPredicate.Eq'
        - $ref: '#/components/schemas/svstore.ExactStringPredicate.InList'
        - $ref: '#/components/schemas/svstore.ExactStringPredicate.IsNotNull'
        - $ref: '#/components/schemas/svstore.ExactStringPredicate.IsNull'
        - $ref: '#/components/schemas/svstore.ExactStringPredicate.Ne'
        - $ref: '#/components/schemas/svstore.ExactStringPredicate.NotInList'
        - $ref: '#/components/schemas/svstore.ExactStringPredicate.ViewerRelation'
      title: ExactStringPredicate
    svstore.MultiSelectPredicate:
      type: object
      oneOf:
        - $ref: '#/components/schemas/svstore.MultiSelectPredicate.Contains'
        - $ref: '#/components/schemas/svstore.MultiSelectPredicate.ContainsAll'
        - $ref: '#/components/schemas/svstore.MultiSelectPredicate.ContainsAny'
        - $ref: '#/components/schemas/svstore.MultiSelectPredicate.DoesNotContain'
        - $ref: '#/components/schemas/svstore.MultiSelectPredicate.IsNotNull'
        - $ref: '#/components/schemas/svstore.MultiSelectPredicate.IsNull'
      title: MultiSelectPredicate
    svstore.NumberPredicate:
      type: object
      oneOf:
        - $ref: '#/components/schemas/svstore.NumberPredicate.Eq'
        - $ref: '#/components/schemas/svstore.NumberPredicate.Gt'
        - $ref: '#/components/schemas/svstore.NumberPredicate.Gte'
        - $ref: '#/components/schemas/svstore.NumberPredicate.IsNotNull'
        - $ref: '#/components/schemas/svstore.NumberPredicate.IsNull'
        - $ref: '#/components/schemas/svstore.NumberPredicate.Lt'
        - $ref: '#/components/schemas/svstore.NumberPredicate.Lte'
        - $ref: '#/components/schemas/svstore.NumberPredicate.Ne'
      title: NumberPredicate
    svstore.StringPredicate:
      type: object
      oneOf:
        - $ref: '#/components/schemas/svstore.StringPredicate.Contains'
        - $ref: '#/components/schemas/svstore.StringPredicate.DoesNotContain'
        - $ref: '#/components/schemas/svstore.StringPredicate.EndsWith'
        - $ref: '#/components/schemas/svstore.StringPredicate.Eq'
        - $ref: '#/components/schemas/svstore.StringPredicate.InList'
        - $ref: '#/components/schemas/svstore.StringPredicate.IsNotNull'
        - $ref: '#/components/schemas/svstore.StringPredicate.IsNull'
        - $ref: '#/components/schemas/svstore.StringPredicate.Like'
        - $ref: '#/components/schemas/svstore.StringPredicate.Ne'
        - $ref: '#/components/schemas/svstore.StringPredicate.StartsWith'
      title: StringPredicate
    svstore.TimestampPredicate:
      type: object
      oneOf:
        - $ref: '#/components/schemas/svstore.TimestampPredicate.Eq'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.Gt'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.Gte'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.InLast'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.InNext'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.IsNotNull'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.IsNull'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.Lt'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.Lte'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.Ne'
        - $ref: '#/components/schemas/svstore.TimestampPredicate.NotInLast'
      title: TimestampPredicate
    svstore.TimestampRangePredicate:
      type: object
      oneOf:
        - $ref: '#/components/schemas/svstore.TimestampRangePredicate.Contains'
        - $ref: '#/components/schemas/svstore.TimestampRangePredicate.InLast'
        - $ref: '#/components/schemas/svstore.TimestampRangePredicate.InNext'
        - $ref: '#/components/schemas/svstore.TimestampRangePredicate.IsNotNull'
        - $ref: '#/components/schemas/svstore.TimestampRangePredicate.IsNull'
        - $ref: '#/components/schemas/svstore.TimestampRangePredicate.NotInLast'
        - $ref: '#/components/schemas/svstore.TimestampRangePredicate.Overlaps'
      title: TimestampRangePredicate
      description: |-
        Filters a TIMESTAMP_RANGE field. Values are half-open windows
         [start, end): a value includes its start and excludes its end.
    svstore.BoolPredicate.Eq:
      type: object
      title: Eq
      properties:
        eq:
          type: boolean
          title: eq
          x-stainless-terraform-configurability: optional
      required:
        - eq
      additionalProperties: false
    svstore.BoolPredicate.IsNotNull:
      type: object
      title: Is Not Null
      properties:
        isNotNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_not_null
          x-stainless-terraform-configurability: optional
      required:
        - isNotNull
      additionalProperties: false
    svstore.BoolPredicate.IsNull:
      type: object
      title: Is Null
      properties:
        isNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_null
          x-stainless-terraform-configurability: optional
      required:
        - isNull
      additionalProperties: false
    svstore.BoolPredicate.Ne:
      type: object
      title: Ne
      properties:
        ne:
          type: boolean
          title: ne
          x-stainless-terraform-configurability: optional
      required:
        - ne
      additionalProperties: false
    svstore.ExactStringPredicate.Eq:
      type: object
      title: Eq
      properties:
        eq:
          type: string
          title: eq
          x-stainless-terraform-configurability: optional
      required:
        - eq
      additionalProperties: false
    svstore.ExactStringPredicate.InList:
      type: object
      title: In List
      properties:
        inList:
          $ref: '#/components/schemas/svstore.StringListValue'
          title: in_list
          description: |-
            Matches a value equal to any of the listed ones. enum_value takes
             option ids or option values; the reference predicates take ids.
             At least one value is required. file_value takes no list.
          x-stainless-terraform-configurability: optional
      required:
        - inList
      additionalProperties: false
      description: |-
        Matches a value equal to any of the listed ones. enum_value takes
         option ids or option values; the reference predicates take ids.
         At least one value is required. file_value takes no list.
    svstore.ExactStringPredicate.IsNotNull:
      type: object
      title: Is Not Null
      properties:
        isNotNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_not_null
          x-stainless-terraform-configurability: optional
      required:
        - isNotNull
      additionalProperties: false
    svstore.ExactStringPredicate.IsNull:
      type: object
      title: Is Null
      properties:
        isNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_null
          x-stainless-terraform-configurability: optional
      required:
        - isNull
      additionalProperties: false
    svstore.ExactStringPredicate.Ne:
      type: object
      title: Ne
      properties:
        ne:
          type: string
          title: ne
          x-stainless-terraform-configurability: optional
      required:
        - ne
      additionalProperties: false
    svstore.ExactStringPredicate.NotInList:
      type: object
      title: Not In List
      properties:
        notInList:
          $ref: '#/components/schemas/svstore.StringListValue'
          title: not_in_list
          description: |-
            Matches a value equal to none of the listed ones, under the same
             rules as in_list. Like ne, it never matches an entity with no value
             for the field.
          x-stainless-terraform-configurability: optional
      required:
        - notInList
      additionalProperties: false
      description: |-
        Matches a value equal to none of the listed ones, under the same
         rules as in_list. Like ne, it never matches an entity with no value
         for the field.
    svstore.ExactStringPredicate.ViewerRelation:
      type: object
      title: Viewer Relation
      properties:
        viewerRelation:
          $ref: '#/components/schemas/svstore.EntityViewerRelation'
          title: viewer_relation
          description: Equality against the viewer relation's users. user_ref only.
          x-stainless-terraform-configurability: optional
      required:
        - viewerRelation
      additionalProperties: false
      description: Equality against the viewer relation's users. user_ref only.
    svstore.MultiSelectPredicate.Contains:
      type: object
      title: Contains
      properties:
        contains:
          type: string
          title: contains
          x-stainless-terraform-configurability: optional
      required:
        - contains
      additionalProperties: false
    svstore.MultiSelectPredicate.ContainsAll:
      type: object
      title: Contains All
      properties:
        containsAll:
          $ref: '#/components/schemas/svstore.StringListValue'
          title: contains_all
          x-stainless-terraform-configurability: optional
      required:
        - containsAll
      additionalProperties: false
    svstore.MultiSelectPredicate.ContainsAny:
      type: object
      title: Contains Any
      properties:
        containsAny:
          $ref: '#/components/schemas/svstore.StringListValue'
          title: contains_any
          x-stainless-terraform-configurability: optional
      required:
        - containsAny
      additionalProperties: false
    svstore.MultiSelectPredicate.DoesNotContain:
      type: object
      title: Does Not Contain
      properties:
        doesNotContain:
          type: string
          title: does_not_contain
          x-stainless-terraform-configurability: optional
      required:
        - doesNotContain
      additionalProperties: false
    svstore.MultiSelectPredicate.IsNotNull:
      type: object
      title: Is Not Null
      properties:
        isNotNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_not_null
          x-stainless-terraform-configurability: optional
      required:
        - isNotNull
      additionalProperties: false
    svstore.MultiSelectPredicate.IsNull:
      type: object
      title: Is Null
      properties:
        isNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_null
          x-stainless-terraform-configurability: optional
      required:
        - isNull
      additionalProperties: false
    svstore.NumberPredicate.Eq:
      type: object
      title: Eq
      properties:
        eq:
          type: number
          title: eq
          format: double
          x-stainless-terraform-configurability: optional
      required:
        - eq
      additionalProperties: false
    svstore.NumberPredicate.Gt:
      type: object
      title: Gt
      properties:
        gt:
          type: number
          title: gt
          format: double
          x-stainless-terraform-configurability: optional
      required:
        - gt
      additionalProperties: false
    svstore.NumberPredicate.Gte:
      type: object
      title: Gte
      properties:
        gte:
          type: number
          title: gte
          format: double
          x-stainless-terraform-configurability: optional
      required:
        - gte
      additionalProperties: false
    svstore.NumberPredicate.IsNotNull:
      type: object
      title: Is Not Null
      properties:
        isNotNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_not_null
          x-stainless-terraform-configurability: optional
      required:
        - isNotNull
      additionalProperties: false
    svstore.NumberPredicate.IsNull:
      type: object
      title: Is Null
      properties:
        isNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_null
          x-stainless-terraform-configurability: optional
      required:
        - isNull
      additionalProperties: false
    svstore.NumberPredicate.Lt:
      type: object
      title: Lt
      properties:
        lt:
          type: number
          title: lt
          format: double
          x-stainless-terraform-configurability: optional
      required:
        - lt
      additionalProperties: false
    svstore.NumberPredicate.Lte:
      type: object
      title: Lte
      properties:
        lte:
          type: number
          title: lte
          format: double
          x-stainless-terraform-configurability: optional
      required:
        - lte
      additionalProperties: false
    svstore.NumberPredicate.Ne:
      type: object
      title: Ne
      properties:
        ne:
          type: number
          title: ne
          format: double
          x-stainless-terraform-configurability: optional
      required:
        - ne
      additionalProperties: false
    svstore.StringPredicate.Contains:
      type: object
      title: Contains
      properties:
        contains:
          type: string
          title: contains
          x-stainless-terraform-configurability: optional
      required:
        - contains
      additionalProperties: false
    svstore.StringPredicate.DoesNotContain:
      type: object
      title: Does Not Contain
      properties:
        doesNotContain:
          type: string
          title: does_not_contain
          x-stainless-terraform-configurability: optional
      required:
        - doesNotContain
      additionalProperties: false
    svstore.StringPredicate.EndsWith:
      type: object
      title: Ends With
      properties:
        endsWith:
          type: string
          title: ends_with
          x-stainless-terraform-configurability: optional
      required:
        - endsWith
      additionalProperties: false
    svstore.StringPredicate.Eq:
      type: object
      title: Eq
      properties:
        eq:
          type: string
          title: eq
          x-stainless-terraform-configurability: optional
      required:
        - eq
      additionalProperties: false
    svstore.StringPredicate.InList:
      type: object
      title: In List
      properties:
        inList:
          $ref: '#/components/schemas/svstore.StringListValue'
          title: in_list
          x-stainless-terraform-configurability: optional
      required:
        - inList
      additionalProperties: false
    svstore.StringPredicate.IsNotNull:
      type: object
      title: Is Not Null
      properties:
        isNotNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_not_null
          x-stainless-terraform-configurability: optional
      required:
        - isNotNull
      additionalProperties: false
    svstore.StringPredicate.IsNull:
      type: object
      title: Is Null
      properties:
        isNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_null
          x-stainless-terraform-configurability: optional
      required:
        - isNull
      additionalProperties: false
    svstore.StringPredicate.Like:
      type: object
      title: Like
      properties:
        like:
          type: string
          title: like
          x-stainless-terraform-configurability: optional
      required:
        - like
      additionalProperties: false
    svstore.StringPredicate.Ne:
      type: object
      title: Ne
      properties:
        ne:
          type: string
          title: ne
          x-stainless-terraform-configurability: optional
      required:
        - ne
      additionalProperties: false
    svstore.StringPredicate.StartsWith:
      type: object
      title: Starts With
      properties:
        startsWith:
          type: string
          title: starts_with
          x-stainless-terraform-configurability: optional
      required:
        - startsWith
      additionalProperties: false
    svstore.TimestampPredicate.Eq:
      type: object
      title: Eq
      properties:
        eq:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: eq
          x-stainless-terraform-configurability: optional
      required:
        - eq
      additionalProperties: false
    svstore.TimestampPredicate.Gt:
      type: object
      title: Gt
      properties:
        gt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: gt
          x-stainless-terraform-configurability: optional
      required:
        - gt
      additionalProperties: false
    svstore.TimestampPredicate.Gte:
      type: object
      title: Gte
      properties:
        gte:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: gte
          x-stainless-terraform-configurability: optional
      required:
        - gte
      additionalProperties: false
    svstore.TimestampPredicate.InLast:
      type: object
      title: In Last
      properties:
        inLast:
          $ref: '#/components/schemas/svstore.RelativeDateWindow'
          title: in_last
          description: |-
            The relative arms cover a half-open window that includes all of
             today. not_in_last matches only entities that have a value outside
             the window, never entities with no value for the field.
          x-stainless-terraform-configurability: optional
      required:
        - inLast
      additionalProperties: false
      description: |-
        The relative arms cover a half-open window that includes all of
         today. not_in_last matches only entities that have a value outside
         the window, never entities with no value for the field.
    svstore.TimestampPredicate.InNext:
      type: object
      title: In Next
      properties:
        inNext:
          $ref: '#/components/schemas/svstore.RelativeDateWindow'
          title: in_next
          x-stainless-terraform-configurability: optional
      required:
        - inNext
      additionalProperties: false
    svstore.TimestampPredicate.IsNotNull:
      type: object
      title: Is Not Null
      properties:
        isNotNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_not_null
          x-stainless-terraform-configurability: optional
      required:
        - isNotNull
      additionalProperties: false
    svstore.TimestampPredicate.IsNull:
      type: object
      title: Is Null
      properties:
        isNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_null
          x-stainless-terraform-configurability: optional
      required:
        - isNull
      additionalProperties: false
    svstore.TimestampPredicate.Lt:
      type: object
      title: Lt
      properties:
        lt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: lt
          x-stainless-terraform-configurability: optional
      required:
        - lt
      additionalProperties: false
    svstore.TimestampPredicate.Lte:
      type: object
      title: Lte
      properties:
        lte:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: lte
          x-stainless-terraform-configurability: optional
      required:
        - lte
      additionalProperties: false
    svstore.TimestampPredicate.Ne:
      type: object
      title: Ne
      properties:
        ne:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: ne
          x-stainless-terraform-configurability: optional
      required:
        - ne
      additionalProperties: false
    svstore.TimestampPredicate.NotInLast:
      type: object
      title: Not In Last
      properties:
        notInLast:
          $ref: '#/components/schemas/svstore.RelativeDateWindow'
          title: not_in_last
          x-stainless-terraform-configurability: optional
      required:
        - notInLast
      additionalProperties: false
    svstore.TimestampRangePredicate.Contains:
      type: object
      title: Contains
      properties:
        contains:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: contains
          description: 'Matches values in progress at the instant: start <= instant < end.'
          x-stainless-terraform-configurability: optional
      required:
        - contains
      additionalProperties: false
      description: 'Matches values in progress at the instant: start <= instant < end.'
    svstore.TimestampRangePredicate.InLast:
      type: object
      title: In Last
      properties:
        inLast:
          $ref: '#/components/schemas/svstore.RelativeDateWindow'
          title: in_last
          description: |-
            The relative arms resolve to the same window as TimestampPredicate's
             (a half-open window that includes all of today) and match values
             that overlap it. not_in_last matches only entities that have a value
             which does not overlap the window, never entities with no value for
             the field.
          x-stainless-terraform-configurability: optional
      required:
        - inLast
      additionalProperties: false
      description: |-
        The relative arms resolve to the same window as TimestampPredicate's
         (a half-open window that includes all of today) and match values
         that overlap it. not_in_last matches only entities that have a value
         which does not overlap the window, never entities with no value for
         the field.
    svstore.TimestampRangePredicate.InNext:
      type: object
      title: In Next
      properties:
        inNext:
          $ref: '#/components/schemas/svstore.RelativeDateWindow'
          title: in_next
          x-stainless-terraform-configurability: optional
      required:
        - inNext
      additionalProperties: false
    svstore.TimestampRangePredicate.IsNotNull:
      type: object
      title: Is Not Null
      properties:
        isNotNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_not_null
          x-stainless-terraform-configurability: optional
      required:
        - isNotNull
      additionalProperties: false
    svstore.TimestampRangePredicate.IsNull:
      type: object
      title: Is Null
      properties:
        isNull:
          $ref: '#/components/schemas/google.protobuf.Empty'
          title: is_null
          x-stainless-terraform-configurability: optional
      required:
        - isNull
      additionalProperties: false
    svstore.TimestampRangePredicate.NotInLast:
      type: object
      title: Not In Last
      properties:
        notInLast:
          $ref: '#/components/schemas/svstore.RelativeDateWindow'
          title: not_in_last
          x-stainless-terraform-configurability: optional
      required:
        - notInLast
      additionalProperties: false
    svstore.TimestampRangePredicate.Overlaps:
      type: object
      title: Overlaps
      properties:
        overlaps:
          $ref: '#/components/schemas/svstore.TimestampWindow'
          title: overlaps
          description: |-
            Matches values that share at least one instant with the window.
             Windows that only meet do not overlap: a value [02:00, 04:00) does
             not overlap the window [04:00, 06:00).
          x-stainless-terraform-configurability: optional
      required:
        - overlaps
      additionalProperties: false
      description: |-
        Matches values that share at least one instant with the window.
         Windows that only meet do not overlap: a value [02:00, 04:00) does
         not overlap the window [04:00, 06:00).
    google.protobuf.Empty:
      type: object
      description: |-
        A generic empty message that you can re-use to avoid defining duplicated
         empty messages in your APIs. A typical example is to use it as the request
         or the response type of an API method. For instance:

             service Foo {
               rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
             }
    svstore.StringListValue:
      type: object
      properties:
        values:
          type: array
          items:
            type: string
          title: values
          x-stainless-terraform-configurability: optional
      title: StringListValue
      additionalProperties: false
      description: |-
        Object Search Types
         Predicates make allowed operator/value pairings explicit via oneof branches.
    svstore.EntityViewerRelation:
      type: string
      title: EntityViewerRelation
      enum:
        - ENTITY_VIEWER_RELATION_UNSPECIFIED
        - ENTITY_VIEWER_RELATION_VIEWER
        - ENTITY_VIEWER_RELATION_VIEWERS_MANAGER
        - ENTITY_VIEWER_RELATION_VIEWERS_DIRECT_REPORTS
      description: |-
        A USER_REF operand resolved against whoever runs the query: the viewer,
         the viewer's manager, or the viewer's direct reports. Stored unresolved in
         saved views and dynamic permissions; a request with no viewer (an API
         key, a worker) matches nothing.
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2025-01-15T01:30:15.000Z'
        - '2025-06-01T00:00:00.000Z'
      format: date-time
      description: A timestamp in RFC 3339 format (e.g., "2025-01-15T01:30:15Z").
    svstore.RelativeDateWindow:
      type: object
      properties:
        count:
          type: integer
          title: count
          description: |-
            Units back (in_last / not_in_last) or forward (in_next) from today.
             Must be greater than zero.
          x-stainless-terraform-configurability: optional
        unit:
          $ref: '#/components/schemas/svstore.RelativeDateUnit'
          title: unit
          x-stainless-terraform-configurability: optional
        timeZone:
          type: string
          title: time_zone
          description: |-
            IANA zone whose midnights bound the window, e.g. "America/New_York";
             empty resolves in UTC. Send the zone of whoever reads the results, so
             "today" means their today.
          x-stainless-terraform-configurability: optional
      title: RelativeDateWindow
      additionalProperties: false
      description: >-
        A window of whole calendar days measured from today, resolved against
        the
         clock when the query runs rather than when the filter was written: a saved
         view filtering "in the last 7 days" still means that tomorrow.
    svstore.TimestampWindow:
      type: object
      properties:
        start:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: start
          x-stainless-terraform-configurability: optional
        end:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: end
          x-stainless-terraform-configurability: optional
      title: TimestampWindow
      additionalProperties: false
      description: >-
        A half-open window [start, end): it includes start and excludes end.
        Both
         ends are required, and start must be before end.
    svstore.RelativeDateUnit:
      type: string
      title: RelativeDateUnit
      enum:
        - RELATIVE_DATE_UNIT_UNSPECIFIED
        - RELATIVE_DATE_UNIT_DAY
        - RELATIVE_DATE_UNIT_WEEK
        - RELATIVE_DATE_UNIT_MONTH
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.