> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.xperiencehr.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Shift Assignment API

The **Shift Assignment API** in XperienceHR provides an interface for assigning work calendars and shifts to employees, enabling seamless integration with external systems for workforce scheduling and management.

This API supports **XML & JSON format** for structured data exchange and requires authentication via an **API key**.

By integrating the Shift Assignment API, organizations can efficiently manage employee schedules, ensuring accurate shift assignments and calendar synchronization.

# Overview

**API Type:** REST
**Supported Formats:** XML
**API Key:** Generated in the app configuration
**Method:** *POST*
---

# Shift Assignment

**Functionality:**
* Assign Work Calendar to employee
* Assign Shift

| Parameter | Min | Max | Required | Description |
| ---- |
| Login |  |  | ✅ | Valid XPHR value |
| Date | Current Date | Valid Date | ✅ | Date format = YYYY-MM-DD |
| Work Calendar Code |  |  | ✅ | Valid XPHR value |
| Project Name |  |  | ❌ | Valid XPHR value |
| Activity Name |  |  | ❌ | Valid XPHR value |
| Approval Type | 1 | 3 | ❌ | Approval Type |

|| Approval Types: 1 = Line Manager Approval - Employee Notification, 2 = Line Manager Approval - Customer Notification, 3 = Customer Approval - Line Manager Notification

###### Endpoint
---

### Error Handling

Common errors help in debugging and correcting API usage issues.

**Example 1: Date Before Other Assignment**

**Example 2: Unknown Approval Type**

**Example 3: User Not Found**
---

### HTTP Response Codes
* **2XX Success** - Operation completed successfully.
* **4XX Client Error** - Likely an issue with the request, such as incorrect parameters or insufficient permissions. Returns an error message in text or XML format.
* **5XX Server Error** - Indicates a server issue. Report this error if encountered.
