EdgeNext
Documentation home

EdgeNext Documentation

Product guides, setup instructions, and technical references.

CDN

CreateModify Certificate

Endpoint

Request URL: domain/certificate (POST)

API Host: cdn.api.edgenext.com

API Version: v2

Description

Creates a new certificate or modifies an existing one.

Request Parameters

The following list only includes API-specific request parameters. Common request parameters must also be included for production calls — see the Common Request Parameters page.

POST Parameters

Parameters support multipart/form-data and JSON formats.

Parameter Data Type Required Description
certificate string Yes Certificate content — either base64-encoded certificate data or a certificate file upload
key string Yes Private key content — either base64-encoded key data or a key file upload
name string Yes Certificate name. Allowed characters: letters, digits, underscores, dots. Length: 0–64 characters
cert_id int Yes Certificate ID. When provided, the operation is an update; when omitted, a new certificate is created
user_name string No Omit by default — certificate is owned by the current account. Pass an account name to associate the certificate with another primary account under your hierarchy

Notes:

  1. When creating a new certificate, the cert_id parameter is not required. It is only used for modifying existing certificates.
  2. When modifying a certificate that is already bound to domains, the new certificate must cover all domains that the old certificate was bound to. The update only proceeds after validation passes; otherwise an error is returned. Certificates not bound to any domains can be updated directly.

Examples

# Method 1: Submit certificate as inline text
curl -X POST "https://cdn.api.edgenext.com/v2/domain/certificate?token={token}"\
    -H "Content-Type: application/json"\
    -d '{
    "certificate":"-----BEGIN CERTIFICATE-----\r\nMIIHMzCCBhugAwIBAgIQLyOuLqdE9WhqEuM3YWwsAzANBgkqhkiG9w0BAQsFADBE\r\nMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1E4EDYSWXh0US9flnZl8xEDDD\/t8ZO7dmNO6bkiVtA8TYXDuy\r\nwLYJdYN21801njaMGyvQC55n+TUX9eMai9G9dFnexca54nQaU0zG0sk32HZkUp7N\r\nf2mKH4CWrIv0U4znx+3w9rV7BcUmrXs=\r\n-----END CERTIFICATE-----",
    "key":"-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpgIBAAKCAQEAvBd8RZv94nDO1LTfa4sw6uuweKjrjU...xUbUm7gSP48mazY7\/x36LYcEmHLhhD\r\n-----END RSA PRIVATE KEY-----",
    "name":"certName"
}'

# Method 2: Submit certificate as file upload
curl -X POST "https://cdn.api.edgenext.com/v2/domain/certificate?token={token}"\
    -F "certificate=@/tmp/xxx.crt"\
    -F "key=@/tmp/xxx.key"\
    -F "cert_id=123"\
    -F "name=cert_name"

Response Example

JSON format:

{
    "code": 0,
    "data": {
        "cert_id": "123",
        "name": "testName",
        "certificate": "-----BEGIN CERTIFICATE-----\r\nMIIHMzCCBhugAwIBAgIQLyOuLqdE9WhqEuM3YWwsAzANBgkqhkiG9w0BAQsFADBE\r\nMQswCQYDVQQGEwJVUzEWMBQGA1U...UX9eMai9G9dFnexca54nQaU0zG0sk32HZkUp7N\r\nf2mKH4CWrIv0U4znx+3w9rV7BcUmrXs=\r\n-----END CERTIFICATE-----",
        "key": "-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpgIBAAKCAQEAvBd8R...xUbUm7gSP48mazY7/x36LYcEmHLhhD\r\n-----END RSA PRIVATE KEY-----",
        "bind_domains": [], // Domains bound to this certificate
        "cert_start_time": "2016-07-27 08:00:00", // Certificate validity start date
        "cert_expire_time": "2019-06-19 07:59:59" // Certificate expiration date
    }
}

Response Headers

HTTP/1.0 200 OK
Api-Id:                782708629
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute
X-Ratelimit-Limit:     100
X-Ratelimit-Remaining: 100
X-Retry-After:         41

Need help? Contact our support team at support@edgenext.com.

Back to documentation home