---
title: "Create advertiser time range targeting"
type: reference
method: POST
path: /rest-api/advertiser/{advertiserId}/targeting/time-range/create.do
tag: "Targeting Rules"
---

# Create advertiser time range targeting

`POST https://YOUR-NETWORK-DOMAIN/rest-api/advertiser/{advertiserId}/targeting/time-range/create.do`

Creates a time range targeting rule for the specified advertiser and enables targeting if it was previously disabled. Allows restricting ad delivery to a specific time window. If clientLocalTime is true, the time range is evaluated in the viewer's local timezone; otherwise UTC is used. Returns the created targeting rule as JSON. Requires TIME_RANGE targeting permission and UPDATE permission on the advertiser.

## Path params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `advertiserId` | integer | yes | `1234` | Unique numeric ID of the advertiser |

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `rule` | string | yes | `INCLUDE` | Targeting rule type: INCLUDE or EXCLUDE |
| `timeFrom` | string | yes | `09:00` | Start time in 24-hour format hh:MM (e.g., '09:00') |
| `timeTo` | string | yes | `18:00` | End time in 24-hour format hh:MM (e.g., '18:00') |
| `clientLocalTime` | boolean | no | `false` | If true, the time range is evaluated in the client's local timezone; if false, UTC is used |

## Responses

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

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/advertiser/1234/targeting/time-range/create.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'rule=INCLUDE' \
  --data-urlencode 'timeFrom=09:00' \
  --data-urlencode 'timeTo=18:00' \
  --data-urlencode 'clientLocalTime=false'
```

Source: https://epom.com/ad-server/docs/api/targeting-rules/post-advertiser-targeting-time-range-create