Generates a new CSR and private key for this region. The private key is securely stored and never exposed. Use the returned CSR to obtain a CA-signed certificate, which can later be uploaded via the replace endpoint. If a pending CSR/private key already exists, the API returns 409 by default. To explicitly replace the pending CSR/private key, call this endpoint with overwrite=true.
X-XSRF-TOKEN String required
xXSRFTOKEN_example
Cookie String required
cookie_example
overwrite
Boolean
If true, overwrite existing pending CSR/private key for this region. If false or omitted, the API returns 409 when a pending CSR/private key already exists.
If true, overwrite existing pending CSR/private key for this region. If false or omitted, the API returns 409 when a pending CSR/private key already exists.
true
false
curl -X 'POST'
\
-H
'Accept: application/json'
-H
'Content-Type: application/json'
-H
'X-XSRF-TOKEN: xXSRFTOKEN_example'
-H
'Cookie: cookie_example'
'/mapi/v1/internal_certificates/generate_csr?overwrite=true'
-d
'{
"country" : "country",
"commonName" : "commonName",
"organization" : "organization",
"locality" : "locality",
"sanList" : [ "sanList", "sanList" ],
"state" : "state",
"email" : "email",
"organizationalUnit" : "organizationalUnit"
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\"organization\":\"string\",\"organizationalUnit\":\"string\",\"country\":\"string\",\"state\":\"string\",\"locality\":\"string\",\"email\":\"string\",\"commonName\":\"string\",\"sanList\":[\"string\"]}"
headers = {
'X-XSRF-TOKEN': "SOME_STRING_VALUE",
'Cookie': "SOME_STRING_VALUE",
'Authorization': "Bearer REPLACE_BEARER_TOKEN",
'content-type': "application/json"
}
conn.request("POST", "/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))require 'uri'
require 'net/http'
require 'openssl'
url = URI("https://example.com/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["X-XSRF-TOKEN"] = 'SOME_STRING_VALUE'
request["Cookie"] = 'SOME_STRING_VALUE'
request["Authorization"] = 'Bearer REPLACE_BEARER_TOKEN'
request["content-type"] = 'application/json'
request.body = "{\"organization\":\"string\",\"organizationalUnit\":\"string\",\"country\":\"string\",\"state\":\"string\",\"locality\":\"string\",\"email\":\"string\",\"commonName\":\"string\",\"sanList\":[\"string\"]}"
response = http.request(request)
puts response.read_bodyconst data = JSON.stringify({
"organization": "string",
"organizationalUnit": "string",
"country": "string",
"state": "string",
"locality": "string",
"email": "string",
"commonName": "string",
"sanList": [
"string"
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://example.com/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE");
xhr.setRequestHeader("X-XSRF-TOKEN", "SOME_STRING_VALUE");
xhr.setRequestHeader("Cookie", "SOME_STRING_VALUE");
xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);HttpResponse<String> response = Unirest.post("https://example.com/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE")
.header("X-XSRF-TOKEN", "SOME_STRING_VALUE")
.header("Cookie", "SOME_STRING_VALUE")
.header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
.header("content-type", "application/json")
.body("{\"organization\":\"string\",\"organizationalUnit\":\"string\",\"country\":\"string\",\"state\":\"string\",\"locality\":\"string\",\"email\":\"string\",\"commonName\":\"string\",\"sanList\":[\"string\"]}")
.asString();import Foundation
let headers = [
"X-XSRF-TOKEN": "SOME_STRING_VALUE",
"Cookie": "SOME_STRING_VALUE",
"Authorization": "Bearer REPLACE_BEARER_TOKEN",
"content-type": "application/json"
]
let parameters = [
"organization": "string",
"organizationalUnit": "string",
"country": "string",
"state": "string",
"locality": "string",
"email": "string",
"commonName": "string",
"sanList": ["string"]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://example.com/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://example.com/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"organization\":\"string\",\"organizationalUnit\":\"string\",\"country\":\"string\",\"state\":\"string\",\"locality\":\"string\",\"email\":\"string\",\"commonName\":\"string\",\"sanList\":[\"string\"]}",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer REPLACE_BEARER_TOKEN",
"Cookie: SOME_STRING_VALUE",
"X-XSRF-TOKEN: SOME_STRING_VALUE",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://example.com/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "X-XSRF-TOKEN: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Cookie: SOME_STRING_VALUE");
headers = curl_slist_append(headers, "Authorization: Bearer REPLACE_BEARER_TOKEN");
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"organization\":\"string\",\"organizationalUnit\":\"string\",\"country\":\"string\",\"state\":\"string\",\"locality\":\"string\",\"email\":\"string\",\"commonName\":\"string\",\"sanList\":[\"string\"]}");
CURLcode ret = curl_easy_perform(hnd);var client = new RestClient("https://example.com/mapi/v1/internal_certificates/generate_csr?overwrite=SOME_BOOLEAN_VALUE");
var request = new RestRequest(Method.POST);
request.AddHeader("X-XSRF-TOKEN", "SOME_STRING_VALUE");
request.AddHeader("Cookie", "SOME_STRING_VALUE");
request.AddHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"organization\":\"string\",\"organizationalUnit\":\"string\",\"country\":\"string\",\"state\":\"string\",\"locality\":\"string\",\"email\":\"string\",\"commonName\":\"string\",\"sanList\":[\"string\"]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);organizationstringOrganization (O) for the CSR subject DN
Organization (O) for the CSR subject DN
organizationalUnitstringOrganizational unit (OU) for the CSR subject DN
Organizational unit (OU) for the CSR subject DN
countrystringCountry (C) for the CSR subject DN
Country (C) for the CSR subject DN
statestringState or province (ST) for the CSR subject DN
State or province (ST) for the CSR subject DN
localitystringLocality or city (L) for the CSR subject DN
Locality or city (L) for the CSR subject DN
emailstringEmail address for the CSR subject DN
Email address for the CSR subject DN
commonNamestringCommon name (CN) for the CSR subject DN
Common name (CN) for the CSR subject DN
sanListarray[string]Subject alternative names to include on the CSR
Subject alternative names to include on the CSR
{
"organization": "example",
"organizationalUnit": "example",
"country": "example",
"state": "example",
"locality": "example",
"email": "example",
"commonName": "example",
"sanList": [
"example"
]
}