---
title: "Publish shifts (asynchronous)"
method: POST
path: "/management/v2/shifts:publish"
tags: ["Shifts"]
---

# Publish shifts (asynchronous)

`POST /management/v2/shifts:publish`

## Request

- Base URL: `https://your-subdomain.deputy.deputy.com/api`
- URL: `https://your-subdomain.deputy.deputy.com/api/management/v2/shifts:publish`
- Auth: API key in header `OAuth`

Publishes shifts to make them visible to employees and optionally sends notifications. This is an asynchronous API that returns immediately with an operation ID in the response metadata.operation.operationId field. Use the operation ID to poll the /operations/v2/operations/{id} endpoint to check completion status. The publish operation marks shifts as published and sends notifications based on the specified notification mode.

## Request body

- PublishRequestPublishData
  - `shiftIds` integer[]
  - `notificationMode` 'PUBLISH_NOTIFICATION_NONE' | 'PUBLISH_NOTIFICATION_SMS' | 'PUBLISH_NOTIFICATION_EMAIL_PUSH' | 'PUBLISH_NOTIFICATION_SMS_EMAIL_PUSH' | 'PUBLISH_NOTIFICATION_SMS_CONFIRM': - PUBLISH_NOTIFICATION_NONE: No notifications - PUBLISH_NOTIFICATION_SMS: SMS only - PUBLISH_NOTIFICATION_EMAIL_PUSH: Email and Push only - PUBLISH_NOTIFICATION_SMS_EMAIL_PUSH: SMS, Email, and Push notifications - PUBLISH_NOTIFICATION_SMS_CONFIRM: SMS with confirmation required
  - `isAllLocationsMode` boolean
  - `force` boolean
  - `start` string
  - `end` string

## Response `200`

A successful response.

- ScheduleShiftPublishResponse: Response after initiating publish operation. Asynchronous API - returns immediately with operation ID. If validation errors exist, success=false and data.validation contains the errors.
  - `success` boolean
  - `data` ScheduleShiftPublishResponseData
    - `validation` PublishResponseValidationResult
      - `errors` ScheduleShiftPublishResponseValidationError[]
        - `reason` string
        - `employeeId` integer
        - `employeeName` string
      - `isHardBlock` boolean
  - `metadata` ScheduleShiftPublishResponseMetadata
    - `operation` ScheduleShiftOperation: Operation tracking information for asynchronous APIs.
      - `operationId` string: Unique identifier for the operation. Use this to poll /operations/v2/operations/{id} for status updates.
      - `locks` OperationLock[]: Virtual Locks held by this operation that prevent conflicting operations.
        - `kind` string
        - `ids` object

---

[API](https://skmtc.dev/deputy/apis/deputy-v2-api.md) - [All operations](https://skmtc.dev/deputy/apis/deputy-v2-api/llms.txt) - [OpenAPI document](https://skmtc.dev/deputy/apis/deputy-v2-api/revisions/78f0278f4608?raw)
