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

# Secure Endpoints

> REST endpoints for Entri Secure.

<Note>
  Secure endpoints are served by the Connect API gateway, not by a separate Secure host.
</Note>

## Secure API - SSL certificates

### List secured domains

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

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

#### Headers

| Header        | Required? | Description                                  |
| ------------- | --------- | -------------------------------------------- |
| Authorization | Yes       | Bearer token (JWT) for authentication.       |
| 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 secure status: `active` or `inactive`. |

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

#### Sample response

```json theme={null}
{
  "items": [
    {
      "domain": "www.example.com",
      "applicationUrl": "my.applicationurl.com",
      "secureStatus": "active"
    },
    {
      "domain": "blog.example.com",
      "applicationUrl": "my.applicationurl.com",
      "secureStatus": "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 Secure.
* **applicationUrl** (`string`): Current upstream URL for this domain.
* **secureStatus** (`string`): `active` or `inactive`.
* **total** (`integer`): Total number of secured 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": "Forbidden" }`                 | Authenticated but forbidden for this app. |
| 500  | `{ "message": "Internal Server Error" }`     | Unexpected server-side error.             |

#### Rate limits

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

#### Example cURL

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

### Check the domain's eligibility

```bash theme={null}
GET https://api.goentri.com/ssl?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={null}
{
  // Is the domain CNAMEed to the cname_target of the application?
  "eligible": true | false,

  // Is SSL provisioned?
  "sslStatus": "active" | "inactive",

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

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

#### Possible error responses

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

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

***

### Provision an SSL certificate

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

#### Request body

```JSON JSON theme={null}
{
  "domain": "www.example.com",
  "applicationUrl": "my.applicationurl.com", /*Optional*/
  "redirectTo": "shops.example.com" /*Optional*/
}
```

#### Parameters description

| Parameter      | Required? | Default                             | Description                                                                                             |
| -------------- | --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------- |
| domain         | Yes       | N/A                                 | The domain name to check                                                                                |
| applicationUrl | No        | Configured on Customer's Dashboard. | Overrides the pre-configured value set on the Dashboard.                                                |
| redirectTo     | No        | N/A                                 | Allows you to create a custom redirect policy from the secured domain to any other domain or subdomain. |

#### Successful response (200 status)

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

#### Possible error responses

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

| Error message                                         | Status |
| ----------------------------------------------------- | ------ |
| There is already a valid certificate for this domain. | 502    |
| Please review SSL eligibility status of this domain.  | 502    |
| Please complete step 1.                               | 502    |
| Internal Server Error.                                | 502    |
| ApplicationUrl is not reachable                       | 502    |

***

### Renew an SSL certificate

```BASH theme={null}
PUT https://api.goentri.com/ssl
Header "Authorization: [JWT authorization]"
Header "applicationId: [yourApplicationID]"
```

#### Request body

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

#### Successful response (200 status)

```json json theme={null}
{ "message": "Success." }
```

#### Possible error responses

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

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

***

### Deprovision an SSL certificate

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

#### Request body

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

#### Successful response (200 status)

```JSON JSON theme={null}
{ "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    |
