--- title: "Email certificate" source_url: https://dev.digicert.com/certcentral-apis/services-api/certificates/email-certificate.html api_method: PUT api_endpoint: "/services/v2/certificate/{{certificate_id}}/sendemail" api_url: "https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail" --- **PUT** `https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail` Use this endpoint to send a copy of an issued SSL/TLS certificate or a Verified Mark Certificate to one or more email addresses. ## Example requests and responses **cURL** ```bash curl -X PUT \ 'https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail' \ -H 'Content-Type: application/json' \ -H 'X-DC-DEVKEY: {{api_key}}' \ -d '{ "emails": [ "jill.valentine@example.com", "leon.kennedy@example.com" ], "certificate_collect_format": "attachment", "custom_message": "Please install this certificate!" }' ``` **Python** ```python import requests url = "https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail" payload = "{\n\t\"emails\": [\n\t\t\"jill.valentine@example.com\",\n\t\t\"leon.kennedy@example.com\"\n\t],\n\"certificate_collect_format\": \"attachment\",\n \"custom_message\": \"Please install this certificate!\"\n}" headers = { 'X-DC-DEVKEY': "{{api_key}}", 'Content-Type': "application/json" } response = requests.request("PUT", url, data=payload, headers=headers) print(response.text) ``` **Go** ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail" payload := strings.NewReader("{\n\t\"emails\": [\n\t\t\"jill.valentine@example.com\",\n\t\t\"leon.kennedy@example.com\"\n\t],\n\"certificate_collect_format\": \"attachment\",\n \"custom_message\": \"Please install this certificate!\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("X-DC-DEVKEY", "{{api_key}}") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` **NodeJS** ```javascript var request = require("request"); var options = { method: 'PUT', url: 'https://www.digicert.com/services/v2/certificate/{{certificate_id}}/sendemail', headers: { 'Content-Type': 'application/json', 'X-DC-DEVKEY': '{{api_key}}' }, body: { emails: [ 'jill.valentine@example.com', 'leon.kennedy@example.com' ], certificate_collect_format: 'attachment', custom_message: 'Please install this certificate!'}, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); ``` ## 204 No Content ```json // empty ``` ## Request parameters
| Name | Req/Opt | Type | Description |
|---|---|---|---|
| emails | required | array | List of one or more email addresses to receive the certificate. |
| certificate_collect_format | required | string | Select how you want to send the certificate. Allowed values: attachment, plaintext, downloadlink |
| custom_message | optional | string | Custom message to send with the email. |