> For the complete documentation index, see [llms.txt](https://docs.nullify.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nullify.ai/api-reference/api-reference/context/documents-memories-and-reports.md).

# Documents, memories, and reports

Manage the organization knowledge your tenant gives Nullify: vault documents you upload, the memories that agents and users record, the organization classification, and generated package reports. All calls need an `Authorization: Bearer <TOKEN>` header; see [Authentication](/api-reference/api-reference/authentication.md). Read calls require the `ConfigRead` permission and write calls require `ConfigWrite`.

## Vault files

The vault holds documents you upload (architecture notes, policies, runbooks). Files are only searchable once they are indexed. Allowed extensions are `.txt`, `.json`, `.yaml`, `.yml`, `.xml`, `.csv`, `.md`, `.pdf`, `.docx`, `.png`, `.jpg`, `.jpeg`, `.gif`, `.webp` and `.svg` (indexed), plus `.doc`, `.xls`, `.xlsx`, `.zip`, `.tar`, `.gz` and `.7z`, which upload and download but are skipped by the indexer.

### Upload a vault file

Returns a presigned upload URL; the file bytes never go through this call. Send `fileName` (required, at most 256 characters, no `/`, `\` or `..`, and an allowed extension) and optionally `description` (at most 4096 characters) and `size` in bytes. When `size` is positive (maximum 100 MB) the URL is pinned to that exact `Content-Length`, so an upload of a different size is rejected. The response carries `fileId` and `documentId`. `PUT` the file to `presignedUploadURL`, then call [Index vault files](#index-vault-files) with the `fileId` so the document becomes searchable.

```bash
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <TOKEN>" \
  -d '{"fileName": "architecture.pdf", "description": "Service architecture overview", "size": 482113}' \
  'https://api.<TENANT>.nullify.ai/context/vault/file'
```

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/file" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### List vault files

Returns a page of files with a presigned download URL, `fileId`, `fileName`, uploader, `createdAt`, `documentId` and `contentType`, plus `totalCount` across all pages. Use `limit` (1 to 1000; larger values are clamped to 1000) and `offset` to page, and `search` for a case-insensitive substring match on the file name. With no `limit`, every file is returned. Each file with a `documentId` carries an `indexed` flag showing whether its document is in the search index; the flag is omitted if the index could not be read. A tenant with too many files to enumerate gets a resource-exhausted error and should narrow with `search`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/files" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### List vault file names

Returns a lightweight list of `fileName`, `description` and `documentId` for every file, without presigned URLs, paging or an indexed marker. Use it to build a picker or check which names already exist.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/files/list" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Get a vault file

Returns the metadata and a fresh presigned download URL for one file. `fileId` comes from [List vault files](#list-vault-files) or [Upload a vault file](#upload-a-vault-file). An unknown id returns `404`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/file/{fileId}" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Update vault file metadata

Updates the stored metadata of the file identified by its file name (not its id) in the path. The body accepts `metadata` (a free-form object), `documentId` and `processedAt`. The response is a success flag and message only.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/file/{fileName}" method="patch" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Delete a vault file

Deletes the file from the vault, removes its indexed chunks from the search index, and forgets the memories derived from its document. The memories keep their audit history. Deletion cannot be undone. Index cleanup is best effort: if it fails the file is still deleted and the next [RAG resync](#resync-the-knowledge-base) removes the orphaned chunks. If the file's document id cannot be read because of a transient storage fault the call returns `503` (or `504` on timeout) and nothing is deleted, so retry. A successful delete returns an empty body.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/file/{fileId}" method="delete" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

## Indexing and search

Indexing chunks a vault document and embeds it so it can be searched. Both indexing calls queue work and return before it finishes.

### Index vault files

Queues chunking and embedding of the listed `fileIDs` (at least one, none blank) into the knowledge base. It is additive, never deletes anything, and does not run organization-context extraction. A success response means the request was queued, not that indexing finished; there is no status endpoint for this call, so confirm completion by checking the `indexed` flag from [List vault files](#list-vault-files). Call it after each upload. Use [Trigger vault onboarding](#trigger-vault-onboarding) for the setup wizard flow and [Resync the knowledge base](#resync-the-knowledge-base) for tenant-wide reconciliation.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/index" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Search vault documents

Hybrid semantic and keyword search over indexed vault documents. `query` is required. `limit` is 1 to 50, `documentIds` restricts the search to specific documents and `docTypes` to document types. Each result is a passage with `documentId`, `fileName`, page or line range, `text` and a relevance `score`. If the embedding service is unavailable the search falls back to keyword matching only, which is not visible in the response. Files that are not yet indexed are not searched.

```bash
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <TOKEN>" \
  -d '{"query": "how are production secrets rotated", "limit": 5}' \
  'https://api.<TENANT>.nullify.ai/context/vault/search'
```

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/search" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Get vault document text

Returns the extracted text of an indexed document by `documentId` (from the file list). Narrow with `startPage` and `endPage` (1-based, inclusive, end not before start). `maxChars` defaults to and is capped at 60000. A document too large to read whole returns `400` with advice to set `maxChars` and page, narrow the pages, or use search; when `maxChars` is set, a response with `truncated: true` carries a `nextToken` to pass back for the next slice. A document that is not indexed returns `404`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/document/{documentId}/text" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Trigger vault onboarding

Records an asynchronous onboarding run over the listed vault `fileIDs` (at most 50, nonblank and unique); an onboarding agent then extracts organization context from them. The response carries a `runId`; poll [Get an organization context run](#get-an-organization-context-run) with it. Pass your own `runId` (a ULID) to make a retry idempotent: reuse it with the same `fileIDs` and the run is not queued twice, while reusing it with different files is rejected with `400`. If queue delivery is unconfirmed the call still returns the `runId` with `success: false`; retry with the same `runId` and files.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/vault/onboard" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Resync the knowledge base

Queues a full reconciliation of your tenant's knowledge base against the vault: every vault file is listed and re-indexed, and indexed content with no matching vault file is removed. Use it for the first backfill or to recover from drift. It takes no body, returns as soon as the request is queued, and has no status endpoint. It can be expensive for a large vault, so do not call it per upload.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/rag/resync" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

## Organization context

The organization context is Nullify's classification of your company and what software it builds, built from onboarding and the vault.

### Get the organization context

Returns the current organization classification and a `version` for the stored copy.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/organization" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Replace the organization context

Creates or fully replaces the organization context with the `organization` object in the body; each call stores a new version. A `null` organization or an invalid questionnaire is rejected with `400`, and an organization marked `onboarded` must pass the onboarded-context validation. Because it replaces everything, read the current context first and send back what you want to keep.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/organization" method="put" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Rename the organization

Changes only the organization `name` (1 to 256 bytes, no control characters) without replacing the collected context. `notes` is not accepted here and returns `400`; manage notes through the memory endpoints. Returns `404` if no organization context exists and `412` if the stored context changed during the update, in which case retry.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/organization" method="patch" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Get an organization context run

Returns the state of an onboarding run started by [Trigger vault onboarding](#trigger-vault-onboarding): `PENDING` (queued), `RUNNING`, `SUCCEEDED` or `FAILED`, with a `message` and the context `version` it produced. Set `includeResult=true` to include the resulting `organization` once the run has succeeded. `runId` must be a ULID; an unknown run for your tenant returns `404`.

```bash
curl -s \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <TOKEN>" \
  'https://api.<TENANT>.nullify.ai/context/organization/runs/01J...?includeResult=true'
```

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/organization/runs/{runId}" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

## Memories

A memory is a durable note about a resource (a finding, repository, document, the organization) that Nullify's agents and your team can write and later recall. Memories are versioned and never edited in place: every change appends an immutable version, and deleting or retracting leaves a tombstone. Each memory has a `memoryType` (for example `KNOWLEDGE`, `TRIAGE`, `REMEDIATION`, `FOLLOW_UP`), a `priority`, an optional cognitive `memoryClass`, and a `trustTier` from 0 (ingested) to 3 (human decision). Memories can be superseded by a newer memory; only live memories (active and not superseded) can be edited. Some writes are reserved for Nullify services: setting trust tier 3, using the `actionitem:` source event, using ids that start with `tacitans:` or `ctxclar:`, or overwriting a customer answer returns `403` for other callers.

### List memories

Filters memories by `resourceId`, `resourceType`, `memoryType`, `priority`, `isLatest`, `memoryClass`, `status`, `minTrustTier` (0 to 3), and `createdBy`. `limit` is 1 to 1000 (default 50). Page with `offset`, or pass the `nextToken` from the previous response (an offset as a string; `offset` wins if both are set); `nextToken` is absent on the last page and `totalCount` gives the total. See [Pagination](/api-reference/api-reference/pagination.md).

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Create a memory

Creates a memory. `memoryType` and `content` are required; `confidence` must be 0 to 1 and every `anchors` entry must be `<kind>:<id>`. Without `resourceId` the memory attaches to its `metadata.documentMetadata.documentId` or to itself. Supply your own `memoryId` to make the write an idempotent upsert: repeating the call updates the same memory instead of adding another, but a memory that is retracted or superseded returns `412`. Set `supersedesMemoryId` to a live memory of your tenant to replace it in the same transaction; a missing or non-live target is rejected. A memory scoped to a document becomes the latest for that document and supersedes the earlier ones. Returns the stored memory.

```bash
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <TOKEN>" \
  -d '{"memoryType": "KNOWLEDGE", "content": "Payments service is internet-facing behind the public ALB.", "resourceType": "REPO_CONTEXT", "resourceId": "repo-1234", "anchors": ["repo:1234"]}' \
  'https://api.<TENANT>.nullify.ai/context/memories'
```

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Get a memory

Returns one memory by `memoryId`, including retracted ones, which come back with their status. Any failure to find it, including another tenant's id, returns `404`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/{memoryId}" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Update a memory

Changes the supplied fields (`content`, `title`, `priority`, `confidence`, `tags`, `citations`, `crossReferences`, `metadata`, `parentNoteId`) and appends a new version. Omitted fields keep their values. A superseded, retracted or otherwise non-active memory cannot be edited and returns `412`; write a new memory with `supersedesMemoryId` instead. Setting `supersedesMemoryId` here makes the updated memory replace another live memory.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/{memoryId}" method="patch" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Delete a memory

Retracts the memory rather than erasing it: the row stays as a tombstone with status `cancelled` and reason `deleted` (or the `reason` query parameter), disappears from searches and latest-only lists, and can still be read by id. The call returns `success: true`. Unknown ids return `404`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/{memoryId}" method="delete" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Retract a memory

Withdraws a memory as wrong or no longer wanted. `reason` is required and `retractedBy` is optional; for non-service callers retraction of a customer answer is attributed to the authenticated user instead of the supplied name. Same tombstone behavior as delete, but the updated memory is returned in the response and the reason is mandatory. Unknown ids return `404`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/{memoryId}/retract" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Get memory versions

Returns the immutable version history of a memory, newest first, with each version's `status`, `changeReason`, `changedBy`, `createdAt` and full memory snapshot. `limit` defaults to 50 and is capped at 1000. Writes, supersedes and retractions each append a version.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/{memoryId}/versions" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### List memories by type

Like [List memories](#list-memories) but keyed on the required `memoryType` query parameter, with optional `createdBy`, `resourceId`, `isLatest`, `limit` (1 to 1000, default 50), `offset`, and `paginationToken` (the offset of the next page as a string from the previous response).

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/type" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### List memories by document

Returns the latest live memories scoped to a document, finding, repository or project id given as `documentId`. `limit` is 1 to 1000 (default 50) and caps the list; the response is not paginated, so `paginationToken` has no effect here.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/document/{documentId}" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### List memories by document and type

Same as [List memories by document](#list-memories-by-document), restricted to the required `memoryType` query parameter. `limit` is 1 to 1000 (default 50); no pagination.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/document/{documentId}/type" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Search memories

Hybrid semantic and keyword search over memories. `query` is required (non-blank). Narrow with `memoryTypes`, `resourceType`, `scope`, `memoryClass`, `minTrustTier` (0 to 3) and `anchors`; with `anchors`, set `includeOrgWide` to also return organization-wide memories after the anchored matches. `limit` is 1 to 100. Each result has the `memory` and a `score` (higher is better). Retracted and superseded memories are not returned.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/search" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Grep memories

Exact, case-insensitive substring match over memory titles and content, the literal counterpart to [Search memories](#search-memories). `pattern` is required and non-blank. Optional filters are `memoryTypes`, `resourceType`, `scope`, `memoryClass` and `minTrustTier`; `limit` is 1 to 1000. Returns `memories` and `count`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/memories/grep" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

## Reports

Generate a report of where specific packages are used across your repositories.

### Create a report job

Queues generation of a package-usage report. `packages` is required and non-empty; each entry has `ecosystem`, `package` and `version`. `repositories` optionally restricts the report to repository ids; empty means all repositories. Every call creates a new job and returns its `jobId` immediately; poll [Get report status](#get-report-status).

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/reports" method="post" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}

### Get report status

Returns `status` (`queued`, `in_progress`, `failed` or `success`), an `error` message when failed, and, once `success`, a presigned `url` to download the PDF. The URL is generated on each call and expires, so fetch a fresh one rather than storing it. If the URL cannot be generated the call still succeeds without `url`.

{% openapi src="/files/1NgvLK12PRq7RFdn97yd" path="/context/reports/{jobId}" method="get" %}
[nullify-openapi-bundle.yaml](https://3946391995-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FId2OtLCL6O6V3XSRYxtr%2Fuploads%2Fgit-blob-26233c6743978bfec0535ad8febb4918da4bb6e4%2Fnullify-openapi-bundle.yaml?alt=media)
{% endopenapi %}
