---
title: policyRulesEdit mutation | Wartiva GraphQL API
description: Updates between 1 and 500 existing policy rules, identified by id, and returns their ids. A rule's type cannot be changed.
url: https://wartiva.com/api-docs/mutations/policy-rules-edit.html
updated: 2026-10-07
---

Policies and findings · GraphQL mutation

# `policyRulesEdit` mutation

Updates between 1 and 500 existing policy rules, identified by id, and returns their ids. A rule's type cannot be changed. Unknown or deleted rule ids return a not-found error, checked before any rule is written. Editing a rule Wartiva provides makes it the organization's own version, which later Wartiva updates no longer overwrite; changing only whether it is enabled does not.

## Response

Returns a [`RulesEditPayload!`](https://wartiva.com/api-docs/types/rules-edit-payload.html)

## Arguments

| Name | Description |
|---|---|
| `orgId` - [`OrganizationId!`](https://wartiva.com/api-docs/types/organization-id.html) | The Organization identifier. |
| `input` - [`RulesEditInput!`](https://wartiva.com/api-docs/types/rules-edit-input.html) | Rules to update. |

## Example

### Query

```graphql
mutation policyRulesEdit(
  $orgId: OrganizationId!,
  $input: RulesEditInput!
) {
  policyRulesEdit(
    orgId: $orgId,
    input: $input
  ) {
    ruleIds
  }
}

```

### Variables

```json
{
  "orgId": "615f3b3b28284380e28a7342",
  "input": RulesEditInput
}

```

### Response

```json
{"data": {"policyRulesEdit": {"ruleIds": [4]}}}

```

---

Wartiva is in early access. Request access: https://wartiva.com/early-access.html  
All pages: https://wartiva.com/llms.txt
