{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/frontapp/json-schema/frontapp-create-shift-schema.json",
  "title": "CreateShift",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/frontapp-shifts-api-openapi.yml#/components/schemas/CreateShift",
  "required": [
    "name",
    "color",
    "timezone",
    "times",
    "teammate_ids"
  ],
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the shift"
    },
    "color": {
      "type": "string",
      "enum": [
        "black",
        "grey",
        "pink",
        "purple",
        "blue",
        "teal",
        "green",
        "yellow",
        "orange",
        "red"
      ],
      "description": "Color of the shift"
    },
    "timezone": {
      "type": "string",
      "description": "A timezone name as defined in the IANA tz database"
    },
    "times": {
      "description": "The shift intervals per day of the week",
      "$ref": "#/$defs/ShiftIntervals"
    },
    "teammate_ids": {
      "type": "array",
      "description": "List of all the teammate ids who will be part of this shift. Alternatively, you can supply emails as a [resource alias](https://dev.frontapp.com/docs/resource-aliases-1).",
      "items": {
        "$ref": "#/$defs/ResourceID"
      }
    }
  },
  "$defs": {
    "ResourceID": {
      "type": "string"
    },
    "ShiftInterval": {
      "type": "object",
      "required": [
        "start",
        "end"
      ],
      "properties": {
        "start": {
          "type": "string",
          "description": "Start of shift"
        },
        "end": {
          "type": "string",
          "description": "End of shift"
        }
      }
    },
    "ShiftIntervals": {
      "type": "object",
      "properties": {
        "mon": {
          "$ref": "#/$defs/ShiftInterval"
        },
        "tue": {
          "$ref": "#/$defs/ShiftInterval"
        },
        "wed": {
          "$ref": "#/$defs/ShiftInterval"
        },
        "thu": {
          "$ref": "#/$defs/ShiftInterval"
        },
        "fri": {
          "$ref": "#/$defs/ShiftInterval"
        },
        "sat": {
          "$ref": "#/$defs/ShiftInterval"
        },
        "sun": {
          "$ref": "#/$defs/ShiftInterval"
        }
      }
    }
  }
}