Creating users

Promana provides a number of ways to create users, with optional automatic group assignment and other downstream effects.

Basic request

POST https://{APIDOMAIN}/api-v1/users/create

Parameters

sex: Required; must be M or F
country: Required; must be a valid ISO Alpha-2 country code – see Geography
occupation: Required; must be a valid ISCO occupation code – see Occupations
group_uuid: Optional; if passed, must be a valid group UUID (any UUID of a previously-created group within your org) – see Groups

Response (when no group_uuid is passed):

{
    "message": "User created",
    "data": {
        "uuid": "e0d558ef-929b-47f9-b40a-3515622c69a4",
        "sex": "F",
        "occupation": {
            "code": "221",
            "name": "Medical doctors"
        },
        "country": "GB"
    }
}
 

Response (when a group_uuid is passed):

{
    "message": "User created",
    "data": {
        "uuid": "15ec6214-3acd-40b8-a67a-3b22e4c100c2",
        "sex": "F",
        "occupation": {
            "code": "221",
            "name": "Medical doctors"
        },
        "member_of": {
            "name": "NHS",
            "uuid": "6e6c3c25-2896-4f69-90b2-1a50605f2cc5"
        },
        "country": "GB"
    }
}

See also