> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://help.getzep.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://help.getzep.com/_mcp/server.

# Get User Episodes

GET https://api.getzep.com/api/v2/graph/episodes/user/{user_id}

Returns episodes by user id.

Reference: https://help.getzep.com/sdk-reference/graph/episode/get-user-episodes

## Request

### Path parameters

- `user_id` (string, required) — User ID

### Query parameters

- `lastn` (integer, optional) — The number of most recent episodes entries to retrieve.

## Response

### 200

Episodes

- `episodes` (list of apidata.GraphEpisode, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional)

## Types

### apidata.GraphEpisode

- `content` (string, required)
- `created_at` (string, required)
- `uuid` (string, required)
- `processed` (boolean, optional)
- `role` (string, optional) — Optional role, will only be present if the episode was created using memory.add API
- `role_type` (enum, optional) — Optional role_type, will only be present if the episode was created using memory.add API
  - Allowed values: `norole`, `system`, `assistant`, `user`, `function`, `tool`
- `session_id` (string, optional)
- `source` (enum, optional)
  - Allowed values: `text`, `json`, `message`
- `source_description` (string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "episodes": [
    {
      "content": "Discussed project milestones and next steps for the Q3 release.",
      "created_at": "2024-06-10T09:15:00Z",
      "uuid": "a1b2c3d4-e5f6-7890-ab12-cd34ef567890",
      "processed": true,
      "role": "project_manager",
      "role_type": "user",
      "session_id": "session_8f3b2c1a",
      "source": "text",
      "source_description": "Meeting transcript"
    }
  ]
}
```