---
title: "Add site ads.txt lines"
type: reference
method: POST
path: /rest-api/sites/{siteId}/ads-txt/lines.do
tag: "Sites"
---

# Add site ads.txt lines

`POST https://YOUR-NETWORK-DOMAIN/rest-api/sites/{siteId}/ads-txt/lines.do`

Parses 'lines' the IAB ads.txt 1.1 way — blank lines and # comments skipped, variables kept — and appends what it adds to the site's additional ads.txt lines, each line once: lines of a partner that sells the site but is not an advertiser here, such as a header-bidding bidder. OWNERDOMAIN and MANAGERDOMAIN describe the site owner and are set only on the White Label page; CONTACT and SUBDOMAIN belong to the publisher's own file; a line with any of them is refused. When a line is malformed or refused nothing is stored and the answer carries success=false, invalidLines (1-based line numbers) and msg. Returns the site's ads.txt view as the GET does. Requires ENABLED level on the SITE_SUPPLY_CHAIN permission and UPDATE permission on the site; a masked share is refused.

## Path params

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

## Form params

| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| `lines` | string | yes | `adform.com, 1234, RESELLER` | The block as the partner gave it, one line per line |

## Responses

- `200` — Lines added, or refused with invalidLines
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — No SITE_SUPPLY_CHAIN permission, or the site is outside the caller's shares or masked
- `404` — Site not found

## Example request

```bash
curl --request POST \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/sites/5001/ads-txt/lines.do' \
  --header 'X-Api-Key: YOUR_API_KEY' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'lines=adform.com, 1234, RESELLER'
```

Source: https://epom.com/ad-server/docs/api/sites/post-sites-ads-txt-lines