# Get an item

> GET /v1/memory/collections/{collection}/items/{key}

`GET https://api.zavu.dev/v1/memory/collections/{collection}/items/{key}`

## Parameters

- `collection` (path, string, required): Collection name.
- `key` (path, string, required): Item key. 1-255 chars from A-Z a-z 0-9 . _ : @ -
- `scope` (query, string): Which scope to address: `contact:<contactId>`, `conversation:<conversationId>`, or omitted for the project scope. Note the asymmetry with `POST /v1/memory` and `POST /v1/memory/search`, which take the scope in the request BODY as `scope` plus `contactId`/`conversationId`. Every other Memory endpoint takes it here.

## Responses

### 200

The item.

- `item` (object, required): One JSON document in a collection.
  - `key` (string, required)
  - `value` (any): The stored JSON. Any JSON value.
  - `rev` (integer, required): Revision, incremented on every write. Pass it as `If-Match` on a later write to make that write conditional.
  - `createdAt` (string<date-time>, required)
  - `updatedAt` (string<date-time>, required)
  - `expiresAt` (string<date-time>)

### 400

Invalid collection name, key, or `scope`.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 401

Unauthorized.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

### 404

`collection_not_found` or `item_not_found`. An item written in one scope is not found in another — pass the same `?scope=`.

- `code` (string, required)
- `message` (string, required)
- `details` (object)

## Example

```bash
curl -X GET "https://api.zavu.dev/v1/memory/collections/collection_abc123/items/key_abc123" \
  -H "Authorization: Bearer $ZAVUDEV_API_KEY"
```

```typescript
import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({ apiKey: process.env.ZAVUDEV_API_KEY });

const result = await zavu.memory.collections.items.retrieve("key_abc123", {
  collection: "collection_abc123",
});

console.log(result);
```
