> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Update Scheduled Shift

> Updates the draft shift details for a scheduled shift.

`square.updateScheduledShift` updates the draft shift details for a scheduled shift.

## Example

```ts automations/square-update-scheduled-shift.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { square } from "automate.ax/square"

export default automation("Update Square Scheduled Shift", () => {
  onDashboardRun({ title: "Update Square Scheduled Shift" })

  square.updateScheduledShift({
    id: "id",
    scheduledShift: {
      draftShiftDetails: {
        teamMemberId: "ormj0jJJZ5OZIzxrZYJI",
        locationId: "PAA1RJZZKXBFG",
        jobId: "FzbJAtt9qEWncK1BWgVCxQ6M",
        startAt: "2019-03-25T03:11:00-05:00",
        endAt: "2019-03-25T13:18:00-05:00",
        notes: "Dont forget to prep the vegetables",
        isDeleted: false,
      },
      version: 1,
    },
  })
})
```

## Inputs

Every input accepts a compatible signal. It requires `TIMECARDS_WRITE`.

| Field            | Type                    | Required | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ---------------- | ----------------------- | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`             | `string`                | Yes      | —       | The ID of the scheduled shift to update.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `scheduledShift` | `Square.ScheduledShift` | Yes      | —       | The scheduled shift with any updates in the `draft_shift_details` field. If needed, call ListLocations to get location IDs, ListJobs to get job IDs, and SearchTeamMembers to get team member IDs and current job assignments. Updates made to `published_shift_details` are ignored. If provided, the `start_at` and `end_at` timestamps must be in the time zone + offset of the shift location specified in `location_id`. Example for Pacific Standard Time: 2024-10-31T12:30:00-08:00 To enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control for the request, provide the current version of the shift in the `version` field. If the provided version doesn't match the server version, the request fails. If `version` is omitted, Square executes a blind write, potentially overwriting data from another publish request. |

Use the official [UpdateScheduledShift reference](https://developer.squareup.com/reference/square/labor-api/update-scheduled-shift) for provider field semantics and limits.

## Output

Returns the official `Square.UpdateScheduledShiftResponse` response as a codec-safe object. Square integer money amounts remain `bigint` values.
