Skip to content

Users API

Drew Winstel edited this page Jun 9, 2019 · 1 revision

Users

Supports registering, viewing, and updating user accounts.

Register a new user account

Request:

POST /users/

Parameters:

Name Type Required Description
username string Yes The username for the new user.
password string Yes The password for the new user account.
first_name string No The user's given name.
last_name string No The user's family name.
email string No The user's email address.

Note:

  • Only admins can create users via the API for now.

Response:

Content-Type application/json
201 Created

{
  "id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
  "username": "richard",
  "first_name": "Richard",
  "last_name": "Hendriks",
  "email": "[email protected]",
  "auth_token": "132cf952e0165a274bf99e115ab483671b3d9ff6"
}

The auth_token returned with this response should be stored by the client for authenticating future requests to the API. See Authentication.

Get a user's profile information

Request:

GET /users/:id

Parameters:

Note:

  • Protected by auth

Response:

Content-Type application/json
200 OK

{
  "id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
  "username": "richard",
  "first_name": "Richard",
  "last_name": "Hendriks",
  "email": "[email protected]",
}

Update your profile information

Request:

PUT/PATCH /users/:id

Parameters:

Name Type Description
first_name string The first_name of the user object.
last_name string The last_name of the user object.
email string The user's email address.

Note:

  • All parameters are optional
  • Authorization Protected

Response:

Content-Type application/json
200 OK

{
  "id": "6d5f9bae-a31b-4b7b-82c4-3853eda2b011",
  "username": "richard",
  "first_name": "Richard",
  "last_name": "Hendriks",
  "email": "[email protected]",
}
Clone this wiki locally