---
title: "Preview consolidation strategies"
method: POST
path: "/v1/default/banks/{bank_id}/consolidation-strategies/preview"
tags: ["Memory"]
---

# Preview consolidation strategies

`POST /v1/default/banks/{bank_id}/consolidation-strategies/preview`

## Request

- Base URL: `https://hindsight.vectorize.io` (the document declares no server; this is the origin it was published from)
- URL: `https://hindsight.vectorize.io/v1/default/banks/{bank_id}/consolidation-strategies/preview`
- Auth: none declared
- TypeScript: <https://skmtc.dev/vectorize/apis/hindsight-http-api/docs/v1/default/banks/:bank_id/consolidation-strategies/preview/post.ts> (a function with typed inputs; its response is checked against the schema)

Report which of the bank's existing observation scopes each consolidation strategy would apply to, for a draft `consolidation_strategies` value (nothing is saved). Uses the same matching and first-strategy-wins rule as consolidation. Scans up to 10,000 distinct scopes; `complete` is false beyond that and the counts are lower bounds. Scopes with no observations yet do not exist and are not counted.

## Path parameters

- `bank_id` string, required

## Headers

- `authorization` string, nullable

## Request body

- ConsolidationStrategiesPreviewRequest: A draft consolidation_strategies value to preview against existing scopes.
  - `strategies` ConsolidationStrategySpec[], required: Draft consolidation_strategies value
    - `scopes` ConsolidationScopePattern[]: Alternatives: the strategy claims a scope when any rule matches it
      - `tags` string[]: fnmatch tag patterns, e.g. company:*
      - `tags_match` string, nullable: "all" (the default when omitted): the scope has every tag in the rule, other tags allowed. "exact": exactly these tags and no others.
    - `observations_mission` string, nullable
    - `max_observations_per_scope` integer, nullable
    - `consolidation_source_facts_max_tokens` integer, nullable
    - `consolidation_source_facts_max_tokens_per_observation` integer, nullable
  - `sample_limit` integer: Example scopes returned per rule

## Response `200`

Successful Response

- ConsolidationStrategiesPreview: Which existing observation scopes each consolidation strategy would apply to.
  - `strategies` StrategyPreview[], required
    - `active` boolean, required: False when the server would ignore this strategy (no usable rule, or no setting)
    - `claimed_count` integer, required: Existing scopes this strategy actually applies to
    - `rules` StrategyRulePreview[], required: One entry per rule, aligned with the request
      - `match_count` integer, required: Existing scopes this rule matches
      - `taken_count` integer, required: Of those, how many an earlier strategy wins, so this one has no effect
      - `observation_count` integer, required: Observations across the matching scopes
      - `samples` StrategyScopePreview[], required: The most populous matching scopes, up to sample_limit
        - `tags` string[], required: The scope's tags (sorted)
        - `count` integer, required: Observations in this scope
        - `handled_by` integer, nullable, required: Index of the strategy that actually applies to this scope (the first that claims it), or null when no strategy does and Default applies
  - `default` DefaultScopesPreview, required: The scopes no strategy claims — they consolidate under the bank-wide settings.
    - `match_count` integer, required
    - `observation_count` integer, required
    - `samples` StrategyScopePreview[], required
      - `tags` string[], required: The scope's tags (sorted)
      - `count` integer, required: Observations in this scope
      - `handled_by` integer, nullable, required: Index of the strategy that actually applies to this scope (the first that claims it), or null when no strategy does and Default applies
  - `scopes_scanned` integer, required: Distinct scopes the preview was computed over
  - `complete` boolean, required: False when the bank has more distinct scopes than the preview scans; counts are then lower bounds

## Other responses

- `404`: The bank does not exist.
- `422`: Validation Error

## Changes

- **2026-10-04** `4fda98b75f63`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vectorize/apis/hindsight-http-api/changes/v1/default/banks/:bank_id/consolidation-strategies/preview/post.md)

---

[API](https://skmtc.dev/vectorize/apis/hindsight-http-api.md) - [All operations](https://skmtc.dev/vectorize/apis/hindsight-http-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vectorize/apis/hindsight-http-api/revisions/951fd4ce91d1?raw)
