---
updatedAt: 2025-06-05T01:13:13.000Z
agentTools:
  projectIndex: https://developers.7shifts.com/v2.2023.0501/llms.txt
---

# List Roles

**[Minimum Plan Required](https://developers.7shifts.com/v2.2023.0501/docs/plan-requirements):** Entrée

#### Sample Response

```json
{
    "data": [
        {
            "id": 2583,
            "company_id": 1234,
            "location_id": 4569,
            "department_id": 7890,
            "color": "1e71b2",
            "num_stations": 2,
            "name": "Server",
            "job_code": "",
            "sort": 1,
            "stations": [
                {
                    "id": 1,
                    "role_id": 2583,
                    "station_number": 1,
                    "name": "test station one"
                },
                {
                    "id": 2,
                    "role_id": 2583,
                    "station_number": 2,
                    "name": "test station two"
                }
            ],
            "created": "2021-10-28T16:48:42+0000",
            "modified": "2022-12-02T21:31:44+0000"
        },
        {
            "id": 2584,
            "company_id": 1234,
            "location_id": 4569,
            "department_id": 7890,
            "color": "d05353",
            "num_stations": 0,
            "name": "Host",
            "job_code": "",
            "sort": 3,
            "stations": [],
            "created": "2021-10-28T16:52:27+0000",
            "modified": "2021-10-28T16:59:05+0000"
        }
    ],
    "meta": {
        "cursor": {
            "current": null,
            "prev": null,
            "next": "eyJpZCI6MTAxMzg0MCwibmV4dCI6dHJ1ZX0=",
            "count": 2
        }
    },
    "object": "roles"
}
```

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "7shifts API",
    "contact": {
      "email": "api-support@7shifts.com"
    },
    "version": "2023-05-01"
  },
  "servers": [
    {
      "url": "https://api.7shifts.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/v2/company/{company_id}/roles": {
      "get": {
        "tags": [
          "Roles"
        ],
        "summary": "List Roles",
        "operationId": "listRoles",
        "x-public-api": true,
        "parameters": [
          {
            "name": "x-api-version",
            "in": "header",
            "description": "7shifts API version",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "description": "An API version",
              "example": "2022-05-01"
            }
          },
          {
            "name": "x-company-guid",
            "in": "header",
            "description": "Company GUID",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "1310bfe1-cb3f-4f24-98a2-fde2bc504108"
          },
          {
            "name": "company_id",
            "in": "path",
            "description": "Company ID",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            },
            "example": 1234
          },
          {
            "name": "location_id",
            "in": "query",
            "description": "Location ID",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "department_id",
            "in": "query",
            "description": "Department ID",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Role IDs",
            "required": false,
            "style": "form",
            "explode": false,
            "example": "123,321",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int64"
              }
            }
          },
          {
            "name": "modified_since",
            "in": "query",
            "description": "Return roles that have been modified since the specified date. Format YYYY-MM-DD",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "description": "A date with YYYY-MM-DD format",
              "example": "2020-01-01"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Cursor for the next or previous page of results.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The number of results desired per page.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "object": {
                      "type": "string",
                      "enum": [
                        "roles"
                      ]
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "id": {
                            "type": "integer",
                            "description": "Role ID"
                          },
                          "company_id": {
                            "type": "integer",
                            "description": "Company ID"
                          },
                          "location_id": {
                            "type": "integer",
                            "description": "Location ID"
                          },
                          "department_id": {
                            "type": "integer",
                            "description": "Department ID"
                          },
                          "color": {
                            "type": "string",
                            "description": "A hex number representing the color",
                            "nullable": true
                          },
                          "num_stations": {
                            "type": "integer",
                            "description": "The number of stations this role contains"
                          },
                          "name": {
                            "type": "string",
                            "description": "Role name"
                          },
                          "job_code": {
                            "type": "string",
                            "description": "Job code",
                            "nullable": true
                          },
                          "sort": {
                            "type": "integer",
                            "description": "The order in which the roles will be listed in the web app",
                            "nullable": true
                          },
                          "stations": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "integer",
                                  "description": "Station ID"
                                },
                                "station_number": {
                                  "type": "integer"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "The name of this station"
                                }
                              }
                            }
                          },
                          "created": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO8601 date and time in UTC when the role was created",
                            "example": "2021-01-01T00:00:00.000Z",
                            "nullable": true
                          },
                          "modified": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO8601 date and time in UTC when the role was modified",
                            "example": "2021-01-01T00:00:00.000Z",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": "object",
                          "properties": {
                            "current": {
                              "type": "string",
                              "description": "The current cursor.",
                              "nullable": true
                            },
                            "prev": {
                              "type": "string",
                              "description": "A cursor for navigating to the previous page.",
                              "nullable": true
                            },
                            "next": {
                              "type": "string",
                              "description": "A cursor for navigating to the next page.",
                              "nullable": true
                            },
                            "count": {
                              "type": "integer",
                              "description": "The total items in the current cursor.",
                              "nullable": true
                            }
                          },
                          "required": [
                            "current",
                            "prev",
                            "next",
                            "count"
                          ]
                        }
                      },
                      "required": [
                        "cursor"
                      ]
                    }
                  },
                  "required": [
                    "object",
                    "data",
                    "meta"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The primary identifier for the problem type (URI reference)."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
                    },
                    "status": {
                      "type": "integer",
                      "description": "The HTTP status code."
                    },
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "code": {
                      "type": "integer",
                      "description": "The error code can be used to look up the reason why the request failed."
                    },
                    "param": {
                      "type": "string",
                      "description": "The request parameter that this error is related to."
                    }
                  },
                  "required": [
                    "type",
                    "title",
                    "status",
                    "detail"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The primary identifier for the problem type (URI reference)."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
                    },
                    "status": {
                      "type": "integer",
                      "description": "The HTTP status code."
                    },
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "code": {
                      "type": "integer",
                      "description": "The error code can be used to look up the reason why the request failed."
                    },
                    "param": {
                      "type": "string",
                      "description": "The request parameter that this error is related to."
                    }
                  },
                  "required": [
                    "type",
                    "title",
                    "status",
                    "detail"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The primary identifier for the problem type (URI reference)."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
                    },
                    "status": {
                      "type": "integer",
                      "description": "The HTTP status code."
                    },
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "code": {
                      "type": "integer",
                      "description": "The error code can be used to look up the reason why the request failed."
                    },
                    "param": {
                      "type": "string",
                      "description": "The request parameter that this error is related to."
                    }
                  },
                  "required": [
                    "type",
                    "title",
                    "status",
                    "detail"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "description": "The primary identifier for the problem type (URI reference)."
                    },
                    "title": {
                      "type": "string",
                      "description": "A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
                    },
                    "status": {
                      "type": "integer",
                      "description": "The HTTP status code."
                    },
                    "detail": {
                      "type": "string",
                      "description": "A human-readable explanation specific to this occurrence of the problem."
                    },
                    "code": {
                      "type": "integer",
                      "description": "The error code can be used to look up the reason why the request failed."
                    },
                    "param": {
                      "type": "string",
                      "description": "The request parameter that this error is related to."
                    }
                  },
                  "required": [
                    "type",
                    "title",
                    "status",
                    "detail"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://app.7shifts.com/oauth2/token",
            "refreshUrl": "https://app.7shifts.com/oauth2/token",
            "scopes": {
              "v1_access": "Required to access APIv1 endpoints."
            }
          },
          "password": {
            "tokenUrl": "https://app.7shifts.com/oauth2/token",
            "refreshUrl": "https://app.7shifts.com/oauth2/token",
            "scopes": {
              "v1_access": "Required to access APIv1 endpoints."
            }
          },
          "authorizationCode": {
            "authorizationUrl": "https://app.7shifts.com/oauth2/authorize",
            "tokenUrl": "https://app.7shifts.com/oauth2/token",
            "refreshUrl": "https://app.7shifts.com/oauth2/token",
            "scopes": {
              "v1_access": "Required to access APIv1 endpoints."
            }
          }
        }
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "7session"
      }
    }
  },
  "security": [
    {
      "OAuth2": []
    },
    {
      "cookieAuth": []
    }
  ],
  "tags": [
    {
      "name": "Roles"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```