# AdId

**Type:** int32  
**Required:** Yes  
The Ad the targeting rule applies to

# SegmentTargetingId

**Type:** int32  
**Required:** Yes  
Id of the Ad Segment targeting rule

# IsExclude

**Type:** boolean  
**Defaults to:** false  
Whether targeting is to be excluded or included.

# Response Codes

## 200

**Type:** object  
- **Id**: integer (Defaults to 0)  
- **AdId**: integer (Defaults to 0)  
- **SegmentId**: integer (Defaults to 0)  
- **IsExclude**: boolean (Defaults to false)  
- **Segment**: object  
  - **Source**: string  
  - **Name**: string  
  - **Reach**: object  
    - **Description**: string  
    - **Category**: string

## 400

---

# Example Curl Request

```bash
curl -X PUT -H "X-Adzerk-ApiKey:<APIKEY>" -H "Content-Type:application/json" https://api.kevel.co/v1/ad/{AdId}/segmenttargeting/{Id} --data-binary '{"IsExclude":true}'
```

# Example Response

```json
{
  "Id": 56789,
  "AdId": 55555,
  "SegmentId": 123456,
  "IsExclude": true,
  "Segment": {
    "Source": "audience",
    "Name": "best customers",
    "Reach": {
      "all_time": 3187463,
      "28d": 387434
    },
    "Description": "top 1% spenders in the last 30 days.",
    "Category": "CRM"
  }
}
```
