API: Roles - TestRail

API: Roles

Use the following API methods to request details about roles.

On this page:

    get_roles

    Returns a list of available roles 

    (Requires TestRail 7.3 or later)

    GET index.php?/api/v2/get_roles

    Response Content (TestRail Professional)

    Please see the following example for a typical response:

    {
        "offset": integer,
        "limit": integer,
        "size": integer,
        "_links": {
       	 "next": URL or null,
       	 "prev": URL or null,
        }
        "roles": [
       	 {
       		 "id": integer,
       		 "name": string,
       		 "is_default": boolean
       	 },...
        ]
    }
    

    Response Content (TestRail Enterprise)

    Please see the following example for a typical response:

    {
        "offset": integer,
        "limit": integer,
        "size": integer,
        "_links": {
       	 "next": URL or null,
       	 "prev": URL or null,
        }
        "roles": [
       	 {
       		 "id": integer,
       		 "name": string,
       		 "is_default": boolean,
    		“is_project_admin”: boolean
       	 },...
        ]
    }
    

    The following fields are included in the response:

     

    Name Type Description
    id
    integer The ID of the role.
    name
    string The name of the role.
    is_default
    boolean True if this is the default user role.
    is_project_admin
    boolean True if the role has Project Level Administration permissions. (Requires TestRail Enterprise)