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

> ## Agent Instructions
> Maximem Synap is a managed memory layer for AI agents: it ingests conversations and documents, extracts structured memory, and returns scoped context to the agent at retrieval time.
> The Python and JavaScript/TypeScript SDKs are the supported way to use Synap. Write integration code with SDK calls, not raw HTTP requests.
> Start with the Quickstart: https://docs.maximem.ai/getting-started/quickstart.md. Every SDK method is documented in the SDK reference: https://docs.maximem.ai/sdk-reference/overview.md.
> For requests about adding Vity memory to OpenClaw, Hermes, an MCP client, or a browser, start with the Vity Quickstart: https://docs.maximem.ai/vity/quickstart.md.

# documents.lookup

> Turn the document_id you chose into the document_key Synap returns, within a scope.

```python Python theme={null}
await sdk.documents.lookup(document_id, user_id=None, customer_id=None, scope=None)
```

```typescript TypeScript theme={null}
await sdk.documents.lookup(options: DocumentAddress)  // document_id is required
```

REST One HTTPS request.

> [!NOTE]
>
> Added in Python SDK 0.9.0 and JavaScript and TypeScript SDK 0.9.0. In TypeScript, pass one options object; every option is accepted in snake\_case or camelCase (`customer_id` or `customerId`). The result is returned as the server sends it, with snake\_case fields, typed as `Record<string, unknown>`.

Find a document by the `document_id` you gave it when you created it. Your own ids are unique only within a scope, so pass the same `user_id`, `customer_id` or `scope` the document was created with. You rarely need this call: every other `documents` method accepts a `document_id` with those arguments and looks the key up for you.

### Parameters

**document\_id** `string` *required*

The id you gave the document in [`memories.create`](https://docs.maximem.ai/sdk-reference/memories/create).

**user\_id** `string`

The user the document was filed under, if any.

**customer\_id** `string`

The customer the document was filed under, if any. Not accepted on B2C.

**scope** `dict[str, str]`

The deeper scope level the document was filed at, as level name to id.

### Returns

One document, the same fields as an item of [`documents.list`](https://docs.maximem.ai/sdk-reference/documents/list), including its `document_key`.

### Example

```python Python theme={null}
from maximem_synap import MaximemSynapSDK

sdk = MaximemSynapSDK()  # reads SYNAP_API_KEY from your environment
await sdk.initialize()

doc = await sdk.documents.lookup("msa-2026", customer_id="acme-corp")
print(doc["document_key"], doc["version"])
```

```typescript TypeScript theme={null}
import { SynapClient } from '@maximem/synap-js-sdk';

const sdk = new SynapClient(); // reads SYNAP_API_KEY from your environment
await sdk.initialize();

const doc = await sdk.documents.lookup({ document_id: 'msa-2026', customer_id: 'acme-corp' });
console.log(doc.document_key, doc.version);
```

### Raises

* `ContextNotFoundError`: when no live document has that id in that scope.
* `AmbiguousDocumentError`: when the id names more than one document, for example the same id at two customers. Its `matches` lists them (the same property in TypeScript); pass the scope that names one, or use the `document_key`.
* `CustomerIdNotAcceptedError`: when `customer_id` is passed on a B2C instance.

### See also

* [documents.get](https://docs.maximem.ai/sdk-reference/documents/get.md)
* [documents.list](https://docs.maximem.ai/sdk-reference/documents/list.md)


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