Skip to main content

Create a user

Use this example to create a user with a raw Administration API request.

Authenticate first

This example assumes you already completed Authenticate an Admin API application and are sending the returned auth token in the Authorization header.

Submit a POST request to create a User on your account. The format of the URL is:

https://<domainname>.<region>.trustedauth.com/api/web/v3/users

An Authorization header field must be included in the header section of this request. The Authorization header stores the value received as "token" in the authentication request. The Authorization header can be sent with or without a type value of "Bearer". For example:

Authorization: Bearer <token>

or

Authorization: <token>

The body of this request must contain all the fields mentioned in the example below that are configured as mandatory:

{
"firstName": "john",
"lastName": "smith",
"email": "johnsmith@organization.com",
"userId": "john",
"mobile": "+16138561234",
"phone": "+161385699876",
"locale": "",
"state": "ACTIVE",
"externalId": null,
"externalSource": null,
"userAttributeValues": [],
"userAliases": [
{
"value": "johnny",
"type": "CUSTOM"
}
]
}

In this example, all the required input parameters have been provided. The request would succeed and generate a response that includes all the details of the created user. For example:

{
"id": "2c422a2f-e8ae-4af8-8b03-e1ce0ddde0b0",
"userId": "john",
"firstName": "john",
"lastName": "smith",
"email": "johnsmith@organization.com",
"mobile": "+16138561234",
"phone": "+161385699876",
"locale": null,
"state": "ACTIVE",
"externalId": null,
"externalSource": null,
"migrated": null,
"locked": false,
"lockoutExpiry": null,
"otpCreateTime": null,
"grids": [],
"tokens": [
{
"id": "9a2edcc5-46f0-4fff-89b1-13c0f73e1a5c",
"type": "ENTRUST_SOFT_TOKEN",
"serialNumber": "62461-69384",
"loadDate": "2018-05-29T19:12:54.000+0000",
"lastUsedDate": null,
"state": "ACTIVATING",
"platform": null,
"registeredForTransactions": false,
"name": null,
"allowedActions": ["REACTIVATE", "ACTIVATE_COMPLETE", "DELETE"],
"description": null,
"userId": null
}
],
"smartCredentials": [],
"tempAccessCode": null,
"userAttributeValues": [],
"userAliases": [
{
"id": "43422a2f-e8ae-4af8-8b03-e1ce0ddde0b0",
"userId": "c633a710-70bd-411e-86be-e1898f1b19f5",
"value": "johnny",
"type": "CUSTOM"
},
{
"id": "2c422a2f-e8ae-4af8-8b03-e1ce0ddde0b0",
"userId": "c633a710-70bd-411e-86be-e1898f1b19f5",
"value": "john",
"type": "USERID"
}
],
"groups": [],
"type": "MGMT_UI"
}