> ## 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.

# Power Endpoints

> REST endpoints for Entri Power.

> [!NOTE]
>
> Power endpoints are served by the Connect API gateway, not by a separate Power host.

## Power API - Custom domains

### List powered domains

Partners can retrieve all domains currently **Powered** under a given `applicationId` to audit configuration, build admin UIs, and perform maintenance. This endpoint returns a paginated list of all Power-managed domains for the authenticated application.

```txt theme={"system"}
GET https://api.goentri.com/power
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

> [!WARNING]
>
> Listing powered domains requires a JWT issued with `product: "power"`. Mint the token as described in [Enhancing Integration Security](https://developers.entri.com/connect/configuration.md#enhancing-integration-security). A token without a `product` claim, or a token issued for another product, is rejected with a `403` and no domains are returned. This also applies to applications that have authentication disabled. Checking a single domain with `?domain=` is not affected.

#### Headers

| Header | Required? | Description |
| - | - | - |
| Authorization | Yes | Bearer token (JWT) issued with `product: "power"`. |
| applicationId | Yes | Your Application ID as set in the dashboard. |

#### Query string parameters

| Name | Type | Required? | Default | Description |
| - | - | - | - | - |
| page | integer | No | 0 | Zero-based page index (0 = first page). |
| size | integer | No | 50 | Max number of items to return (range: 1–200). |
| status | string | No | — | Filter by power status: `active` or `inactive`. |

> **Note:** `status` is optional. If omitted, the endpoint returns **all** powered domains for the application.

#### Sample response

```json theme={"system"}
{
  "items": [
    {
      "domain": "www.example.com",
      "applicationUrl": "my.applicationurl.com",
      "powerRootPathAccess": ["/", "/shop"],
      "powerStatus": "active"
    },
    {
      "domain": "blog.example.com",
      "applicationUrl": "my.applicationurl.com",
      "powerRootPathAccess": [],
      "powerStatus": "inactive"
    }
  ],
  "total": 2,
  "page": 0,
  "limit": 50,
  "count": 2,
  "pages": 1,
  "nextPage": null,
  "prevPage": null
}
```

#### Field definitions

* **domain** (`string`): Fully qualified domain or subdomain configured via Power.
* **applicationUrl** (`string`): Current upstream URL for this domain.
* **powerRootPathAccess** (`string[]`): List of root paths with access granted (may be empty).
* **powerStatus** (`string`): `active` or `inactive`.
* **total** (`integer`): Total number of powered domains matching the filter.
* **page** (`integer`): Current zero-based page index.
* **limit** (`integer`): Maximum number of items requested per page.
* **count** (`integer`): Number of items returned.
* **pages** (`integer`): Total number of pages available.
* **nextPage** (`integer | null`): Next page index, or null if not applicable.
* **prevPage** (`integer | null`): Previous page index, or null if not applicable.

#### Error responses

| HTTP | Example Body | When |
| - | - | - |
| 400 | `{ "message": "Invalid 'limit' parameter" }` | Validation errors on query parameters. |
| 401 | `{ "message": "Unauthorized" }` | Missing/invalid JWT or `applicationId`. |
| 403 | `{ "message": "The token must be issued with product 'power' to use this endpoint. See https://developers.entri.com/connect/configuration#enhancing-integration-security" }` | The JWT has no `product` claim, or the application has authentication disabled. |
| 403 | `{ "message": "JWT is not valid for this resource" }` | The JWT was issued for another product. |
| 500 | `{ "message": "Internal Server Error" }` | Unexpected server-side error. |

#### Rate limits

This endpoint follows the same global rate limits as other Power API endpoints.

#### Example cURL

```bash theme={"system"}
curl -X GET "https://api.goentri.com/power?status=active&size=10&page=0 \
  -H "Authorization: Bearer <JWT>" \
  -H "applicationId: <yourApplicationID>"
```

### Check the domain's eligibility

```BASH theme={"system"}
GET https://api.goentri.com/power?domain=www.example.com&rootDomain=false
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

#### Parameters description

| Parameter | Required? | Default | Description |
| - | - | - | - |
| domain | Yes | N/A | The domain name to check |
| rootDomain | No | false | true if checking the root domain's eligibilityfalse if checking for the subdomain |

#### Successful response (200 status)

```JSON JSON theme={"system"}
{
  // Is the domain CNAMEed to the cname_target of the application?
  "eligible": true | false,

  // Is the domain already powered?
  "powerStatus": "active" | "inactive",

  // Current cnameTarget set on the Dashboard
  "cnameTarget": URL | "",

  // Current cnameTarget value for the domain
  "applicationUrl": URL | "",

  //Paths with granted access to the root of the Application URL
  "powerRootPathAccess": [] | ["/path1", "/path2",..., "pathN"]
}
```

#### Possible error responses

Errors are returned as a `{message: 'string'}` object.

| Error message | Status |
| - | - |
| Domain provided couldn't be resolved. | 400 |

***

### Power a new domain

```BASH theme={"system"}
POST https://api.goentri.com/power
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

#### Request body

```JSON JSON theme={"system"}
{
  "domain": "www.example.com",
  "applicationUrl": "my.applicationurl.com"
}
```

> [!NOTE]
>
> Root Path Access is configured once in your application settings in the Dashboard and applied automatically to every powered domain. See [Root Path Access](https://developers.entri.com/power/root-path-access.md).

#### Successful response (200 status)

```JSON JSON theme={"system"}
{ "message": "Success" }
```

#### Possible error responses

Errors are returned as a `{message: 'string'}` object. The body never carries anything else, and `message` is a plain-English explanation of what to fix.

| Error message | Status | When |
| - | - | - |
| Missing request body, Invalid JSON in request body, or Missing domain in body | 400 | The body is absent, not valid JSON, or has no `domain`. |
| Domain does not match with domain passed while creating the token | 400 | The JWT was created for a different domain. |
| A certificate cannot be issued for this domain name. Check the domain is spelled correctly and is a public, issuable domain, then try again. | 400 | A certificate cannot be issued for this name, for example an IP address, a bare TLD, or a `.local` name. |
| Unauthorized | 401 | Missing or invalid JWT or `applicationId`. |
| Domain is blacklisted, Please contact support to know more about this domain. | 403 | The domain is blocked for this application. |
| Conflict: Domain is already powered and active. To manage or update this domain, use the appropriate endpoint. | 409 | The domain is already powered by this application. |
| Conflict: a certificate provision for this domain is already in progress. Please retry once it has finished. | 409 | Another request is provisioning the same domain right now. The lock is per domain and shared between Secure and Power, so a Secure provision can block a Power one and vice versa. Retry once it finishes. |
| Domain ineligible: DNS records (A or CNAME) are not correctly pointed to the Entri target. Please update your DNS and re-verify. | 422 | The eligibility check found the domain is not pointed to Entri. |
| We could not validate this domain because our certificate authority could not resolve it. Check that the domain's nameservers are responding, then try again. | 422 | The domain's nameservers did not answer during validation. |
| A CAA record on this domain stops our certificate authority from issuing a certificate. Remove the CAA record, or contact support for the value to allow, then try again. | 422 | A CAA record on the domain blocks certificate issuance. Remove it, or ask support which issuer to allow. |
| Our certificate authority could not reach this domain to validate it. Check that the domain points at Entri and is reachable over HTTP, then try again. | 422 | The domain could not be reached over HTTP during validation, usually because it does not point to Entri yet. |
| Precondition Required: You must first verify the domain's eligibility via a GET request. See: [https://developers.entri.com/power#step-1-get-the-domain's-eligibility](https://developers.entri.com/power.md#step-1-get-the-domain's-eligibility) | 428 | The domain has never been checked with the eligibility endpoint on this page for this application. |
| Our certificate authority is rate limiting certificate issuance for this domain. Retry after {date}, then try again. | 429 | Certificate issuance for this domain is rate limited. The message includes the retry time when one is available. |
| Internal server error | 502 | Unexpected failure on Entri's side. |
| Our certificate authority could not complete this request. This is a temporary problem on their side - please try again in a few minutes. | 503 | The certificate authority is unavailable or returned a failure Entri could not classify. Retry later. |

***

### Update an already powered domain

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

#### Request body

```JSON JSON theme={"system"}
{
  "domain": "www.example.com",
  "applicationUrl": "my.applicationurl.com"
}
```

#### Successful response (200 status)

```JSON JSON theme={"system"}
{ "message": "Success." }
```

#### Possible error responses

Errors are returned as a `{message: 'string'}` object.

| Error message | Status |
| - | - |
| `{detailed error message when powering again the domain`} | 502 |

***

### Renew the SSL certificate

Entri renews the certificates it provisions automatically before they expire. Use this endpoint when you need to trigger that renewal yourself, for example after your customer fixed their DNS records following a [`domain.power.certificate_renewal_failed`](https://developers.entri.com/power/events#domain-power-certificate_renewal_failed) webhook.

```txt theme={"system"}
POST https://api.goentri.com/power/renew
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

#### Request body

```JSON JSON theme={"system"}
{ "domain": "www.example.com" }
```

#### Parameters description

| Parameter | Required? | Description |
| - | - | - |
| domain | Yes | The powered domain to renew. If the JWT was created for a specific domain, it must match this value. |

#### Requirements

The renewal only runs when all of the following are true. Otherwise the endpoint returns one of the errors listed below without touching the certificate.

* The domain is powered by your application and its status is `active`.
* The current certificate expires within the next 30 days.
* The domain still points to Entri: subdomains must CNAME to the configured CNAME target, and root domains must resolve to Entri's A records with no AAAA records present.

#### Successful response (200 status)

```JSON JSON theme={"system"}
{ "message": "Certificate renewed successfully" }
```

#### Possible error responses

Errors are returned as a `{message: 'string'}` object.

| Error message | Status | When |
| - | - | - |
| Missing request body, Invalid JSON in request body, or Missing 'domain' in request body | 400 | The body is absent, not valid JSON, or has no `domain`. |
| Domain does not match with domain passed while creating the token | 400 | The JWT was created for a different domain. |
| Unauthorized | 401 | Missing or invalid JWT or `applicationId`. |
| The requested domain was not found. Please ensure your configuration matches the environment, such as development or staging. | 404 | The domain is not powered by this application. |
| Conflict: Domain is not active. Only active power domains can be renewed. | 409 | The domain's power status is `inactive`. |
| Certificate renewal is only available within 30 days of expiry. | 409 | The current certificate is still valid for more than 30 days. |
| Renewal requires your domain to be pointed to Entri. Please verify your DNS records are configured correctly and try again. | 422 | The DNS check failed. The message names the record that is missing or misconfigured. Entri also sends the `domain.power.certificate_renewal_failed` webhook. |
| Internal Server Error | 500 | Unexpected server-side error. |
| Failed to renew certificate | 502 | DNS is correct but the certificate authority request failed. Retry later. |

#### Example cURL

```bash theme={"system"}
curl -X POST "https://api.goentri.com/power/renew" \
  -H "Authorization: Bearer <JWT>" \
  -H "applicationId: <yourApplicationID>" \
  -H "Content-Type: application/json" \
  -d '{"domain": "www.example.com"}'
```

***

### Remove a powered domain

```BASH theme={"system"}
DELETE https://api.goentri.com/power
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

#### Request body

```JSON JSON theme={"system"}
{ "domain": "www.example.com" }
```

#### Successful response (200 status)

```JSON JSON theme={"system"}
{ "message": "Success." }
```

#### Possible error responses

Errors are returned as a `{message: 'string'}` object.

| Error message | Status |
| - | - |
| Domain not valid | 502 |
| detailed error message when deleting the SSL certificate of the domain | 502 |

## Appended Headers on Incoming Traffic

As part of the SSL provisioning process, all incoming traffic will have specific headers appended to each request. These headers provide additional context about the original request, including information about the host and IP address. The following headers will be added automatically to every incoming request:

* **X-Forwarded-Host**: This header contains the original `Host` value of the incoming request before any proxy or load balancer has modified it. It helps in identifying the initial destination for the request.

* **x-entri-forwarded-host**: Similar to `X-Forwarded-Host`, this is a custom header used by Entri to track the original host at the time the request was forwarded through Entri’s system.

* **X-Forwarded-IP** or **X-Forwarded-For**: These headers contain the original IP address of the client making the request. It is useful for understanding where the request originated from, even if it passed through proxies or load balancers.

* **X-Entri-Auth**: The X-Entri-Auth header is a configurable authentication token that you can set in the Entri Dashboard. Once enabled, it is automatically included in every outgoing request, allowing your system to verify that the request originated from Entri. The token can be rotated at any time to align with your internal security policies.

These headers ensure that downstream services can access critical metadata about the request, facilitating better logging, security, and handling of the requests in your system.
