---
title: "Issue Let's Encrypt certificate"
method: PATCH
path: "/cdn/resources/{id}"
tags: ["Let's Encrypt certificates"]
---

# Issue Let's Encrypt certificate

`PATCH /cdn/resources/{id}`

Issue free Let's Encrypt certificate for the CDN resource.

Before issuing the certificate, you need to:
- Delegate your domain to our name servers, if the CDN resource accelerates the entire site.
- Specify all CNAMEs in the personal zone, if the CDN resource accelerates only static resources.
- Create a Let's Encrypt certificate as described [here](/docs/api-reference/cdn/ssl-certificates/add-ssl-certificate).

Let's Encrypt certificates will be issued for all CNAMEs of the CDN resource.
Certificate issuing can take up to fifteen minutes.

By default, we issue an ECDSA Let's Encrypt certificate.
If you need a **RSA** certificate, you can [enable](/docs/api-reference/cdn/cdn-resources/change-cdn-resource) the "use_rsa_le_cert" option for your CDN resource.

**Notes:**

- When a certificate is issued, it will be applied to the CDN resource and HTTPS will be enabled automatically.
- Let's Encrypt certificate will be automatically renewed before the expiration date.
- Let's Encrypt certificate will be automatically updated and applied when deleting or adding additional CNAMEs of the CDN resource.

**Challenge types:**

By default, we issue Let's Encrypt certificates using the **HTTP-01** challenge.

If you prefer to use **DNS-01** challenge, you can enable the "use_dns01_le_challenge" option for your CDN resource.
Read more about [challenge types][1].

To issue Let's Encrypt certificate using the **DNS-01** challenge the steps below should be done before request issuance:
1. The DNS service is activated.
2. `use_dns01_le_challenge` [option](/docs/api-reference/cdn/cdn-resources/change-cdn-resource) is enabled.
3. `_acme-challenge` subdomain or resource's domain is delegated to our nameservers.
To find out the nameservers for your account, use the GET request `/dns/v2/platform/info`.
Use retrieved `name_server_1` and `name_server_2` values from the settings object to create NS records.

 [1]: https://letsencrypt.org/docs/challenge-types/

## Path parameters

- `id` integer, required

## Request body

- AttachLECert
  - `sslData` integer, required — ID of Let's Encrypt certificate obtained [here](/docs/api-reference/cdn/ssl-certificates/add-ssl-certificate). It can be used only with "sslEnabled": true.
  - `sslEnabled` boolean, required — Defines whether the HTTPS protocol is enabled for CDN resource. Possible values: - **true** — HTTPS is enabled for the CDN resource. Certificate can be linked. - **false** — HTTPS is disabled for the CDN resource. Certificate cannot be linked.

## Response `200`

Successful.

## Other responses

- `400` — Failed to issue the Let's Encrypt certificate.

---

[API](https://skmtc.net/g-core/apis/gcore-openapi.md) · [All operations](https://skmtc.net/g-core/apis/gcore-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/g-core/gcore-openapi/versions/09e652815095/schema)
