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

# Clone graph

POST https://api.getzep.com/api/v2/graph/clone
Content-Type: application/json

Clone a user or group graph.

Reference: https://docs-beta.getzep.com/sdk-reference/graph/clone-graph

## Request

### Body (application/json)

This endpoint expects an apidata.CloneGraphRequest.

- `source_group_id` (string, optional) — group_id of the group whose graph is being cloned. Required if user_id is not provided
- `source_user_id` (string, optional) — user_id of the user whose graph is being cloned. Required if group_id is not provided
- `target_group_id` (string, optional) — group_id to be set on the cloned group. Must not point to an existing group. Required if target_user_id is not provided.
- `target_user_id` (string, optional) — user_id to be set on the cloned user. Must not point to an existing user. Required if target_group_id is not provided.

## Response

### 202

Response object containing group_id or user_id pointing to the new graph

- `group_id` (string, optional)
- `user_id` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "group_id": "grp_9f8b7c6d5e4a3b2c1d0e",
  "user_id": "usr_1234567890abcdef"
}
```