# The domain's certificate, its renewal and its history

> The domain's certificate, its renewal and its history: CustomDomain™ API reference in the connections group. Covers parameters, request body and responses.

Source: https://docs.customdomain.ai/docs/api-reference/connections/getDomainCertificate

## `GET https://api.customdomain.ai/v1/connections/{id}/certificate`

The HTTPS certificate the edge holds for the domain, as the edge last reported it: status, issuer, when it was issued and last renewed, when it expires and the next renewal starts, the last error while renewing keeps failing, and the certificate history (issued, renewed, failed, expiring). An apex that redirects www also gets `www_certificate`. Every served domain has one, so this read is not behind the Secure plan feature (the `/ssl` management routes are). `status` is `not_reported` until the edge reports the certificate.

A delegated agent token needs `domains:read`.

A widget token must be the connection's end user: a connection that names another end user than the token's `end_user_ref`, or names one while the token names none, answers `403` `token_wrong_end_user` before anything is read or changed, and a connection that names none is any token's. An API key, an app-scoped token and a delegated agent token are not limited by it.

### Authentication

`widgetJWT`, `apiKey`, `agentToken`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Responses

| Status | Description |
| --- | --- |
| `200` | The certificate |
| `401` | Error envelope: {code, title, details}. |
| `403` | `forbidden`: the credential may not do this. `token_wrong_end_user`: a widget token that is not this connection's end user (the connection names another end user than the token's `end_user_ref`, or names one while the token names none); nothing is read or changed, and the answer shows nothing of the connection. Mint the token with the end user's `end_user_ref`. |
| `404` | Error envelope: {code, title, details}. |

### `200` response body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `connection_id` | string | yes |  |
| `certificate` | object | yes |  |
| `www_certificate` | object | no |  |
| `renewal` | object | yes |  |
| `history` | array of object | yes |  |

The full specification is served at `GET https://api.customdomain.ai/v1/openapi.json`.
