v1

latestOpenAPI 3.0.2cPanel License2026-08-06657427.1 MB
SSL
SSL Certificate Management

Create certificate signing request

This function generates a certificate signing request (CSR).

Note:

This function requires a valid key in the account's ssl directory. You can generate a key with UAPI's SSL::generate_key function.

Important:

When you disable the Calendars and Contacts, Receive Mail, Web Disk, Webmail, and WebServer roles, the system disables this function.

get/SSL/generate_csr

Query parameters

countryNamestring ISO-3166-1 (alpha-2) required
Example:US

The two-letter country code.

domainsstring required

A comma-separated list of the domains for which to generate the certificate.

key_idstring required
Example:example_com_cb497_a394d_1397249671_d1272da8f13a1fd837493a5ad1f0a0f3

The key's ID.

localityNamestring required
Example:Houston

The certificate's city or locality name.

organizationNamestring required
Example:Organization

The certificate's organization.

stateOrProvinceNamestring required
Example:Texas

The certificate's state or locality name.

emailAddressstring email
Example:username@example.com

An email address to associate with the certificate.

friendly_namestring
Example:TestCert

A friendly name for the new certificate.

This parameter defaults to the domain name for which you generated the certificate.

organizationalUnitNamestring
Example:Department

The certificate's organizational unit or department name.

Response

HTTP Request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "generate_csr",
  "module": "SSL",
  "result": {
    "data": {
      "commonName": "example.com",
      "created": 1569884400,
      "domains": [
        "example.com"
      ],
      "ecdsa_curve_name": "prime256v1",
      "friendly_name": "TestCSR",
      "id": "example_com_a74f7_9dddf_1446659822_eae1ff43c4ec1991e195877c55755eff",
      "key_algorithm": "rsaEncryption",
      "modulus": "a673c3b17344664b35f8791f562d3aea6bf4d8faa3ae3fc0a519380fd453964a36677c34d48677ecb7f5ed035df026f5f0f8fbfe21745e52daf1f3b9e58c73f0baefdb709320e2202e7d05250b051a59b30ff1fef22d83d7140c1c81cea314a0890ce8d2226799872181c58a74016c7aaa2cff5ac72b575cecde8f304aa572a2ea03d8b173ab76c6e8cdb9dfd0da81e1119cefd4b8b4dbfbe0e46c7f1ee2fe8b5fd5504e58ccbc0d13b4fa41ecc9ebd0dabe1d1fec5c724f748167e7c0553e997f9b77eb36abce70973f06df151748d41b758de3efd7afa6f2464a1547f5ff158469d96e248be464df9eda0e7ce854a89332a2c1278b17c425368a9604f454db",
      "text": "-----BEGIN CERTIFICATE REQUEST-----\nMIIC3TCCAcUCAQAwgZcxFDASBgNVBAMMC2V4YW1wbGUuY29tMRYwFAYDVQQLDA1E\nb2N1bWVudGF0aW9uMQswCQYDVQQGEwJVUzEiMCAGCSqGSIb3DQEJARYTbGF1cmVu\nY2VAY3BhbmVsLm5ldDEUMBIGA1UECgwLY1BhbmVsIEluYy4xDjAMBgNVBAgMBVRl\neGFzMRAwDgYDVQQHDAdIb3VzdG9uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAp092NvpqyT7mg2qDqZW1XetQGeo217o9r7AOONaTrNsMgbL/d31rQzpC\nD65SPxJ/NSpovMi48tbue3A5W6+r2CN62oFk/d34N2swN1w11NTLzOfTPQgGnBe0\nCRdqNonx68l8Cwj+auRMGakqxtaESOfx0T87Ngr/1CIqUbTzU0LembWh+1VI5Djy\n2CRmRWKkSAAu7X/OJN7cfcPh7ReZc9Ha6VmzNxbutBDRcnCJVOAGMsv2Cg4mQZhg\nyMC8KF1r/ktHneDdGJdypdrmdr0qkqzMwTaYIb6M/93Yp+bswGH4oyqa4GYeTpRu\n2OOCeydxONOnYRZWfL0SnL2Gnvnd3wIDAQABoAAwDQYJKoZIhvcNAQEFBQADggEB\nAFlolzJbcviWcdZUv+PJ7G8cAqFAxa8a3W2a0Y1U0BaMrpDfuOHpQgOtO62rr+i+\nhkrIReuk7Isyl6GoZkX17KhQ1Vo9aW8a8Ur7+0RGDbxRlK9jJWnvSFn6cMMqRSfA\nDXpptxhqBFZJIZMc3pPX9Jqycuu8bxeIvUKeSMe3Jxcl1ZXEXX47FeRZxvd+WXF9\n4Xu4KZXHdzb5tB6jPhzIaN0/3d92N/KhvCcnw3YC2fEGDkpOlZaoa7O72+aq5K3b\nM1htFv9deAHqIHefV41iOrxUCIKIhdPIjvAm774lDHLzPpJVrshO/NpA74LEkny5\nFMwKKx+6Jgx1HSWucn5kWek=\n-----END CERTIFICATE REQUEST-----"
    },
    "messages": [
      "Certificate Signing Request generated!"
    ],
    "status": 1
  }
}