Add user

POST
https://www.digicert.com/services/v2/user

Use this endpoint to create a new user. To get available access roles, use the List container roles endpoint.

By default, the user will be created in the same container as the user associated with the API key used with the request.

cURL
curl -X POST \
  https://www.digicert.com/services/v2/user \
  -H 'Content-Type: application/json' \
  -H 'X-DC-DEVKEY: {{api_key}}' \
  -d '{
    "first_name": "Jill",
    "last_name": "Valentine",
    "email": "jill.valentine@pd.racoon-city.gov",
    "telephone": "555-555-5555",
    "job_title": "S.T.A.R.S. Alpha Team",
    "username": "jill.valentine",
    "container": {
        "id": 93288
    },
    "access_roles": [
        {
            "id": 5
        }
    ]
}'
Python
import requests

url = "https://www.digicert.com/services/v2/user"

payload = "{\n    \"first_name\": \"Jill\",\n    \"last_name\": \"Valentine\",\n    \"email\": \"jill.valentine@pd.racoon-city.gov\",\n    \"telephone\": \"555-555-5555\",\n    \"job_title\": \"S.T.A.R.S. Alpha Team\",\n    \"username\": \"jill.valentine\",\n    \"container\": {\n        \"id\": 93288\n    },\n    \"access_roles\": [\n        {\n            \"id\": 5\n        }\n    ]\n}"
headers = {
    'X-DC-DEVKEY': "{{api_key}}",
    'Content-Type': "application/json"
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)
Go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://www.digicert.com/services/v2/user"

	payload := strings.NewReader("{\n    \"first_name\": \"Jill\",\n    \"last_name\": \"Valentine\",\n    \"email\": \"jill.valentine@pd.racoon-city.gov\",\n    \"telephone\": \"555-555-5555\",\n    \"job_title\": \"S.T.A.R.S. Alpha Team\",\n    \"username\": \"jill.valentine\",\n    \"container\": {\n        \"id\": 93288\n    },\n    \"access_roles\": [\n        {\n            \"id\": 5\n        }\n    ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-DC-DEVKEY", "{{api_key}}")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
NodeJS
var request = require("request");

var options = { method: 'POST',
  url: 'https://www.digicert.com/services/v2/user',
  headers: 
   { 'Content-Type': 'application/json',
     'X-DC-DEVKEY': '{{api_key}}' },
  body: 
   { first_name: 'Jill',
     last_name: 'Valentine',
     email: 'jill.valentine@pd.racoon-city.gov',
     telephone: '555-555-5555',
     job_title: 'S.T.A.R.S. Alpha Team',
     username: 'jill.valentine',
     container: { id: 93288 },
     access_roles: [ { id: 5 } ] },
  json: true };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
201 Created
{
    "id": 1538858
}

Request parameters

Name Req/Opt Type Description
username required string Username for the profile.
Valid characters: a–z A–Z 0–9 @ - _ + .
first_name required string First name of the user.
Character limit: 128
last_name required string Last name of the user.
Character limit: 128
email required string Email address of the user.
Accepts only valid email addresses.
Character limit: 255
job_title optional string Job title of the user.
Required for user to be an EV approver.
Character limit: 64
telephone optional string Telephone number of the user.
Required for user to be an EV approver.
Character limit: 64
container required object
.. id required int ID of the container the user will be created under.
access_roles required array
.. id required int ID of the access role to assign the user.
See Glossary – Access roles
container_id_assignments required array List of container IDs the user will be assigned to. If set, this will override any default containers the user can view.

Response parameters

Name Type Description
id int ID of the created user.