# [REST API](https://zerossl.com/documentation/api "ZeroSSL Documentation") Download Certificate

## Download Certificate HTTPS GET

We are giving you several possibilities to get your certificates via ZeroSSL API.

To download a certificate using the ZeroSSL API, you can use the `download` endpoint and pass the given certificate ID (hash) to the API to the URL inside the `{id}` parameter.

Parameter `{method}` gives you the possibility to download the certificate in different formats, which are described below.

**API Request URL:**

```
api.zerossl.com/certificates/{id}/download/{method}?access_key=...
```

**HTTPS GET Request Parameters:**

| Parameter                | Description                                                                                                                                  |
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `access_key`            | **\[Required\]** Use this parameter to specify your API access key.                                                                       |
| `{id}`                  | **\[Required\]** Use this parameter to specify your certificate ID / hash.                                                                |
| `{method}`              | **\[Optional\]** Use this parameter to specify response format you want to get your certificate.<br> <br>If no parameter or non-supported value is provided, the default method is `zip`.<br> <br>**Supported values:**<br>- `zip` (default)<br>- `json`<br>- `return` (deprecated)<br>- `pem`<br>- `chain`<br>- `xml` |
| `include_cross_signed`   | Set this parameter to `1` to include the cross signed certificate in the response. When `pem` method is used, this parameter is ignored. <br>[(further information)](https://help.zerossl.com/hc/en-us/articles/360060198034-Legacy-Client-Compatibility-Cross-Signed-Root-Certificates "ZeroSSL Help Center: Legacy Client Compatibility Cross-Signed Root Certificates"). |

**Please Note**
Please note that only issued certificates can be downloaded.

#### API Responses based on `method` parameter:

`zip`:

If your API request is successful, the ZeroSSL API will return your certificate files wrapped in a ZIP-file.

`json`:

If your API request is successful, the ZeroSSL API will return your certificate files in JSON format. You will find an example API response carrying an example certificate below:

```
{
    "certificate.crt": "---BEGIN CERTIFICATE---{primary_certificate}---END CERTIFICATE---",
    "ca_bundle.crt": "---BEGIN CERTIFICATE---{certificate_bundle}---END CERTIFICATE---"
}
```

**Response attributes:**

| Parameter         | Description                                                      |
|-------------------|------------------------------------------------------------------|
| `certificate.crt` | `certificate.crt`Returns your primary certificate file.         |
| `ca_bundle.crt`   | `ca_bundle.crt`Returns your certificate bundle file.           |

`return` (deprecated):

This method is deprecated and will be removed in the future. Please use `json` instead.

`pem`:

If your API request is successful, the ZeroSSL API will return your primary certificate in plain text format.

`chain`:

If your API request is successful, the ZeroSSL API will return your certificate bundle in plain text format.

`xml`:

If your API request is successful, the ZeroSSL API will return your certificate files in XML format.

[List CA Certificates](https://zerossl.com/documentation/api/list-ca-certificates)
