Users - Create

The create User endpoint allows existing Cogniac users to create new users within their authenticated tenant.

To create a new user the following fields should be passed:

NameExampleDescription
given_name
string
"Jane"First Name
surname
string
"Smith"Last Name
email
string
"[email protected]"Email address used for logging into the Cogniac system.
password
string
"123ABCdef"Can be modified, but not returned to user with GET calls.

Password Requirements
Minimum Password Length: 8
Maximum Password Length: 100
Minimum Number Of Required Lowercase Characters: 1
Minimum Number Of Required Numeric Characters: 1

Symbol and Diacritic characters are allowed, but not required.
POST /1/users
Host: https://api.cogniac.io

Example: Creating a New User

curl -X POST https://api.cogniac.io/1/users \
-H "Authorization: Bearer abcdefg.hijklmnop.qrstuvwxyz" \
-H "Content-Type: application/json" \
-d \
'{
  "given_name":"Jane",
  "surname":"Smith",
  "email":"[email protected]",
  "password": "MySecurePassW@rd123"
}'
import requests

my_headers = {"Authorization": "Bearer abcdefg.hijklmnop.qrstuvwxyz"}
user_data = {
  "given_name":"Jane",
  "surname":"Smith",
  "email":"[email protected]",
  "password": "MySecurePassW@rd123"
}

res = requests.post("https://api.cogniac.io/1/users",
                    data=user_data,
                    headers=my_headers)
{
   "user_id": "2ke2daisdflkj",
   "given_name":"Jane",
   "surname":"Smith",
   "status":"ENABLED",
   "email":"[email protected]",
   "tenant_id": "pipoyp63lqc7",
   "tenant_name": "Jane Smith Tenant",
   "tenant_type": "usertenant",
   "created_at": 1508431720,
   "modified_at": 1508431720
 }