Jump to >

User List Resource

Creates and provides information on users.

If a user’s profile is private, the fields email, first_name, last_name, and fullname will be omitted for non-staff users.

Details

Name users
URI /api/users/
Token Policy ID user
HTTP Methods
  • GET -

    Retrieves the list of users on the site.

  • POST -

    Create a new user.

Parent Resource

Root List Resource

Child Resources
Anonymous Access

Yes, if anonymous site access is enabled

HTTP GET

Retrieves the list of users on the site.

This includes only the users who have active accounts on the site. Any account that has been disabled (for inactivity, spam reasons, or anything else) will be excluded from the list.

The list of users can be filtered down using the q and fullname parameters.

Setting q to a value will by default limit the results to usernames starting with that value. This is a case-insensitive comparison.

If fullname is set to 1, the first and last names will also be checked along with the username. fullname is ignored if q is not set.

For example, accessing /api/users/?q=bo&fullname=1 will list any users with a username, first name or last name starting with bo.

Inactive users will not be returned by default. However by providing ?include-inactive=1 they will be returned.

Request Parameters

counts-onlyBoolean

If specified, a single count field is returned with the number of results, instead of the results themselves.

fullnameBoolean

Specifies whether q should also match the beginning of the first name or last name. Ignored if q is not set.

include-inactiveBoolean

If set, users who are marked as inactive (their accounts have been disabled) will be included in the list.

max-resultsInteger

The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link.

qString

The string that the username (or the first name or last name when using fullname) must start with in order to be included in the list. This is case-insensitive.

render-avatars-atString

A comma-separated list of avatar pixel sizes to render. Renders for each specified size be available in the avatars_html dictionary. If not provided, avatars will not be rendered.

startInteger

The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0.

Errors

100 - Does Not ExistHTTP 404 - Not Found Object does not exist
101 - Permission DeniedHTTP 403 - Forbidden You don’t have permission for this
103 - Not Logged InHTTP 401 - Unauthorized You are not logged in
105 - Invalid Form DataHTTP 400 - Bad Request One or more fields had errors
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden Your OAuth2 token lacks the necessary scopes for this request.
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden OAuth2 token access for this resource is prohibited.
226 - User Query ErrorHTTP 500 - Internal Server Error An error occurred querying the user list.

HTTP POST

Create a new user.

The user will be allowed to authenticate into Review Board with the given username and password.

Only administrators or those with the auth.add_user permission will be able to create users.

This API cannot be used on Local Sites.

Request Parameters

emailString Required

The e-mail address of the user to create.

passwordString Required

The password of the user to create.

usernameString Required

The username of the user to create.

first_nameString

The first name of the user to create.

last_nameString

The last name of the user to create.

render_avatars_atString

A comma-separated list of avatar pixel sizes to render. Renders for each specified size be available in the avatars_html dictionary. If not provided, avatars will not be rendered.

Errors

100 - Does Not ExistHTTP 404 - Not Found Object does not exist
101 - Permission DeniedHTTP 403 - Forbidden You don’t have permission for this
103 - Not Logged InHTTP 401 - Unauthorized You are not logged in
105 - Invalid Form DataHTTP 400 - Bad Request One or more fields had errors
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden Your OAuth2 token lacks the necessary scopes for this request.
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden OAuth2 token access for this resource is prohibited.

Examples

application/vnd.reviewboard.org.users+json

$ curl http://reviews.example.com/api -H "Accept: application/json"
Content-Type: application/vnd.reviewboard.org.users+json
Item-Content-Type: application/vnd.reviewboard.org.user+json
X-Content-Type-Options: nosniff
ETag: 2901e429547db1b37ba0467ff64c56d50f45ebba
Vary: Accept, Cookie
{
  "links": {
    "create": {
      "href": "http://reviews.example.com/api",
      "method": "POST"
    },
    "self": {
      "href": "http://reviews.example.com/api",
      "method": "GET"
    }
  },
  "stat": "ok",
  "total_results": 4,
  "users": [
    {
      "avatar_html": null,
      "avatar_url": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=48&d=mm",
      "avatar_urls": {
        "1x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=48&d=mm",
        "2x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=96&d=mm",
        "3x": "https://secure.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=144&d=mm"
      },
      "email": "admin@example.com",
      "first_name": "Admin",
      "fullname": "Admin User",
      "id": 1,
      "is_active": true,
      "last_name": "User",
      "links": {
        "api_tokens": {
          "href": "http://reviews.example.com/api/users/admin/api-tokens/",
          "method": "GET"
        },
        "archived_review_requests": {
          "href": "http://reviews.example.com/api/users/admin/archived-review-requests/",
          "method": "GET"
        },
        "muted_review_requests": {
          "href": "http://reviews.example.com/api/users/admin/muted-review-requests/",
          "method": "GET"
        },
        "self": {
          "href": "http://reviews.example.com/api/users/admin/",
          "method": "GET"
        },
        "update": {
          "href": "http://reviews.example.com/api/users/admin/",
          "method": "PUT"
        },
        "user_file_attachments": {
          "href": "http://reviews.example.com/api/users/admin/user-file-attachments/",
          "method": "GET"
        },
        "watched": {
          "href": "http://reviews.example.com/api/users/admin/watched/",
          "method": "GET"
        }
      },
      "url": "/users/admin/",
      "username": "admin"
    },
    {
      "avatar_html": null,
      "avatar_url": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=48&d=mm",
      "avatar_urls": {
        "1x": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=48&d=mm",
        "2x": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=96&d=mm",
        "3x": "https://secure.gravatar.com/avatar/b0f1ae4342591db2695fb11313114b3e?s=144&d=mm"
      },
      "email": "doc@example.com",
      "first_name": "Doc",
      "fullname": "Doc Dwarf",
      "id": 2,
      "is_active": true,
      "last_name": "Dwarf",
      "links": {
        "api_tokens": {
          "href": "http://reviews.example.com/api/users/doc/api-tokens/",
          "method": "GET"
        },
        "archived_review_requests": {
          "href": "http://reviews.example.com/api/users/doc/archived-review-requests/",
          "method": "GET"
        },
        "muted_review_requests": {
          "href": "http://reviews.example.com/api/users/doc/muted-review-requests/",
          "method": "GET"
        },
        "self": {
          "href": "http://reviews.example.com/api/users/doc/",
          "method": "GET"
        },
        "update": {
          "href": "http://reviews.example.com/api/users/doc/",
          "method": "PUT"
        },
        "user_file_attachments": {
          "href": "http://reviews.example.com/api/users/doc/user-file-attachments/",
          "method": "GET"
        },
        "watched": {
          "href": "http://reviews.example.com/api/users/doc/watched/",
          "method": "GET"
        }
      },
      "url": "/users/doc/",
      "username": "doc"
    },
    {
      "avatar_html": null,
      "avatar_url": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=48&d=mm",
      "avatar_urls": {
        "1x": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=48&d=mm",
        "2x": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=96&d=mm",
        "3x": "https://secure.gravatar.com/avatar/1a0098e6600792ea4f714aa205bf3f2b?s=144&d=mm"
      },
      "email": "dopey@example.com",
      "first_name": "Dopey",
      "fullname": "Dopey Dwarf",
      "id": 3,
      "is_active": true,
      "last_name": "Dwarf",
      "links": {
        "api_tokens": {
          "href": "http://reviews.example.com/api/users/dopey/api-tokens/",
          "method": "GET"
        },
        "archived_review_requests": {
          "href": "http://reviews.example.com/api/users/dopey/archived-review-requests/",
          "method": "GET"
        },
        "muted_review_requests": {
          "href": "http://reviews.example.com/api/users/dopey/muted-review-requests/",
          "method": "GET"
        },
        "self": {
          "href": "http://reviews.example.com/api/users/dopey/",
          "method": "GET"
        },
        "update": {
          "href": "http://reviews.example.com/api/users/dopey/",
          "method": "PUT"
        },
        "user_file_attachments": {
          "href": "http://reviews.example.com/api/users/dopey/user-file-attachments/",
          "method": "GET"
        },
        "watched": {
          "href": "http://reviews.example.com/api/users/dopey/watched/",
          "method": "GET"
        }
      },
      "url": "/users/dopey/",
      "username": "dopey"
    },
    {
      "avatar_html": null,
      "avatar_url": "https://secure.gravatar.com/avatar/8f32aaaba6ce2ea6ef975d31e0fe4780?s=48&d=mm",
      "avatar_urls": {
        "1x": "https://secure.gravatar.com/avatar/8f32aaaba6ce2ea6ef975d31e0fe4780?s=48&d=mm",
        "2x": "https://secure.gravatar.com/avatar/8f32aaaba6ce2ea6ef975d31e0fe4780?s=96&d=mm",
        "3x": "https://secure.gravatar.com/avatar/8f32aaaba6ce2ea6ef975d31e0fe4780?s=144&d=mm"
      },
      "email": "grumpy@example.com",
      "first_name": "Grumpy",
      "fullname": "Grumpy Dwarf",
      "id": 4,
      "is_active": true,
      "last_name": "Dwarf",
      "links": {
        "api_tokens": {
          "href": "http://reviews.example.com/api/users/grumpy/api-tokens/",
          "method": "GET"
        },
        "archived_review_requests": {
          "href": "http://reviews.example.com/api/users/grumpy/archived-review-requests/",
          "method": "GET"
        },
        "muted_review_requests": {
          "href": "http://reviews.example.com/api/users/grumpy/muted-review-requests/",
          "method": "GET"
        },
        "self": {
          "href": "http://reviews.example.com/api/users/grumpy/",
          "method": "GET"
        },
        "update": {
          "href": "http://reviews.example.com/api/users/grumpy/",
          "method": "PUT"
        },
        "user_file_attachments": {
          "href": "http://reviews.example.com/api/users/grumpy/user-file-attachments/",
          "method": "GET"
        },
        "watched": {
          "href": "http://reviews.example.com/api/users/grumpy/watched/",
          "method": "GET"
        }
      },
      "url": "/users/grumpy/",
      "username": "grumpy"
    }
  ]
}