Generate private key w/ CSR via iControl REST

Problem this snippet solves:

Generate a private key w/ CSR

How to use this snippet:

To create a private key with a CSR via iControl REST:



Use the data below as your payload.

For the name field, it must end in .key or you will get a false 404!

Code :

"organization":"Let It Snow Corp.",  
"ou":"Ice Engineering",  

Tested this on version:

Published Aug 13, 2019
Version 1.0

Was this article helpful?


  • Hi Gregory,

    Thanks for the post! is there a GET or any other API to pull the newly created/generated CSR?


  • Tushar,


    Take a look at this:


    Let me know if that doesn't help.

  • The same can be done with python SDK:'', options=[{"gen-csr":""}], commonName='', country='BE', city='Brussels', organization='AEL Lab', ou='IT', subjectAlternativeName=',')

    But couldn't find a way to retrieve the CSR file or text directly with SDK? I guess we have to go via

  • This helped me a lot!


    Gregory do you know from here how I could retrieve the CSR and key text directly using the iControl RestAPI?

  • How can I specify a partition? When added to JSON it seems to be ignored

  •  add the following key pair in the above payload, it works for me



    note: replace PART1 with your partition you want to generate the key on.

  •  Here is the pay payload and URI for the CSR generations


    Please note, you need to have key generated before prior to create the CSR.

    	"name": "",  
    	"commonName": "",
    	"key": "",  
    	"organization": "Cutomer4",  
    	"ou": "Engineering",  
    	"city": "London",  
    	"state_or_province_name": "England",
        "country": "UK",
    	"email-address": ""