v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
Labor

BulkPublishScheduledShifts

Publishes 1 - 100 scheduled shifts. This endpoint takes a map of individual publish requests and returns a map of responses. When a scheduled shift is published, Square keeps the draft_shift_details field as is and copies it to the published_shift_details field.

The minimum start_at and maximum end_at timestamps of all shifts in a BulkPublishScheduledShifts request must fall within a two-week period.

post/v2/labor/scheduled-shifts/bulk-publish

Request body

scheduled_shiftsobject required

A map of 1 to 100 key-value pairs that represent individual publish requests.

  • Each key is the ID of a scheduled shift you want to publish.
  • Each value is a BulkPublishScheduledShiftsData object that contains the version field or is an empty object.
scheduled_shift_notification_audience'ALL' | 'AFFECTED' | 'NONE'

Indicates whether Square sends an email notification to team members when a scheduled shift is published and which team members receive the notification.

Example request

{
  "scheduled-shifts": {
    "K0YH4CV5462JB": {
      "version": 3
    },
    "scheduled-shift-2": {
      "version": 2
    }
  },
  "scheduled_shift_notification_audience": "AFFECTED"
}

Response

Success

responsesobject

A map of key-value pairs that represent responses for individual publish requests. The order of responses might differ from the order in which the requests were provided.

  • Each key is the scheduled shift ID that was specified for a publish request.
  • Each value is the corresponding response. If the request succeeds, the value is the published scheduled shift. If the request fails, the value is an errors array containing any errors that occurred while processing the request.

Example response

{
  "responses": {
    "idp_key_1": {
      "scheduled_shift": {
        "created_at": "2019-02-25T03:11:00-05:00",
        "draft_shift_details": {
          "end_at": "2019-03-25T13:18:00-05:00",
          "is_deleted": false,
          "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
          "location_id": "PAA1RJZZKXBFG",
          "notes": "Don't forget to prep the vegetables",
          "start_at": "2019-03-25T03:11:00-05:00",
          "team_member_id": "ormj0jJJZ5OZIzxrZYJI",
          "timezone": "America/New_York"
        },
        "id": "K0YH4CV5462JB",
        "published_shift_details": {
          "end_at": "2019-03-25T13:18:00-05:00",
          "is_deleted": false,
          "job_id": "FzbJAtt9qEWncK1BWgVCxQ6M",
          "location_id": "PAA1RJZZKXBFG",
          "notes": "Don't forget to prep the vegetables",
          "start_at": "2019-03-25T03:11:00-05:00",
          "team_member_id": "ormj0jJJZ5OZIzxrZYJI",
          "timezone": "America/New_York"
        },
        "updated_at": "2019-02-25T03:11:15-05:00",
        "version": 3
      }
    },
    "idp_key_2": {
      "errors": [
        {
          "category": "INVALID_REQUEST_ERROR",
          "code": "INVALID_VALUE",
          "detail": "Scheduled shift with id 'scheduled-shift-2' not found",
          "field": "scheduled-shifts.scheduled-shift-2"
        }
      ]
    }
  }
}