# Project controller (/project) - Users

The project controller contains many endpoints related to projects, which is where all data is stored. The endpoints are divided in five groups:

  • General
    Get information about available projects and tables within projects, and run a basic check of access and system status.

  • Users
    Manage users that are members of a project.

  • Read
    Read user data from tables.

  • Write
    Create, update or delete user data in tables.

  • Watch
    Watch for changes of user data in tables, and for changes of project members.

# All project endpoints

Below are all endpoints in the entire project controller in alphabetical order. Endpoints in the current group are in bold.

/project/list (GET)
/project/list/all (GET)
/project/{project}/check (GET)
/project/{project}/subjects/watch/register (POST)
/project/{project}/subjects/watch/unregister/{id} (POST)
/project/{project}/subjects/watch/{id} (GET)
/project/{project}/table/{table} (GET)
/project/{project}/table/{table} (POST)
/project/{project}/table/{table} (DELETE)
/project/{project}/table/{table}/filter/delete (POST)
/project/{project}/table/{table}/filter/get (POST)
/project/{project}/table/{table}/filter/get/first (POST)
/project/{project}/table/{table}/filter/get/last (POST)
/project/{project}/table/{table}/first (GET)
/project/{project}/table/{table}/last (GET)
/project/{project}/table/{table}/purge (DELETE)
/project/{project}/table/{table}/spec (GET)
/project/{project}/table/{table}/watch/register (POST)
/project/{project}/table/{table}/watch/unregister/{id} (POST)
/project/{project}/table/{table}/watch/{id} (GET)
/project/{project}/table/{table}/{recordId} (GET)
/project/{project}/table/{table}/{recordId} (PUT)
/project/{project}/table/{table}/{recordId} (DELETE)
/project/{project}/tables (GET)
/project/{project}/user (POST)
/project/{project}/user (DELETE)
/project/{project}/users (GET)

# /{project}/user (POST)

/project/{project}/user POST
Description
Adds a user to a project. After this the user has permission to access the project. For some projects it matters as what role a user exists in the project. For example data from a cloud service may only be downloaded for users that were added to the project as a patient.
Authorization
All users can add themselves to any project.
Patients can only add themselves to a project.
Professionals can add any user to whom they were granted access, including themselves. They can only add other users to a project that they can access themselves.
Admins can add any user to any project.
URL parameters
{project}
Project code (see

/project/list

)
Content (application/x-www-form-urlencoded)
user
(optional) User ID of the user to add. Omit or leave empty to add yourself.
asRole
(optional) The role as which the user should be added to the project. This cannot be higher than the user’s own role. Possible values: PATIENT, PROFESSIONAL, ADMIN. The default is PATIENT.
Response
Example
Request
POST https://www.example.com/servlets/senseeact/v6.1.0/project/default/user
X-Auth-Token: ...
Content-Type: application/x-www-form-urlencoded
 
user=b43f784d76c44e7a9ae0370b91521753&asRole=PATIENT
Response

# /{project}/user (DELETE)

/project/{project}/user DELETE
Description
Removes a user from a project. If you specify a role, the user will only be removed for that role and it may remain in the project with other roles. If you don’t specify a role, the user will be removed completely, so the user can no longer access the project.
Authorization
All users can remove themselves from any project.
Patients can only remove themselves from a project.
Professionals can remove any user to whom they were granted access, including themselves. They can only remove other users from a project that they can access themselves.
Admins can remove any user from any project.
URL parameters
{project}
Project code (see

/project/list

)
Content (application/x-www-form-urlencoded)
user
(optional) User ID of the user to remove. Omit or leave empty to add yourself.
asRole
(optional) The role as which the user should be removed from the project. Possible values: PATIENT, PROFESSIONAL, ADMIN. If not specified, the user will be removed completely.
Response
Example
Request
DELETE https://www.example.com/servlets/senseeact/v6.1.0/project/default/user
X-Auth-Token: ...
Content-Type: application/x-www-form-urlencoded
 
user=b43f784d76c44e7a9ae0370b91521753&asRole=PATIENT
Response

# /{project}/users

/project/{project}/users GET
Description
Returns all users that you or the specified user can access within a project. If you are not an admin, you can only get the accessible users for yourself. Admins can also get the accessible users of other users. This method returns users that have been added to the project. If you specify a role, you will only get the users that have been added to the project with that role.

If you get the accessible users for an admin, you will get all users. For a professional you can only get the professional and the subjects to which the professional was granted access with

POST /access/subject

. For a patient you can only get the patient itself.

Authorization
Patients and professionals can only get their own accessible users, from projects that they can access.
Admins can get the accessible users of any user from any project.
URL parameters
{project}
Project code (see

/project/list

)
user
(optional) User ID of the user whose accessible users you want to get. Omit or leave empty to get your own accessible users. Only admins can get the accessible users of another user.
role
(optional) If specified, this endpoint only returns users with the specified role. Possible values: PATIENT, PROFESSIONAL, ADMIN.
includeInactive
(optional) true if you want to include inactive users, false if you only want to get active users. The default is true.
Content
Response (application/json)
JSON array with user objects for the accessible users. For the complete description of a user object, see

GET /user/

.
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/project/default/users
    ?user=b43f784d76c44e7a9ae0370b91521753&role=PATIENT&includeInactive=true
X-Auth-Token: ...
Response
[
    {
        "userid": "f6d9f1f15e4b41769db3b0565ba6e788",
        "email": "patient01@example.com",
        "role": "PATIENT",
        ...
    },
    ...
]