Skip to main content
Skip table of contents

User Management API (Deprecated)

These URIs are all still valid in XNAT, but are generally deprecated in favor of the XAPI-based User Management API

Get All Users

Return a listing of all users in XNAT

CODE
GET - /data/users

Parameters:

format

  • JSON (default)

  • XML

  • HTML

  • CSV

Response:

CODE
{
    ResultSet: {
        Result: [
            {
                email: "string",
                firstname: "string",
                lastname: "string",
                login: "string",
                xnat_user_id: "integer"
            }
        ],
        title: "string",
        totalRecords: "integer" 
    }
}


Get One User

Not supported in XNAT 1.7

Return details on a specific user in XNAT.

CODE
GET - /data/user/{ID | username | email`}

Parameters:
One of these parameters must be supplied.

username

string

ID

integer

email

string

Response:

CODE
{
    ResultSet: {
        Result: [
            {
                email: "string",
                enabled: "boolean",
                firstname: "string",
                lastname: "string",
                login: "string",
                userAuths: [
                    authId: "string",
                    method: "localdb"
                ],
                verified: "boolean"
            }
        ],
        title: "string",
        totalRecords: "integer" 
    }
}

Set A Favorite Project For User

Adds a project to the currently logged-in user's list of favorite projects. If a user has favorite projects specified, that list of projects will appear in a new navigation menu item in the top navigation under Browse > Favorite Projects.

CODE
PUT - /data/users/favorites/Project/{project_id}

Parameters

{project_id}

Required path parameter. Must be a valid XNAT project ID that the user has access to

Response: Returns an updated list of all favorite projects for this user

CODE
{
  "ResultSet": {
    "Result": [
      {
        "datatype": "Project",
        "id": "Project_ID_1"
      },
      {
        "datatype": "Project",
        "id": "Project_ID_2"
      }
    ],
    "title": "User Favorites"
  }
}


Remove A Project From A User's List of Favorites

CODE
DELETE - /data/users/favorites/Project/{project_id}

Parameters

{project_id}

Required path parameter. Must be a valid XNAT project ID that the user has access to

Response

CODE
{
  "ResultSet": {
    "Result": [
      {
        "datatype": "Project",
        "id": "Project_ID_1"
      }
    ],
    "title": "User Favorites"
  }
}

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.