> ## Documentation Index
> Fetch the complete documentation index at: https://developers.entri.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor Endpoints

> REST endpoints for Entri Monitor: /monitor/domains, /monitor/domains/batch, /monitor/health, /monitor/status.

## Entri Monitor API

## General API Guidelines

### Base URL

```
https://api.goentri.com
```

### Authentication

All requests require the following headers:

* **`applicationId`**: Your unique application ID.

* **`Authorization`**: A bearer token generated using your client secret.

**Example Headers**:

```http theme={null}
applicationId: your-app-id
Authorization: Bearer your-auth-token
```

<Note>
  Monitor endpoints are protected by a **custom Lambda authorizer** that validates the `applicationId` + `Authorization` pair on every request. Authorizer results are **not cached** — each request is re-authorized — so always send a valid, unexpired token.
</Note>

## Quickstart

### Step 1:  Add domains for monitoring

You'll first need to tell Entri Monitor which domain you'd like to monitor. Send a `POST` request to `/monitor/domains` with the name of the domain, as well as a list of the records you want to monitor, including their `type`, `host`, `value`, and `ttl` properties.

Example request body:

```json theme={null}
{
  "domain": "example.com",
  "dnsRecords": [
    {
      "type": "A",
      "host": "@",
      "value": "93.184.216.34",
      "ttl": 3600
    }
  ]
}
```

You'll recieve a response like this if you're successful:

```json theme={null}
{
  "message": "Domain added successfully"
}
```

### Step 2: Specify a webhook URL

Log into the Entri Dashboard and navigate to the App Settings page. Enter the URL of the webhook that you'll use to recieve notifications about the DNS changes you specified.

### Step 3: Set up your service to receive the webhook requests at the URL you specified

Your webhook URL will be sent requests if the DNS records you specified are modified or deleted. Example request:

```json theme={null}
{
 "id": "e98d267b-84b8-4229-a94a-1933ed7f91ea",
 "subdomain": "www",
 "domain": "example.com",
 "user_id": "user123",
 "type": "domain.record_missing" / "domain.record_restored",
 "data": {
  "records_propagated": [
   {
    "host": "www",
    "ttl": 300,
    "type": "CNAME",
    "value": "mydestinationdomain.com"
   }
  ],
  "records_non_propagated": [
   {
    "host": "@",
    "ttl": 300,
    "type": "TXT",
    "value": "domain_verification123"
   }
  ]
 },
 "connect_link": "https://customurl.goentri.dev/share/27bc7873e6ad452780686b8c0436eb75"
}
```

## Retrieve DNS records

```
GET https://api.goentri.com/monitor/domains/:domain_name/records
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "domain": "example.com",
  "dnsRecords": [
    {
      "type": "A",
      "host": "example.com",
      "value": "93.184.216.34",
      "ttl": 3600
    }
  ]
}
```

## Create DNS records

```
POST https://api.goentri.com/monitor/domains/:domain_name/records
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Request body

```JSON JSON theme={null}
{
  "dnsRecords": [
    {
      "type": "A",
      "host": "example.com",
      "value": "93.184.216.34",
      "ttl": 3600
    }
  ]
}
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "message": "DNS records created successfully",
  "addedRecords": 1
}
```

## Update DNS records

```
PUT https://api.goentri.com/monitor/domains/:domain_name/records
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Request body

```JSON JSON theme={null}
{
  "dnsRecords": [
    {
      "type": "TXT",
      "host": "example.com",
      "value": "v=spf1 include:_spf.example.com ~all",
      "ttl": 3600
    }
  ]
}
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "message": "DNS records updated successfully",
  "updatedRecords": 1
}
```

## Delete DNS records

```
DELETE https://api.goentri.com/monitor/domains/:domain_name/records
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Request body

```JSON JSON theme={null}
{
  "dnsRecords": [
    {
      "type": "CNAME",
      "host": "www.example.com",
      "value": "example.com",
      "ttl": 3600
    }
  ]
}
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "message": "DNS records deleted successfully",
  "deletedRecords": 1
}
```

## List domains

```
GET https://api.goentri.com/monitor/domains
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "domains": [
    {
      "domain": "example.com",
      "status": "active"
    }
  ]
}
```

Query Parameters:

* `offset` (integer): Pagination offset.
* `limit` (integer): Number of domains per page.
* `from_date` (date): Filter start date.
* `to_date` (date): Filter end date.

## Retrieve domain details

```
GET https://api.goentri.com/monitor/domains/:domain_name
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "domain": "example.com",
  "status": "active",
  "dnsRecords": [
    {
      "type": "A",
      "host": "example.com",
      "value": "93.184.216.34",
      "ttl": 3600
    }
  ]
}
```

## Add a domain

```
POST https://api.goentri.com/monitor/domains
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Request body

```JSON JSON theme={null}
{
  "domain": "example.com",
  "dnsRecords": [
    {
      "type": "A",
      "host": "example.com",
      "value": "93.184.216.34",
      "ttl": 3600
    }
  ],
  "userId": "UUID"
}
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "message": "Domain added successfully",
  "domainId": "12345"
}
```

## Update a domain

```
PUT https://api.goentri.com/monitor/domains
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Request body

```JSON JSON theme={null}
{
  "domain": "example.com",
  "dnsRecords": [
    {
      "type": "A",
      "host": "example.com",
      "value": "93.184.216.34",
      "ttl": 3600
    }
  ],
  "userId": "UUID"
}
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "message": "Domain updated successfully",
  "updatedRecords": 1
}
```

## Delete a domain

```
DELETE https://api.goentri.com/monitor/domains
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Request body

```JSON JSON theme={null}
{
  "domain": "example.com",
  "subdomain": "shop",
  "deleteOnlyIfEmpty": true
}
```

### Request parameters

| Parameter           | Type    | Required? | Default | Description                                                                                                                                                                                              |
| ------------------- | ------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `domain`            | string  | Yes       | N/A     | The apex domain to delete from Monitor.                                                                                                                                                                  |
| `subdomain`         | string  | No        | N/A     | When provided, deletes monitoring only for the given subdomain under `domain` (for example, `shop` under `example.com`). The apex is kept intact.                                                        |
| `deleteOnlyIfEmpty` | boolean | No        | false   | When `true`, the domain (or subdomain) is only deleted if it has **no remaining monitored DNS records**. If records still exist, the request is rejected. Useful when reconciling from multiple sources. |

### Query parameter form

The same options are accepted as query parameters:

```
DELETE https://api.goentri.com/monitor/domains?domain=example.com&subdomain=shop&deleteOnlyIfEmpty=true
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "message": "Domain deleted successfully",
  "domainId": "12345"
}
```

## Batch create domains

<Note>
  Each batch request is limited to a maximum of **100 domains**. Submit multiple batches if you need to register more than 100 at once.
</Note>

```
POST https://api.goentri.com/monitor/domains/batch
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Request body

```JSON JSON theme={null}
{
  "domains": [
    {
      "domain": "example.com",
      "dnsRecords": [
        {
          "type": "A",
          "host": "example.com",
          "value": "93.184.216.34",
          "ttl": 3600
        }
      ]
    },
    {
      "domain": "example2.com",
      "dnsRecords": [
        {
          "type": "A",
          "host": "example.com",
          "value": "93.184.216.34",
          "ttl": 3600
        }
      ]
    }
  ]
}
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "message": "Batch created successfully",
  "batchId": "batch-12345"
}
```

## Batch status

<Note>
  Batch status records are retained for **7 days** (TTL) after the batch is submitted. After that window, status lookups for old batches will return a not-found response.
</Note>

```
GET https://api.goentri.com/monitor/domains/batch/status/:request_id
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

### Successful response (200 status)

```JSON JSON theme={null}
{
  "batchId": "batch-12345",
  "status": "completed",
  "successfulDomains": 10,
  "failedDomains": 0
}
```

## Webhooks

To recieve webhook notifications about the target domains, log into the Entri Dashboard and navigate to the App Settings page. Enter the URL of the webhook that you'll use to recieve notifications about the DNS changes you specified.

Your webhook URL will be sent requests if the DNS records you specified are modified or deleted.

### Top-Level fields

* **`id`**: A unique identifier for the webhook event (e.g. `"e98d267b-84b8-4229-a94a-1933ed7f91ea"`).
* **`user_id`**: The ID of the user who initiated the domain-related action (e.g. `"your-provided-user-id"`).
* **`domain`**: The domain involved in the event (e.g. `"example.com"`).
* **`subdomain`**: The subdomain associated with the event, if any (e.g. `"shop"`).
* **`type`**: Defines the type of event. Possible values:
  * `"domain.record_missing"`: Used whenever there is a record missing from the records that are being monitored.
  * `"domain.record_restored"`: Confirms that ALL records have been restored.
* **`data.records_propagated`**: Contains all the records that are being monitored and **were found correctly** configured on the domain.
* **`data.records_non_propagated`**: Contains all the records that are being monitored and **were found as missing** on the domain.
* **`connect_link`**: Entri Connect's sharing link with the configuration required to restablish the missing records on the domain.

Example request:

```json theme={null}
{
 "id": "e98d267b-84b8-4229-a94a-1933ed7f91ea",
 "subdomain": "www",
 "domain": "example.com",
 "user_id": "user123",
 "type": "domain.record_missing" / "domain.record_restored",
 "data": {
  "records_propagated": [
   {
    "host": "www",
    "ttl": 300,
    "type": "CNAME",
    "value": "mydestinationdomain.com"
   }
  ],
  "records_non_propagated": [
   {
    "host": "@",
    "ttl": 300,
    "type": "TXT",
    "value": "domain_verification123"
   }
  ]
 },
 "connect_link": "https://customurl.goentri.dev/share/27bc7873e6ad452780686b8c0436eb75"
}
```
