Create a User

post

/api/v2/users/

Make a POST request to this resource with the following user fields to create a new user:

  • username: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. (string, required)
  • first_name: (string, default="")
  • last_name: (string, default="")
  • email: (string, default="")
  • is_superuser: Designates that this user has all permissions without explicitly assigning them. (boolean, default=False)
  • is_system_auditor: (boolean, default=False)
  • password: Write-only field used to change the password. (string, default="")

Request

Supported Media Types
Body ()
Root Schema : schema
Example:
{
    "email":"a@a.com",
    "first_name":"a",
    "is_superuser":false,
    "last_name":"a",
    "password":"r$TyKiOCb#ED",
    "username":"affable"
}
Back to Top

Response

Supported Media Types

201 Response

Body
Example Response (application/json)
{
    "auth":[
    ],
    "created":"2018-02-01T08:00:00.000000Z",
    "email":"a@a.com",
    "external_account":null,
    "first_name":"a",
    "id":"3",
    "is_superuser":false,
    "is_system_auditor":false,
    "last_login":null,
    "last_name":"a",
    "ldap_dn":"",
    "modified":null,
    "related":{
        "access_list":"/api/v2/users/3/access_list/",
        "activity_stream":"/api/v2/users/3/activity_stream/",
        "admin_of_organizations":"/api/v2/users/3/admin_of_organizations/",
        "authorized_tokens":"/api/v2/users/3/authorized_tokens/",
        "credentials":"/api/v2/users/3/credentials/",
        "organizations":"/api/v2/users/3/organizations/",
        "personal_tokens":"/api/v2/users/3/personal_tokens/",
        "projects":"/api/v2/users/3/projects/",
        "roles":"/api/v2/users/3/roles/",
        "teams":"/api/v2/users/3/teams/",
        "tokens":"/api/v2/users/3/tokens/"
    },
    "summary_fields":{
        "user_capabilities":{
            "delete":true,
            "edit":true
        }
    },
    "type":"user",
    "url":"/api/v2/users/3/",
    "username":"affable"
}

400 Response

Body
Example Response (application/json)
{
    "username":[
        "A user with that username already exists."
    ]
}
Back to Top