---
title: "Add rule matches to rule"
type: reference
method: POST
path: /rest-api/rule/{ruleId}/matches/add.do
tag: "Targeting Rules"
---

# Add rule matches to rule

`POST https://YOUR-NETWORK-DOMAIN/rest-api/rule/{ruleId}/matches/add.do`

Adds new rule match entries to an existing rule identified by its numeric ID. The request body must be a JSON array of rule match objects, each containing category IDs (AdvertisingCategory for CAMPAIGN rules, PublisherCategory for INVENTORY rules), label IDs, a logical operator (AND/OR), and an include/exclude flag. Duplicate entries (matching existing rule matches or duplicates within the request) are rejected with validation errors. Returns a JSON object with 'success: true' on completion, or validation error details. Requires authentication and UPDATE permission on the RULES static ACL identity.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `ruleId` | integer | yes | `200` | The unique numeric identifier of the rule to add matches to |

## Body

A JSON body. An example, built from the field definitions:

```json
[
  {
    "id": "301",
    "include": "true",
    "operator": "AND"
  }
]
```

## Responses

- `200` — Rule matches added successfully
- `400` — Bad request — invalid or missing parameters
- `401` — Unauthorized - authentication error
- `403` — Forbidden - insufficient permissions
- `404` — Rule not found
- `500` — Internal server error

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/rule/200/matches/add.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '[
  {
    "id": "301",
    "include": "true",
    "operator": "AND"
  }
]'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-rule-matches-add