> This page is for version v4 (default).
> For other versions, use one of these documentation indexes:
> - v4 (default): https://help.getzep.com/v4/llms.txt
> - v3: https://help.getzep.com/v3/llms.txt
> - v2: https://help.getzep.com/v2/llms.txt

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

# Set graph inclusion rules

PUT https://api.getzep.com/api/v4/graphs/{graph_uuid}/inclusion-rules
Content-Type: application/json

Replaces the graph rules. Request: \{"inclusion\_rules":\[]}. Response: \{"inclusion\_rules":\[],"inherited":true}.

Reference: https://help.getzep.com/sdk-reference/graph/set-inclusion-rules

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key  `) — Type "Api-Key" followed by a space and the project API key.

## Request

### Path parameters

- `graph_uuid` (string, required) — Graph UUID

### Body (application/json)

This endpoint expects a v4.InclusionRules.

- `inclusion_rules` (list of v4.InclusionRule, optional) — InclusionRules replaces the complete rule set at this scope.
- `inherited` (boolean, optional) — Inherited identifies a graph that uses project defaults.

## Response

### 200

OK

- `inclusion_rules` (list of v4.InclusionRule, optional) — InclusionRules replaces the complete rule set at this scope.
- `inherited` (boolean, optional) — Inherited identifies a graph that uses project defaults.

## Errors

### 400 Bad Request Error

Bad Request

- `error` (v4.ErrorBody, optional)

### 401 Unauthorized Error

Unauthorized

- `error` (v4.ErrorBody, optional)

### 404 Not Found Error

Not Found

- `error` (v4.ErrorBody, optional)

## Types

### v4.InclusionRule

- `condition` (string, optional) — Condition is a natural-language test; an empty value matches every applicable candidate.
- `effect` (enum, optional) — Effect includes or excludes matching candidates.
  - Allowed values: `include`, `exclude`
- `name` (string, optional) — Name uniquely identifies the rule within its scope.
- `target` (enum, optional) — Target selects entity candidates or fact candidates.
  - Allowed values: `entity`, `fact`
- `types` (list of string, optional) — Types limits the rule to these ontology types and their subtypes.

### v4.ErrorBody

- `code` (string, optional)
- `details` (map from string to any, optional)
- `message` (string, optional)
- `param` (string, optional)
- `request_id` (string, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "inclusion_rules": [
    {
      "condition": "The person is an employee.",
      "effect": "include",
      "name": "Relevant people",
      "target": "entity",
      "types": [
        "Person"
      ]
    }
  ],
  "inherited": false
}
```