Generate a CSR and private key for the region

Virtual Storage Platform One Object Management API Reference Guide

Version
3.4.x
FileSize
160 KB
Audience
anonymous
Part Number
MK-24VSP1OB002-04
ft:lastEdition
2026-09-09
Product
Virtual Storage Platform One Object
post /v1/internal_certificates/generate_csr

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.

Authentication: OAuth OAuth2
Request headers
X-XSRF-TOKEN String required
Example: xXSRFTOKEN_example
Cookie String required
Example: cookie_example
Query parameters
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.

Example: true
Default: false
CLIENT REQUEST
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_body
const 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);
Body parameters
required
application/json
organizationstring

Organization (O) for the CSR subject DN

organizationalUnitstring

Organizational unit (OU) for the CSR subject DN

countrystring

Country (C) for the CSR subject DN

statestring

State or province (ST) for the CSR subject DN

localitystring

Locality or city (L) for the CSR subject DN

emailstring

Email address for the CSR subject DN

commonNamestring

Common name (CN) for the CSR subject DN

sanListarray[string]

Subject alternative names to include on the CSR

REQUEST
{ "organization": "example", "organizationalUnit": "example", "country": "example", "state": "example", "locality": "example", "email": "example", "commonName": "example", "sanList": [ "example" ] }
Responses

CSR generated successfully.

Body
application/json
csrPemstring

PEM-encoded certificate signing request

subjectDnstring

Subject distinguished name encoded in the CSR

sanListarray[string]

Subject alternative names encoded in the CSR

generatedAtstringdate-time

Timestamp when the CSR was generated

RESPONSE
{ "csrPem": "example", "subjectDn": "example", "sanList": [ "example" ], "generatedAt": "2020-01-01T12:00:00Z" }

Invalid request (missing or malformed fields).

Body
application/json
codestring

Error code

messagestring

Error message

detailsstring

Error details

pendingCsrobject
existsboolean

Whether a pending CSR and private key exist for this region

generatedAtstringdate-time

Timestamp when the pending CSR was generated

subjectDnstring

Subject distinguished name on the pending CSR

sanListarray[string]

Subject alternative names on the pending CSR

RESPONSE
{ "code": "example", "message": "example", "details": "example", "pendingCsr": { "exists": false, "generatedAt": "2020-01-01T12:00:00Z", "subjectDn": "example", "sanList": [ "example" ] } }

Access was denied due to invalid credentials.

Forbidden.

Method not allowed.

Pending CSR/private key already exists and overwrite was not requested. The response body includes a populated pendingCsr object with generatedAt, subjectDn, and sanList so the UI overwrite dialog can be pre-populated.

Body
application/json
codestring

Error code

messagestring

Error message

detailsstring

Error details

pendingCsrobject
existsboolean

Whether a pending CSR and private key exist for this region

generatedAtstringdate-time

Timestamp when the pending CSR was generated

subjectDnstring

Subject distinguished name on the pending CSR

sanListarray[string]

Subject alternative names on the pending CSR

RESPONSE
{ "code": "example", "message": "example", "details": "example", "pendingCsr": { "exists": false, "generatedAt": "2020-01-01T12:00:00Z", "subjectDn": "example", "sanList": [ "example" ] } }

Internal server error.