---
title: "List Roles"
method: GET
path: "/v2/company/{company_id}/roles"
tags: ["Roles"]
---

# List Roles

`GET /v2/company/{company_id}/roles`

## Request

- Base URL: `https://api.7shifts.com`
- URL: `https://api.7shifts.com/v2/company/{company_id}/roles`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://app.7shifts.com/oauth2/authorize`
    - Client credentials
    - Password
    - Token URL: `https://app.7shifts.com/oauth2/token`
  - API key in cookie `7session`
- TypeScript: <https://skmtc.dev/7shifts/apis/7shifts-api/docs/v2/company/:company_id/roles/get.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `company_id` integer, required

## Query parameters

- `location_id` integer
- `department_id` integer
- `ids` integer[]
- `modified_since` string: A date with YYYY-MM-DD format
- `cursor` string
- `limit` integer

## Headers

- `x-api-version` string: An API version
- `x-company-guid` string, uuid

## Response `200`

OK

- object
  - `object` 'roles', required
  - `data` object[], required
    - `id` integer: Role ID
    - `company_id` integer: Company ID
    - `location_id` integer: Location ID
    - `department_id` integer: Department ID
    - `color` string, nullable: Hex colour adapted for light mode backgrounds via WCAG contrast adjustment
    - `num_stations` integer: The number of stations this role contains
    - `name` string: Role name
    - `job_code` string, nullable: Job code
    - `sort` integer, nullable: The order in which the roles will be listed in the web app
    - `stations` object[]
      - `id` integer: Station ID
      - `station_number` integer
      - `name` string: The name of this station
    - `created` string, date-time, nullable: The ISO8601 date and time in UTC when the role was created
    - `modified` string, date-time, nullable: The ISO8601 date and time in UTC when the role was modified
    - `is_tipped_role` boolean: When true, role is tipped. Otherwise the role is non tipped
    - `color_code` string, nullable: Color code
    - `color_dark` string, nullable: Hex colour adapted for dark mode backgrounds via WCAG contrast adjustment
  - `meta` object, required
    - `cursor` object, required
      - `current` string, nullable, required: The current cursor.
      - `prev` string, nullable, required: A cursor for navigating to the previous page.
      - `next` string, nullable, required: A cursor for navigating to the next page.
      - `count` integer, nullable, required: The total items in the current cursor.

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not found
- `500`: Server Error

---

[API](https://skmtc.dev/7shifts/apis/7shifts-api.md) - [All operations](https://skmtc.dev/7shifts/apis/7shifts-api/llms.txt) - [OpenAPI document](https://skmtc.dev/7shifts/apis/7shifts-api/revisions/40e0ef40dfcd?raw)
