> 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.

# Update User

PATCH https://api.getzep.com/api/v2/users/{userId}
Content-Type: application/json

Updates a user.

Reference: https://help.getzep.com/sdk-reference/user/update

## Request

### Path parameters

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

### Body (application/json)

This endpoint expects an apidata.UpdateUserRequest.

- `email` (string, optional) — The email address of the user.
- `fact_rating_instruction` (apidata.FactRatingInstruction, optional) — Optional instruction to use for fact rating.
- `first_name` (string, optional) — The first name of the user.
- `last_name` (string, optional) — The last name of the user.
- `metadata` (map from string to any, optional) — The metadata to update

## Response

### 200

The user that was updated.

- `created_at` (string, optional)
- `deleted_at` (string, optional)
- `email` (string, optional)
- `fact_rating_instruction` (models.FactRatingInstruction, optional)
- `first_name` (string, optional)
- `id` (integer, optional)
- `last_name` (string, optional)
- `metadata` (map from string to any, optional) — Deprecated
- `project_uuid` (string, optional)
- `session_count` (integer, optional) — Deprecated
- `updated_at` (string, optional) — Deprecated
- `user_id` (string, optional)
- `uuid` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request

- `message` (string, optional)

### 404 Not Found Error

Not Found

- `message` (string, optional)

### 500 Internal Server Error

Internal Server Error

- `message` (string, optional)

## Types

### apidata.FactRatingInstruction

- `examples` (apidata.FactRatingExamples, optional) — Examples is a list of examples that demonstrate how facts might be rated based on your instruction. You should provide an example of a highly rated example, a low rated example, and a medium (or in between example). For example, if you are rating based on relevance to a trip planning application, your examples might be: High: "Joe's dream vacation is Bali" Medium: "Joe has a fear of flying", Low: "Joe's favorite food is Japanese",
- `instruction` (string, optional) — A string describing how to rate facts as they apply to your application. A trip planning application may use something like "relevancy to planning a trip, the user's preferences when traveling, or the user's travel history."

### models.FactRatingInstruction

- `examples` (models.FactRatingExamples, optional) — Examples is a list of examples that demonstrate how facts might be rated based on your instruction. You should provide an example of a highly rated example, a low rated example, and a medium (or in between example). For example, if you are rating based on relevance to a trip planning application, your examples might be: High: "Joe's dream vacation is Bali" Medium: "Joe has a fear of flying", Low: "Joe's favorite food is Japanese",
- `instruction` (string, optional) — A string describing how to rate facts as they apply to your application. A trip planning application may use something like "relevancy to planning a trip, the user's preferences when traveling, or the user's travel history."

### apidata.FactRatingExamples

- `high` (string, optional)
- `low` (string, optional)
- `medium` (string, optional)

### models.FactRatingExamples

- `high` (string, optional)
- `low` (string, optional)
- `medium` (string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "created_at": "2023-11-15T09:27:00Z",
  "deleted_at": "",
  "email": "jane.doe@example.com",
  "fact_rating_instruction": {
    "examples": {
      "high": "User's preferred travel destination is Paris",
      "low": "User enjoys Italian cuisine",
      "medium": "User has visited Europe twice"
    },
    "instruction": "Rate facts based on their relevance to the user's travel preferences and history."
  },
  "first_name": "Jane",
  "id": 1024,
  "last_name": "Doe",
  "metadata": {},
  "project_uuid": "a3f1c9e2-7b4d-4f8a-9c3e-2d5f6b7a8c9d",
  "session_count": 15,
  "updated_at": "2024-06-10T14:45:00Z",
  "user_id": "user-1024",
  "uuid": "550e8400-e29b-41d4-a716-446655440000"
}
```