---
title: "Create Role"
method: POST
path: "/v2/company/{company_id}/roles"
tags: ["Roles"]
---

# Create Role

`POST /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`

## Path parameters

- `company_id` integer, required

## Headers

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

## Request body

- object
  - `name` string, required: Role name
  - `color` string, required: A hex number representing the color
  - `location_id` integer, required: Location ID
  - `department_id` integer, required: Department ID. If this role is not assigned to a department, this value will be zero
  - `sort` integer: The order in which the roles will be listed in the web app
  - `job_code` string: Job code
  - `stations` object[]: Stations this role contains
    - `name` string, required: The name of this station
  - `is_tipped_role` boolean: When true, role is tipped. Otherwise the role is non tipped

## Response `201`

Created

- object
  - `object` 'role', 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

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `422`: Unprocessable Entity
- `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)
