---
search:
  tags:
    - triage
    - PATCH
seo:
  description: >-
    Update triage rule. Reference for the PATCH
    /workspaces/{organizationId}/triage/rules/{ruleId} endpoint in the Pile API.
sidebar:
  label: Update triage rule
  badge: PATCH
title: Update triage rule
type: openapi-operation
---
`PATCH /workspaces/{organizationId}/triage/rules/{ruleId}`

**Request body** (`application/json`)

- `name` (string)
- `recordType` (string)
- `isActive` (boolean)
- `sortOrder` (integer)
- `conditions` (object)
- `action` (object)

Request body example:

```json
{
  "name": "string",
  "recordType": "lead",
  "isActive": true,
  "sortOrder": 0,
  "conditions": {
    "keywords": [
      "string"
    ],
    "sources": [
      "string"
    ],
    "channels": [
      "string"
    ],
    "customerDomains": [
      "string"
    ],
    "teamIds": [
      "string"
    ],
    "labelIds": [
      "string"
    ],
    "priorities": [
      "string"
    ],
    "statuses": [
      "string"
    ],
    "fields": [
      {
        "field": "string",
        "equals": "string"
      }
    ]
  },
  "action": {
    "type": "delegate",
    "agentId": "string",
    "teamId": "string",
    "templateId": "string",
    "title": "string",
    "status": "triage",
    "priority": "low",
    "labelIds": [
      "string"
    ],
    "repo": "string",
    "instructions": "string",
    "dispatch": true
  }
}
```

**Responses**

- `200` — Rule updated
- `404` — Not found

Response example, 200:

```json
{
  "rule": {
    "id": "string",
    "organizationId": "string",
    "name": "string",
    "recordType": "lead",
    "isActive": true,
    "sortOrder": 0,
    "conditions": {
      "keywords": [
        "string"
      ],
      "sources": [
        "string"
      ],
      "channels": [
        "string"
      ],
      "customerDomains": [
        "string"
      ],
      "teamIds": [
        "string"
      ],
      "labelIds": [
        "string"
      ],
      "priorities": [
        "string"
      ],
      "statuses": [
        "string"
      ],
      "fields": [
        {
          "field": "string",
          "equals": "string"
        }
      ]
    },
    "action": {
      "type": "delegate",
      "agentId": "string",
      "teamId": "string",
      "templateId": "string",
      "title": "string",
      "status": "triage",
      "priority": "low",
      "labelIds": [
        "string"
      ],
      "repo": "string",
      "instructions": "string",
      "dispatch": true
    },
    "createdAt": "string",
    "updatedAt": "string"
  }
}
```
