Import a certificate
Requires Create certificate and available imported-certificate quota. Supply a PEM chain and matching unencrypted PEM private key. The certificate is not automatically assigned to a distribution.
POST
/
tls-manager
/
certificates
Import a certificate
curl --request POST \
--url https://api.aptranet.com/tls-manager/certificates \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"certificate": "<string>",
"private_key": "<string>"
}
'import requests
url = "https://api.aptranet.com/tls-manager/certificates"
payload = {
"name": "<string>",
"certificate": "<string>",
"private_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', certificate: '<string>', private_key: '<string>'})
};
fetch('https://api.aptranet.com/tls-manager/certificates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/tls-manager/certificates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 2,
"name": "<string>",
"type": "managed",
"read_only": true,
"status": "active",
"domains": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z",
"provisioning": true,
"type_label": "<string>",
"issuer": "<string>",
"serial_number": "<string>",
"fingerprint_sha256": "<string>",
"subject_cn": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"not_before": "2023-11-07T05:31:56Z",
"issuing": {
"status": "<string>",
"active": true,
"attempts": 123,
"started": "<string>",
"finished": "<string>",
"next_attempt": "<string>",
"error": "<string>",
"details": "<string>",
"retry_after": "<string>"
}
}{
"error": "<string>",
"error_description": "<string>"
}Authorizations
Project API access key.
Current secret for the access key.
Body
application/json
Unique project name; at most 64 UTF-8 bytes, without control characters.
Maximum string length:
64PEM certificate chain, at most 256 KiB.
Matching unencrypted PEM private key, at most 64 KiB. Never log this value.
Response
Successful response.
Required range:
x >= 1Available options:
managed, advanced_managed, imported Available options:
active, expired, pending Show child attributes
Show child attributes
Import a certificate
curl --request POST \
--url https://api.aptranet.com/tls-manager/certificates \
--header 'Aptranet-Secret: <api-key>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"certificate": "<string>",
"private_key": "<string>"
}
'import requests
url = "https://api.aptranet.com/tls-manager/certificates"
payload = {
"name": "<string>",
"certificate": "<string>",
"private_key": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Aptranet-Secret": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Aptranet-Secret': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({name: '<string>', certificate: '<string>', private_key: '<string>'})
};
fetch('https://api.aptranet.com/tls-manager/certificates', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aptranet.com/tls-manager/certificates"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"certificate\": \"<string>\",\n \"private_key\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Aptranet-Secret", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": 2,
"name": "<string>",
"type": "managed",
"read_only": true,
"status": "active",
"domains": [
"<string>"
],
"valid_until": "2023-11-07T05:31:56Z",
"provisioning": true,
"type_label": "<string>",
"issuer": "<string>",
"serial_number": "<string>",
"fingerprint_sha256": "<string>",
"subject_cn": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"not_before": "2023-11-07T05:31:56Z",
"issuing": {
"status": "<string>",
"active": true,
"attempts": 123,
"started": "<string>",
"finished": "<string>",
"next_attempt": "<string>",
"error": "<string>",
"details": "<string>",
"retry_after": "<string>"
}
}{
"error": "<string>",
"error_description": "<string>"
}