# Replace audience companies

Replaces audience companies. Works with LinkedIn Ads.

```http
POST https://api.pozy.ai/v1/ads/audiences/{audienceId}/companies
```

- Area: Ads / Ad Audiences
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `audienceId` (string, required)

## Request body

Content type: `application/json`

- `companies`, array of object, required: At least 1 item. Up to 300000 items
  - `name`, string: Up to 255 characters
  - `domain`, string: Up to 100 characters
  - `website`, string: Up to 100 characters
  - `linkedinPageUrl`, string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/ads/audiences/6cb6496d2ca0017ff720f51f/companies" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "companies": [
    {
      "name": "Acme",
      "domain": "string",
      "website": "string"
    }
  ]
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/ads/audiences/6cb6496d2ca0017ff720f51f/companies", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    companies: [
      {
        name: "Acme",
        domain: "string",
        website: "string"
      }
    ]
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/ads/audiences/6cb6496d2ca0017ff720f51f/companies",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "companies": [
            {
                "name": "Acme",
                "domain": "string",
                "website": "string",
            },
        ],
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `message`, string
- `numReceived`, integer

```json
{
  "message": "Hello from Pozy",
  "numReceived": 1
}
```
