# Domains

Configure a custom domain for your tracking script. This allows the script to load from your domain (e.g., `track.yourcompany.com`) instead of the default Bullseye domain.

## Set Custom Domain

Set or update the custom domain for the partner tracking script.

**Request:**

```
PUT /partner/domain
```

**Body:**

```json
{
  "domain": "track.yourcompany.com"
}
```

| Field    | Type   | Required | Description                           |
| -------- | ------ | -------- | ------------------------------------- |
| `domain` | string | Yes      | The custom domain (subdomain or apex) |

**Response:**

```json
{
  "domain": "track.yourcompany.com",
  "verified": false,
  "verificationRecord": "bullseye-verify=abc123",
  "cnameTarget": "track.bullseye.so",
  "dnsRecords": [
    {
      "type": "CNAME",
      "name": "track.yourcompany.com",
      "value": "track.bullseye.so"
    }
  ],
  "instructions": "Add a CNAME record pointing track.yourcompany.com to track.bullseye.so"
}
```

**Example:**

```bash
curl -X PUT "https://api.app.bullseye.so/api/v1/partner/domain" \
  -H "X-Partner-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"domain": "track.yourcompany.com"}'
```

***

## Get Verification Info

Retrieve DNS verification details and instructions for the configured domain.

**Request:**

```
GET /partner/domain/verification
```

**Response:**

```json
{
  "domain": "track.yourcompany.com",
  "verified": false,
  "verificationRecord": "bullseye-verify=abc123def456",
  "cnameTarget": "track.bullseye.so",
  "dnsRecords": [
    {
      "type": "CNAME",
      "name": "track.yourcompany.com",
      "value": "track.bullseye.so",
      "status": "pending"
    }
  ],
  "instructions": "Add a CNAME record in your DNS provider: Name: track.yourcompany.com, Value: track.bullseye.so. Propagation may take up to 48 hours."
}
```

***

## Verify Domain

Trigger domain verification. Checks DNS records and updates verification status.

**Request:**

```
POST /partner/domain/verify
```

**Response:**

```json
{
  "success": true,
  "verified": true
}
```

If verification fails:

```json
{
  "success": false,
  "verified": false,
  "message": "CNAME record not found. Please ensure DNS has propagated."
}
```

**Example:**

```bash
curl -X POST "https://api.app.bullseye.so/api/v1/partner/domain/verify" \
  -H "X-Partner-API-Key: your-api-key"
```

***

## DNS Setup Steps

1. **Set the domain** via `PUT /partner/domain` with your desired subdomain (e.g., `track.yourcompany.com`).
2. **Add the CNAME record** in your DNS provider:
   * **Type**: CNAME
   * **Name**: Your subdomain (e.g., `track` or `track.yourcompany.com` depending on provider)
   * **Value**: The `cnameTarget` from the API response (e.g., `track.bullseye.so`)
3. **Wait for propagation**. DNS changes can take up to 48 hours to propagate globally.
4. **Verify** via `POST /partner/domain/verify` to confirm the domain is correctly configured.
5. **Update your script tag**. Once verified, use your custom domain in the script URL:

   ```html
   <script src="https://track.yourcompany.com/script.js" data-key="your-pixel-key"></script>
   ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bullseye.so/partner-api/domains.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
