--- title: "Add user" source_url: https://dev.digicert.com/certcentral-apis/services-api/users/add-user.html api_method: POST api_endpoint: "/services/v2/user" api_url: "https://www.digicert.com/services/v2/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](https://dev.digicert.com/md/certcentral-apis/services-api/containers/list-container-roles.md) endpoint. > **Info** > > By default, the user will be created in the same container as the user associated with the API key used with the request. ## Example requests and responses **cURL** ```bash 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", "access_roles": [ { "id": 5 } ] }' ``` **Python** ```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 \"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** ```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 \"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** ```javascript 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', access_roles: [ { id: 5 } ] }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); ``` ## 201 Created ```json { "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 |
| 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 | optional | object | Details of the user container. Note: The container request parameter exists for a legacy use case. To restrict a user's access to one or more divisions, use the container_id_assignments array, instead. |
| .. id | optional | int | ID of the container the user will be created under. |
| access_roles | required | array | Container for access role ID. |
| .. 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 (divisions) the user will be assigned to. If set, this will override any default containers the user can view. |
| is_saml_sso_only | optional | bool | If true, the user can only log in to CertCentral via SAML SSO.Default: false |
| Name | Type | Description |
|---|---|---|
| id | int | ID of the created user. |