> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.crehana.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.crehana.com/_mcp/server.

# Create Shift

POST https://www.crehana.com/api/v5/rest/org/{organization_slug}/time/attendance/shifts/
Content-Type: application/json

Creates a shift in Attendance — fixed (the same weekly schedule every week) or rotating (a repeating pattern of work and rest blocks) — exactly as an administrator would from Crehana, and returns its id. Built for HR and workforce-planning systems that own the schedules. Step-by-step guide: [Create shifts](/documentacion/casos-de-uso/crear-turnos).

`shift_type` decides the body: `NON_ROTATING` takes `weekly_schedule`, `ROTATING` takes `cycles`. The answer carries the `id` of the shift and, for a rotating one, the `id` of each cycle: the `shift_id` and `start_cycle_id` that [Assign Shift](/api-reference/endpoints/attendance/assign-shift) needs.

- Times are `HH:MM`. An exit earlier than the entry means the day ends the next day (night shift).
- Days not sent in `weekly_schedule` are rest days.
- Breaks go in `break_config` (type and deduction) plus, per working day or work cycle, `break_time_slots` (`FIXED_SCHEDULE`) or `break_duration_minutes` (`FIXED_DURATION`).
- Worked minutes are calculated by Crehana unless `edit_worked_minutes` is true.
- A schedule that breaks a rule of Attendance (no working day, a break outside the day, a rotating shift without a rest block, …) is a `400` with the rule in the message.
- The name is unique among the active shifts of the organization: sending it again is a `409` with the id of the existing shift, so a retry never creates a duplicate.
- Requires credentials of an administrator of the organization.

Reference: https://developer.crehana.com/api-reference/endpoints/attendance/create-shift

## Authentication

- `Api-Key` header (required) — API key of the organization. Always sent together with the `Secret-Access` header.

## Servers

- `https://www.crehana.com` (Production, default)
- `https://qa.creha.co` (QA)

## Request

### Path parameters

- `organization_slug` (string, required)

### Body (application/json)

This endpoint expects an Attendance_create_shift_Request.

- `Attendance_create_shift_Request`
  - `shift_type`: `NON_ROTATING` (FixedShiftInput)
    - `name` (string, required) — Name of the shift, up to 150 characters. Unique among the active shifts of the organization.
    - `weekly_schedule` (list of DayScheduleInput, required) — The days of the week with their times. Days not listed are rest days. At least one working day; no day twice.
    - `apply_same_schedule_to_all_working_days` (boolean, optional, default: false) — When true every working day must have the same times and break; Crehana keeps them in sync afterwards.
    - `break_config` (BreakConfigInput, optional) — Break settings of the shift. Without it the shift has no break and no day or cycle may carry break data.
    - `break_counts_as_worked` (boolean, optional, default: false) — When true the break counts as worked time and is not deducted.
    - `color` (enum, optional, default: GRAY) — Color of the shift in the Crehana calendar.
      - Allowed values: `GRAY`, `PURPLE`, `BLUE`, `GREEN`, `BEIGE`, `ORANGE`, `PINK`, `YELLOW_GREEN`
    - `description` (string, optional) — Free text, up to 250 characters.
    - `edit_worked_minutes` (boolean, optional, default: false) — When true you send the worked minutes of each day or cycle yourself and they become mandatory. When false Crehana calculates them.
    - `mark_association_window_hours` (integer, optional, default: 2) — Hours before the entry and after the exit within which a mark still belongs to this shift. 1 to 12.
    - `tolerance_config` (ToleranceConfigInput, optional) — Minutes of grace before and after the scheduled times.
  - `shift_type`: `ROTATING` (RotatingShiftInput)
    - `cycles` (list of ShiftCycleInput, required) — The blocks of the pattern, in order. At least one `WORK` and one `REST`. The pattern repeats from the assignment's start cycle.
    - `name` (string, required) — Name of the shift, up to 150 characters. Unique among the active shifts of the organization.
    - `break_config` (BreakConfigInput, optional) — Break settings of the shift. Without it the shift has no break and no day or cycle may carry break data.
    - `break_counts_as_worked` (boolean, optional, default: false) — When true the break counts as worked time and is not deducted.
    - `color` (enum, optional, default: GRAY) — Color of the shift in the Crehana calendar.
      - Allowed values: `GRAY`, `PURPLE`, `BLUE`, `GREEN`, `BEIGE`, `ORANGE`, `PINK`, `YELLOW_GREEN`
    - `description` (string, optional) — Free text, up to 250 characters.
    - `edit_worked_minutes` (boolean, optional, default: false) — When true you send the worked minutes of each day or cycle yourself and they become mandatory. When false Crehana calculates them.
    - `mark_association_window_hours` (integer, optional, default: 2) — Hours before the entry and after the exit within which a mark still belongs to this shift. 1 to 12.
    - `tolerance_config` (ToleranceConfigInput, optional) — Minutes of grace before and after the scheduled times.

## Response

### 201

Shift created

- `success` (boolean, required) — True when the shift is stored.
- `message` (string, required) — Human readable result.
- `code` (string, required) — `attendance-005` when the shift was created. Not an HTTP status.
- `datetime` (string, required) — Datetime of the API in ISO Format
- `data` (Shift, required) — A shift as stored in Attendance. `weekly_schedule` only for a fixed one, `cycles` only for a rotating one.

## Errors

### 400 Bad Request Error

Unknown organization, or a schedule that breaks a rule of Attendance (the rule comes in the message)

- `detail` (AttendanceErrorDetail, required)

### 401 Unauthorized Error

Missing or invalid credentials

- `any`

### 403 Forbidden Error

The credentials do not administer the organization

- `detail` (AttendanceErrorDetail, required)

### 409 Conflict Error

An active shift with this name already exists (`SHIFT_NAME_ALREADY_EXISTS`, with its `shift_id`)

- `detail` (AttendanceErrorDetail, required)

### 422 Unprocessable Entity Error

The body does not match the schema

- `any`

## Types

### DayScheduleInput

One day of the week in a fixed shift.

- `day` (enum, required) — Day of the week.
  - Allowed values: `MONDAY`, `TUESDAY`, `WEDNESDAY`, `THURSDAY`, `FRIDAY`, `SATURDAY`, `SUNDAY`
- `is_working_day` (boolean, optional, default: true) — Whether the person works that day. Days not sent are rest days, so this is only needed to list a rest day explicitly.
- `entry_time` (string, optional) — Start of the workday, `HH:MM`. Required on a working day.
- `exit_time` (string, optional) — End of the workday, `HH:MM`. Required on a working day. Earlier than `entry_time` means the shift ends the next day (night shift).
- `worked_minutes` (integer, optional) — Worked minutes of the day. Only read with `edit_worked_minutes: true`; otherwise Crehana calculates it from the times and the break.
- `break_time_slots` (list of BreakTimeSlotInput, optional) — Breaks of the day. Required with a `FIXED_SCHEDULE` break.
- `break_duration_minutes` (integer, optional) — Length of the break in minutes. Required with a `FIXED_DURATION` break.

### BreakConfigInput

Shift-level break settings. The break itself goes per day or per cycle.

- `break_type` (enum, required) — `FIXED_SCHEDULE`: the break has fixed times, sent as `break_time_slots` on each working day or work cycle. `FIXED_DURATION`: only its length is fixed, sent as `break_duration_minutes`.
  - Allowed values: `FIXED_SCHEDULE`, `FIXED_DURATION`
- `deduction_method` (enum, required) — `REAL` deducts the break the person actually took; `FIXED` always deducts the configured break.
  - Allowed values: `REAL`, `FIXED`

### ToleranceConfigInput

Minutes of grace before and after the scheduled times.

- `before_minutes` (integer, required) — Minutes allowed before the scheduled time (early entry, early exit).
- `before_applicable_events` (list of enum, required) — Which events get the tolerance before: `ENTRY`, `EXIT`, `BREAK`. `BREAK` needs a `break_config`.
  - Allowed values: `ENTRY`, `BREAK`, `EXIT`
- `after_minutes` (integer, required) — Minutes allowed after the scheduled time (late entry, late exit).
- `after_applicable_events` (list of enum, required) — Which events get the tolerance after: `ENTRY`, `EXIT`, `BREAK`.
  - Allowed values: `ENTRY`, `BREAK`, `EXIT`

### ShiftCycleInput

One block of consecutive days in a rotating shift: work or rest.

- `cycle_type` (enum, required) — `WORK` (needs a schedule) or `REST` (no schedule).
  - Allowed values: `WORK`, `REST`
- `duration_days` (integer, required) — How many consecutive days the block lasts.
- `entry_time` (string, optional) — Start of the workday, `HH:MM`. Required on a `WORK` cycle.
- `exit_time` (string, optional) — End of the workday, `HH:MM`. Required on a `WORK` cycle. Earlier than `entry_time` means the shift ends the next day.
- `worked_minutes_per_day` (integer, optional) — Worked minutes of each day of the cycle. Only read with `edit_worked_minutes: true`; otherwise Crehana calculates it.
- `break_time_slots` (list of BreakTimeSlotInput, optional) — Breaks of each day of the cycle. Required with a `FIXED_SCHEDULE` break.
- `break_duration_minutes` (integer, optional) — Length of the break in minutes. Required with a `FIXED_DURATION` break.

### Shift

A shift as stored in Attendance. `weekly_schedule` only for a fixed one, `cycles` only for a rotating one.

- `id` (string, required) — Id of the shift: the `shift_id` to send when assigning it.
- `name` (string, required) — Name of the shift.
- `shift_type` (string, required) — `NON_ROTATING` or `ROTATING`.
- `color` (string, required) — Color of the shift in the Crehana calendar.
- `is_active` (boolean, required) — True while the shift can be assigned.
- `break_counts_as_worked` (boolean, required) — When true the break counts as worked time.
- `mark_association_window_hours` (integer, required) — Hours around the schedule within which a mark belongs to the shift.
- `edit_worked_minutes` (boolean, required) — True when the worked minutes were sent by the client, not calculated.
- `description` (string, optional) — Free text of the shift.
- `created_at` (string, optional) — When the shift was created, UTC.
- `break_config` (ShiftBreakConfig, optional) — Break settings of the shift.
- `tolerance_config` (ShiftToleranceConfig, optional) — Minutes of grace before and after the scheduled times.
- `weekly_schedule` (list of ShiftDaySchedule, optional) — Only for `NON_ROTATING`: the 7 days of the week.
- `apply_same_schedule_to_all_working_days` (boolean, optional) — Only for `NON_ROTATING`.
- `total_working_days` (integer, optional) — Only for `NON_ROTATING`.
- `total_worked_hours_per_week` (double, optional) — Only for `NON_ROTATING`.
- `cycles` (list of ShiftCycle, optional) — Only for `ROTATING`: the blocks of the pattern, in order.
- `total_pattern_days` (integer, optional) — Only for `ROTATING`.
- `total_work_days` (integer, optional) — Only for `ROTATING`.
- `total_rest_days` (integer, optional) — Only for `ROTATING`.
- `number_of_cycles` (integer, optional) — Only for `ROTATING`.

### AttendanceErrorDetail

- `errors` (list of string, required) — Why the request was rejected, for a log or a person.
- `code` (string, optional) — Stable reason to program against, when there is one.
- `user_ids` (list of integer, optional) — Only with `USER_NOT_FOUND` on shift assignments: the ids that do not belong to the organization.
- `shift_id` (string, optional) — Only with `SHIFT_NAME_ALREADY_EXISTS` on shift creation: the id of the active shift that already has that name.

### BreakTimeSlotInput

One scheduled break (for `FIXED_SCHEDULE`), e.g. lunch 13:00-14:00.

- `break_label` (enum, required) — What the break is: `LUNCH`, `COFFEE_BREAK` or `REST`. One slot per label.
  - Allowed values: `LUNCH`, `COFFEE_BREAK`, `REST`
- `start_time` (string, required) — When the break starts, `HH:MM` (the person leaves).
- `end_time` (string, required) — When the break ends, `HH:MM` (the person is back). After `start_time`.

### ShiftBreakConfig

Break settings of the shift.

- `break_type` (string, required) — `FIXED_SCHEDULE` or `FIXED_DURATION`.
- `deduction_method` (string, required) — `REAL` or `FIXED`.

### ShiftToleranceConfig

Minutes of grace before and after the scheduled times.

- `before_minutes` (integer, required) — Minutes allowed before the scheduled time.
- `before_applicable_events` (list of string, required) — Events that get the tolerance before: `ENTRY`, `EXIT`, `BREAK`.
- `after_minutes` (integer, required) — Minutes allowed after the scheduled time.
- `after_applicable_events` (list of string, required) — Events that get the tolerance after: `ENTRY`, `EXIT`, `BREAK`.

### ShiftDaySchedule

One day of the week of a fixed shift, as stored.

- `day` (string, required) — `MONDAY` to `SUNDAY`.
- `is_working_day` (boolean, required) — False on a rest day; the other fields are then null.
- `entry_time` (string, optional) — `HH:MM`; null on a rest day.
- `exit_time` (string, optional) — `HH:MM`; null on a rest day.
- `worked_minutes` (integer, optional) — Worked minutes of the day as stored by Crehana.
- `break_time_slots` (list of ShiftBreakTimeSlot, optional) — Breaks of the day, with a `FIXED_SCHEDULE` break.
- `break_duration_minutes` (integer, optional) — Length of the break, with a `FIXED_DURATION` break.

### ShiftCycle

One block of a rotating shift, with the id the assignment needs.

- `id` (string, required) — Id of the cycle: the `start_cycle_id` to send when assigning the shift.
- `cycle_order` (integer, required) — Position in the pattern, from 1.
- `cycle_type` (string, required) — `WORK` or `REST`.
- `duration_days` (integer, required) — How many consecutive days the block lasts.
- `entry_time` (string, optional) — `HH:MM`; null on a `REST` cycle.
- `exit_time` (string, optional) — `HH:MM`; null on a `REST` cycle.
- `worked_minutes_per_day` (integer, optional) — Worked minutes of each day as stored by Crehana.
- `break_time_slots` (list of ShiftBreakTimeSlot, optional) — Breaks of each day, with a `FIXED_SCHEDULE` break.
- `break_duration_minutes` (integer, optional) — Length of the break, with a `FIXED_DURATION` break.

### ShiftBreakTimeSlot

One scheduled break of a day or cycle, as stored.

- `break_label` (string, required) — `LUNCH`, `COFFEE_BREAK` or `REST`.
- `start_time` (string, required) — `HH:MM`.
- `end_time` (string, required) — `HH:MM`.
- `duration_minutes` (integer, required) — Length of the break.
- `position` (integer, required) — Order of the break in the day, from 1.

## Examples

**Request**

```json
{
  "shift_type": "NON_ROTATING",
  "name": "Morning 09-18",
  "weekly_schedule": [
    {
      "day": "MONDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "TUESDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "WEDNESDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "THURSDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "FRIDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    }
  ],
  "break_config": {
    "break_type": "FIXED_SCHEDULE",
    "deduction_method": "REAL"
  },
  "color": "BLUE",
  "description": "Office staff, Monday to Friday",
  "tolerance_config": {
    "before_minutes": 10,
    "before_applicable_events": [
      "ENTRY"
    ],
    "after_minutes": 15,
    "after_applicable_events": [
      "ENTRY",
      "EXIT"
    ]
  }
}
```

**Response**

```json
{
  "success": true,
  "message": "Shift created.",
  "code": "attendance-005",
  "datetime": "2026-10-13T09:00:03.120394",
  "data": {
    "id": "4ed0f6c7-a2a7-4de7-90cd-ae8cf26aabb1",
    "name": "Morning 09-18",
    "shift_type": "NON_ROTATING",
    "color": "BLUE",
    "is_active": true,
    "break_counts_as_worked": false,
    "mark_association_window_hours": 2,
    "edit_worked_minutes": false,
    "description": "Office staff, Monday to Friday",
    "created_at": "2026-10-13T14:00:03",
    "break_config": {
      "break_type": "FIXED_SCHEDULE",
      "deduction_method": "REAL"
    },
    "tolerance_config": {
      "before_minutes": 10,
      "before_applicable_events": [
        "ENTRY"
      ],
      "after_minutes": 15,
      "after_applicable_events": [
        "ENTRY",
        "EXIT"
      ]
    },
    "weekly_schedule": [
      {
        "day": "MONDAY",
        "is_working_day": true,
        "entry_time": "09:00",
        "exit_time": "18:00",
        "worked_minutes": 480,
        "break_time_slots": [
          {
            "break_label": "LUNCH",
            "start_time": "13:00",
            "end_time": "14:00",
            "duration_minutes": 60,
            "position": 1
          }
        ]
      },
      {
        "day": "TUESDAY",
        "is_working_day": true,
        "entry_time": "09:00",
        "exit_time": "18:00",
        "worked_minutes": 480,
        "break_time_slots": [
          {
            "break_label": "LUNCH",
            "start_time": "13:00",
            "end_time": "14:00",
            "duration_minutes": 60,
            "position": 1
          }
        ]
      },
      {
        "day": "WEDNESDAY",
        "is_working_day": true,
        "entry_time": "09:00",
        "exit_time": "18:00",
        "worked_minutes": 480,
        "break_time_slots": [
          {
            "break_label": "LUNCH",
            "start_time": "13:00",
            "end_time": "14:00",
            "duration_minutes": 60,
            "position": 1
          }
        ]
      },
      {
        "day": "THURSDAY",
        "is_working_day": true,
        "entry_time": "09:00",
        "exit_time": "18:00",
        "worked_minutes": 480,
        "break_time_slots": [
          {
            "break_label": "LUNCH",
            "start_time": "13:00",
            "end_time": "14:00",
            "duration_minutes": 60,
            "position": 1
          }
        ]
      },
      {
        "day": "FRIDAY",
        "is_working_day": true,
        "entry_time": "09:00",
        "exit_time": "18:00",
        "worked_minutes": 480,
        "break_time_slots": [
          {
            "break_label": "LUNCH",
            "start_time": "13:00",
            "end_time": "14:00",
            "duration_minutes": 60,
            "position": 1
          }
        ]
      },
      {
        "day": "SATURDAY",
        "is_working_day": false
      },
      {
        "day": "SUNDAY",
        "is_working_day": false
      }
    ],
    "apply_same_schedule_to_all_working_days": false,
    "total_working_days": 5,
    "total_worked_hours_per_week": 40
  }
}
```

**SDK Code**

```python
import requests

url = "https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/"

payload = {
    "shift_type": "NON_ROTATING",
    "name": "Morning 09-18",
    "weekly_schedule": [
        {
            "day": "MONDAY",
            "entry_time": "09:00",
            "exit_time": "18:00",
            "break_time_slots": [
                {
                    "break_label": "LUNCH",
                    "start_time": "13:00",
                    "end_time": "14:00"
                }
            ]
        },
        {
            "day": "TUESDAY",
            "entry_time": "09:00",
            "exit_time": "18:00",
            "break_time_slots": [
                {
                    "break_label": "LUNCH",
                    "start_time": "13:00",
                    "end_time": "14:00"
                }
            ]
        },
        {
            "day": "WEDNESDAY",
            "entry_time": "09:00",
            "exit_time": "18:00",
            "break_time_slots": [
                {
                    "break_label": "LUNCH",
                    "start_time": "13:00",
                    "end_time": "14:00"
                }
            ]
        },
        {
            "day": "THURSDAY",
            "entry_time": "09:00",
            "exit_time": "18:00",
            "break_time_slots": [
                {
                    "break_label": "LUNCH",
                    "start_time": "13:00",
                    "end_time": "14:00"
                }
            ]
        },
        {
            "day": "FRIDAY",
            "entry_time": "09:00",
            "exit_time": "18:00",
            "break_time_slots": [
                {
                    "break_label": "LUNCH",
                    "start_time": "13:00",
                    "end_time": "14:00"
                }
            ]
        }
    ],
    "break_config": {
        "break_type": "FIXED_SCHEDULE",
        "deduction_method": "REAL"
    },
    "color": "BLUE",
    "description": "Office staff, Monday to Friday",
    "tolerance_config": {
        "before_minutes": 10,
        "before_applicable_events": ["ENTRY"],
        "after_minutes": 15,
        "after_applicable_events": ["ENTRY", "EXIT"]
    }
}
headers = {
    "Secret-Access": "Secret-Access",
    "Api-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/';
const options = {
  method: 'POST',
  headers: {
    'Secret-Access': 'Secret-Access',
    'Api-Key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"shift_type":"NON_ROTATING","name":"Morning 09-18","weekly_schedule":[{"day":"MONDAY","entry_time":"09:00","exit_time":"18:00","break_time_slots":[{"break_label":"LUNCH","start_time":"13:00","end_time":"14:00"}]},{"day":"TUESDAY","entry_time":"09:00","exit_time":"18:00","break_time_slots":[{"break_label":"LUNCH","start_time":"13:00","end_time":"14:00"}]},{"day":"WEDNESDAY","entry_time":"09:00","exit_time":"18:00","break_time_slots":[{"break_label":"LUNCH","start_time":"13:00","end_time":"14:00"}]},{"day":"THURSDAY","entry_time":"09:00","exit_time":"18:00","break_time_slots":[{"break_label":"LUNCH","start_time":"13:00","end_time":"14:00"}]},{"day":"FRIDAY","entry_time":"09:00","exit_time":"18:00","break_time_slots":[{"break_label":"LUNCH","start_time":"13:00","end_time":"14:00"}]}],"break_config":{"break_type":"FIXED_SCHEDULE","deduction_method":"REAL"},"color":"BLUE","description":"Office staff, Monday to Friday","tolerance_config":{"before_minutes":10,"before_applicable_events":["ENTRY"],"after_minutes":15,"after_applicable_events":["ENTRY","EXIT"]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/"

	payload := strings.NewReader("{\n  \"shift_type\": \"NON_ROTATING\",\n  \"name\": \"Morning 09-18\",\n  \"weekly_schedule\": [\n    {\n      \"day\": \"MONDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"TUESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"WEDNESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"THURSDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"FRIDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    }\n  ],\n  \"break_config\": {\n    \"break_type\": \"FIXED_SCHEDULE\",\n    \"deduction_method\": \"REAL\"\n  },\n  \"color\": \"BLUE\",\n  \"description\": \"Office staff, Monday to Friday\",\n  \"tolerance_config\": {\n    \"before_minutes\": 10,\n    \"before_applicable_events\": [\n      \"ENTRY\"\n    ],\n    \"after_minutes\": 15,\n    \"after_applicable_events\": [\n      \"ENTRY\",\n      \"EXIT\"\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Secret-Access", "Secret-Access")
	req.Header.Add("Api-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Secret-Access"] = 'Secret-Access'
request["Api-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"shift_type\": \"NON_ROTATING\",\n  \"name\": \"Morning 09-18\",\n  \"weekly_schedule\": [\n    {\n      \"day\": \"MONDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"TUESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"WEDNESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"THURSDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"FRIDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    }\n  ],\n  \"break_config\": {\n    \"break_type\": \"FIXED_SCHEDULE\",\n    \"deduction_method\": \"REAL\"\n  },\n  \"color\": \"BLUE\",\n  \"description\": \"Office staff, Monday to Friday\",\n  \"tolerance_config\": {\n    \"before_minutes\": 10,\n    \"before_applicable_events\": [\n      \"ENTRY\"\n    ],\n    \"after_minutes\": 15,\n    \"after_applicable_events\": [\n      \"ENTRY\",\n      \"EXIT\"\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/")
  .header("Secret-Access", "Secret-Access")
  .header("Api-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"shift_type\": \"NON_ROTATING\",\n  \"name\": \"Morning 09-18\",\n  \"weekly_schedule\": [\n    {\n      \"day\": \"MONDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"TUESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"WEDNESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"THURSDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"FRIDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    }\n  ],\n  \"break_config\": {\n    \"break_type\": \"FIXED_SCHEDULE\",\n    \"deduction_method\": \"REAL\"\n  },\n  \"color\": \"BLUE\",\n  \"description\": \"Office staff, Monday to Friday\",\n  \"tolerance_config\": {\n    \"before_minutes\": 10,\n    \"before_applicable_events\": [\n      \"ENTRY\"\n    ],\n    \"after_minutes\": 15,\n    \"after_applicable_events\": [\n      \"ENTRY\",\n      \"EXIT\"\n    ]\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/', [
  'body' => '{
  "shift_type": "NON_ROTATING",
  "name": "Morning 09-18",
  "weekly_schedule": [
    {
      "day": "MONDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "TUESDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "WEDNESDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "THURSDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    },
    {
      "day": "FRIDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        {
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        }
      ]
    }
  ],
  "break_config": {
    "break_type": "FIXED_SCHEDULE",
    "deduction_method": "REAL"
  },
  "color": "BLUE",
  "description": "Office staff, Monday to Friday",
  "tolerance_config": {
    "before_minutes": 10,
    "before_applicable_events": [
      "ENTRY"
    ],
    "after_minutes": 15,
    "after_applicable_events": [
      "ENTRY",
      "EXIT"
    ]
  }
}',
  'headers' => [
    'Api-Key' => '<apiKey>',
    'Content-Type' => 'application/json',
    'Secret-Access' => 'Secret-Access',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/");
var request = new RestRequest(Method.POST);
request.AddHeader("Secret-Access", "Secret-Access");
request.AddHeader("Api-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"shift_type\": \"NON_ROTATING\",\n  \"name\": \"Morning 09-18\",\n  \"weekly_schedule\": [\n    {\n      \"day\": \"MONDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"TUESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"WEDNESDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"THURSDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    },\n    {\n      \"day\": \"FRIDAY\",\n      \"entry_time\": \"09:00\",\n      \"exit_time\": \"18:00\",\n      \"break_time_slots\": [\n        {\n          \"break_label\": \"LUNCH\",\n          \"start_time\": \"13:00\",\n          \"end_time\": \"14:00\"\n        }\n      ]\n    }\n  ],\n  \"break_config\": {\n    \"break_type\": \"FIXED_SCHEDULE\",\n    \"deduction_method\": \"REAL\"\n  },\n  \"color\": \"BLUE\",\n  \"description\": \"Office staff, Monday to Friday\",\n  \"tolerance_config\": {\n    \"before_minutes\": 10,\n    \"before_applicable_events\": [\n      \"ENTRY\"\n    ],\n    \"after_minutes\": 15,\n    \"after_applicable_events\": [\n      \"ENTRY\",\n      \"EXIT\"\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Secret-Access": "Secret-Access",
  "Api-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "shift_type": "NON_ROTATING",
  "name": "Morning 09-18",
  "weekly_schedule": [
    [
      "day": "MONDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        [
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        ]
      ]
    ],
    [
      "day": "TUESDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        [
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        ]
      ]
    ],
    [
      "day": "WEDNESDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        [
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        ]
      ]
    ],
    [
      "day": "THURSDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        [
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        ]
      ]
    ],
    [
      "day": "FRIDAY",
      "entry_time": "09:00",
      "exit_time": "18:00",
      "break_time_slots": [
        [
          "break_label": "LUNCH",
          "start_time": "13:00",
          "end_time": "14:00"
        ]
      ]
    ]
  ],
  "break_config": [
    "break_type": "FIXED_SCHEDULE",
    "deduction_method": "REAL"
  ],
  "color": "BLUE",
  "description": "Office staff, Monday to Friday",
  "tolerance_config": [
    "before_minutes": 10,
    "before_applicable_events": ["ENTRY"],
    "after_minutes": 15,
    "after_applicable_events": ["ENTRY", "EXIT"]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://www.crehana.com/api/v5/rest/org/organization_slug/time/attendance/shifts/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```