> ## 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.

# Publish Scheduled Shift

> Publishes a scheduled shift.

`square.publishScheduledShift` publishes a scheduled shift.

## Example

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

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

  square.publishScheduledShift({
    id: "id",
    idempotencyKey: "HIDSNG5KS478L",
    version: 2,
    scheduledShiftNotificationAudience: "ALL",
  })
})
```

## 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 publish.                                                                                                                                                                                                                                                                                                                                    |
| `idempotencyKey`                     | `string`                                    | Yes      | —          | A unique identifier for the `PublishScheduledShift` request, used to ensure the [idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency) of the operation.                                                                                                                                                                            |
| `version`                            | `number`                                    | No       | —          | The current version of the scheduled shift, used to enable [optimistic concurrency](https://developer.squareup.com/docs/build-basics/common-api-patterns/optimistic-concurrency) control. If the provided version doesn't match the server version, the request fails. If omitted, Square executes a blind write, potentially overwriting data from another publish request. |
| `scheduledShiftNotificationAudience` | `Square.ScheduledShiftNotificationAudience` | No       | `AFFECTED` | Indicates whether Square should send an email notification to team members and which team members should receive the notification. The default value is `AFFECTED`. See [ScheduledShiftNotificationAudience](#type-scheduledshiftnotificationaudience) for possible values                                                                                                   |

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

## Output

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