---
title: "Create site custom parameter targeting"
type: reference
method: POST
path: /rest-api/site/{siteId}/targeting/custom/create.do
tag: "Targeting Rules"
---

# Create site custom parameter targeting

`POST https://YOUR-NETWORK-DOMAIN/rest-api/site/{siteId}/targeting/custom/create.do`

Creates a custom parameter targeting rule for the specified site. Supports three custom types: EXPRESSION (a boolean expression like ($p1==1 || $p1=='a') && $p2>=12), VALUE (exact match on a parameter), and SUBSTRING (partial match). When customType is VALUE or SUBSTRING, the operation and parameter fields specify how to compare. Returns the created targeting rule on success. Requires CUSTOM targeting permission.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `siteId` | integer | yes | `3001` | Unique numeric ID of the site |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `rule` | string | yes | `INCLUDE` | Targeting rule type — INCLUDE for whitelist or EXCLUDE for blacklist |
| `customValue` | string | yes | `premium_user` | Custom targeting value or expression (e.g. ($p1==1 \|\| $p1=='a') && $p2>=12) |
| `customType` | string | no | `VALUE` | Custom target type — EXPRESSION, VALUE, or SUBSTRING (optional) |
| `operation` | string | no | `EQUALS` | Comparison operation — EQUALS, NOT_EQUALS, CONTAINS, or NOT_CONTAINS (optional, used with VALUE/SUBSTRING) |
| `parameter` | string | no | `segment` | Parameter name for the operation comparison (optional, used with VALUE/SUBSTRING) |

## Responses

- `200` — Success
- `400` — Invalid targeting value
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Site not found
- `500` — Internal server error

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/site/3001/targeting/custom/create.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'rule=INCLUDE' \
  --data-urlencode 'customValue=premium_user' \
  --data-urlencode 'customType=VALUE' \
  --data-urlencode 'operation=EQUALS' \
  --data-urlencode 'parameter=segment'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-site-targeting-custom-create