{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hoursquare/json-schema/hoursquare-create-time-entry-request-schema.json",
  "title": "CreateTimeEntryRequest",
  "description": "Body of POST /api/public/v1/time-entries — a completed shift, including overnight (plan §6).",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hoursquare-openapi.json#/components/schemas/CreateTimeEntryRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "employee",
    "clockIn",
    "clockOut"
  ],
  "properties": {
    "employee": {
      "description": "The employee, by HourSquare id and/or external id.",
      "oneOf": [
        {
          "$ref": "#/$defs/EmployeeSelector"
        }
      ]
    },
    "clockIn": {
      "type": "string",
      "description": "When the shift started: RFC 3339 with an explicit offset. At most 30 days in the past.",
      "format": "date-time",
      "minLength": 1
    },
    "clockOut": {
      "type": "string",
      "description": "When the shift ended: RFC 3339 with an explicit offset, after clockIn and less than 24 hours later. At most 5 minutes in the future.",
      "format": "date-time",
      "minLength": 1
    },
    "breakMinutes": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Unpaid break in minutes, recorded as one break in the middle of the shift. Not allowed on an overnight shift.",
      "format": "int32",
      "maximum": 1440.0,
      "minimum": 0.0
    },
    "note": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional note for the manager (at most 500 characters).",
      "maxLength": 500
    }
  },
  "$defs": {
    "EmployeeSelector": {
      "type": "object",
      "description": "How a public request names an employee (company API keys plan 2026-09-15, §6 \"Employee\nidentification\"): by HourSquare id, by the external (badge / HRIS) id, or both — every supplied\nselector must match, and both are resolved inside the caller's company only.",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "The employee's HourSquare id.",
          "format": "guid"
        },
        "externalId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The external id set through the Hub or PUT /employees/{id}/external-id (case-sensitive, at most 64 characters)."
        }
      }
    }
  }
}