Rest Users » History » Version 3

Version 2 (Bevan Rudge, 2011-07-05 01:11) → Version 3/27 (Jean-Philippe Lang, 2011-08-01 18:23)

h1. Users


h2. Listing users

GET /users.xml

Returns users.

h2. Showing a user

GET /users/[id].xml

Returns the user of given id.

GET /users/current.xml

Returns the user whose credentials are used to access the API.


* @include@ (optional): a coma separated list of associations to include in the response:

* @memberships@


GET /users/3.xml?include=memberships /users/3.json?include=memberships

Returns the details about user ID 3, and additional detail about the user's project roles and memberships.


<custom_fields type="array" />
<memberships type="array">
<project name="Redmine" id="1"/>
<roles type="array">
<role name="Administrator" id="3"/>
<role name="Contributor" id="4"/>
*There are probably other such undocumented features like this*.

h2. Creating a user

POST /users.xml

Creates a user.


* @user@ (required): a hash of the user attributes, including:

* @login@ (required): the user login
* @password@: the user password
* @firstname@ (required)
* @lastname@ (required)
* @mail@ (required)


* @201 Created@: user was created
* @422 Unprocessable Entity@: user was not created due to validation failures (response body contains the error messages)

h2. Updating a user

PUT /users/[id].xml


* @user@ (required): a hash of the user attributes

Updates the user of given id.

h2. Deleting a user

Deleting a user is not supported yet.