# Work Queue Time Slots API V3 - Developer Guide

- **Applies to:** `/api/v3/workQueue/timeSlot`
- **API Version:** V3
- **Resource:** Work Queue Time Slots
- **HTTP Method:** GET


## 1. Overview

### 1.1 The Work Queue Time Slot Object

The Work Queue Time Slots API returns the available scheduling slots configured for one or more work queues. Each returned work queue contains metadata about the queue and a collection of configured time windows that can be used for availability-based workflows.

A time slot represents a specific start and end time window and includes information about whether the slot is currently available, along with references to the underlying slot configuration and slot definition records.

### 1.2 Relationships and Data Model

The API returns a hierarchical structure:

```text
Work Queue
 ├─ workQueueId
 ├─ workQueueName
 └─ slotInformation[]
      ├─ startTime
      ├─ endTime
      ├─ available
      ├─ slotConfigId
      └─ slotDefinitionId
```

A single work queue can contain multiple configured time slots. Multiple slot records can reference the same `slotConfigId` and `slotDefinitionId` when they originate from the same underlying configuration.

### 1.3 Identification Model

Work queues are addressed through the `workQueueId` query parameter.

The API supports:

- A single work queue identifier
- Multiple work queue identifiers supplied as a comma-separated list
- A maximum of 50 identifiers per request


Requests exceeding the supported limit are rejected with a validation error.

### Supported Operations

| Operation | Method | Path |
|  --- | --- | --- |
| Fetch time slots for one work queue | GET | `/api/v3/workQueue/timeSlot` |
| Fetch time slots for multiple work queues | GET | `/api/v3/workQueue/timeSlot` |


# 2. Base URLs and Environments

## Base URL

```text
https://api3.sprinklr.com/{env}/api/v3/workQueue/timeSlot
```

Replace `{env}` with your assigned Sprinklr environment.

Examples:

```text
https://api3.sprinklr.com/prod/api/v3/workQueue/timeSlot
https://api3.sprinklr.com/prod2/api/v3/workQueue/timeSlot
```

Use environment-specific credentials and API keys when sending requests.

# 3. Authentication and Common Headers

All requests require OAuth authentication and an API key. 【1-7c9900】【2-52d60f】【3-e4fcc0】

## 3.1 Required Headers

| Header | Value Pattern | Required | Purpose |
|  --- | --- | --- | --- |
| Authorization | `Bearer {Access Token}` | Yes | Authenticates the user |
| Key | `{API Key}` | Yes | Authenticates the application |
| Accept | `application/json` | Yes | Specifies JSON responses |
| Content-Type | `application/json` | Documented | Specifies request media type |


### Example Headers

```http
Authorization: Bearer {Access Token}
Key: {API Key}
Accept: application/json
Content-Type: application/json
```

# 5. Read Operations

## 5.1 Fetch Work Queue Time Slots

Retrieves all available time slots configured for one or more work queues. 【2-52d60f】【3-e4fcc0】

### Endpoint

```http
GET https://api3.sprinklr.com/{env}/api/v3/workQueue/timeSlot
```

### Query Parameters

| Parameter | Type | Required | Description |
|  --- | --- | --- | --- |
| workQueueId | String | Yes | Unique work queue identifier or comma-separated list of work queue identifiers. |


### Request

#### Single Work Queue

```bash
curl --location \
'https://api3.sprinklr.com/{env}/api/v3/workQueue/timeSlot?workQueueId={workQueueId}' \
--header 'Authorization: Bearer {Access Token}' \
--header 'Key: {API Key}' \
--header 'Accept: application/json'
```

#### Multiple Work Queues

```bash
curl --location \
'https://api3.sprinklr.com/{env}/api/v3/workQueue/timeSlot?workQueueId={workQueueId1},{workQueueId2}' \
--header 'Authorization: Bearer {Access Token}' \
--header 'Key: {API Key}' \
--header 'Accept: application/json'
```

### Response

```json
{
  "data": [
    {
      "workQueueId": "698b10b8d4fc1f5d4a4368fb",
      "workQueueName": "Test-queue-Dinesh",
      "slotInformation": [
        {
          "startTime": 1771847400000,
          "endTime": 1771848000000,
          "available": true,
          "slotConfigId": "698c7d7cf2086c67c941573b",
          "slotDefinitionId": "698b3186d4fc1f5d4a5f884d"
        }
      ]
    }
  ],
  "errors": []
}
```

### Response Behavior

The response returns an array of work queue objects. Each object contains queue metadata together with all available time slots configured for that work queue.

When multiple identifiers are supplied, the API returns entries only for work queues that contain matching time-slot information.

### Response Schema

#### data[]

| Field | Type | Description |
|  --- | --- | --- |
| workQueueId | String | Unique identifier of the work queue |
| workQueueName | String | Name of the work queue |
| slotInformation | Array of Objects | Configured time-slot information |


### slotInformation Object

| Field | Type | Description |
|  --- | --- | --- |
| startTime | Number | Start time in epoch milliseconds |
| endTime | Number | End time in epoch milliseconds |
| available | Boolean | Indicates slot availability |
| slotConfigId | String | Unique slot configuration identifier |
| slotDefinitionId | String | Unique slot definition identifier |


### Field Relationships

Each `slotInformation` object represents a single configured time window. The source documentation states that multiple time-slot entries can reference the same slot configuration and slot definition identifiers.

### Example Time Conversion

```text
startTime = 1771847400000
endTime   = 1771848000000
```

Treat these values as epoch milliseconds and convert them according to your application time zone requirements.

# 6. Response Format and Status Codes

## 6.1 Response Envelope

Successful responses use the following envelope:

```json
{
  "data": [],
  "errors": []
}
```

### Envelope Components

| Field | Type | Description |
|  --- | --- | --- |
| data | Array | Work queue time-slot records |
| errors | Array | Error details when request processing fails |


## 6.2 Status Codes

### Documented Success

| HTTP Code | Description |
|  --- | --- |
| 200 OK | Time-slot information returned successfully |


### Observed Validation Errors

| HTTP Code | Scenario |
|  --- | --- |
| 400 Bad Request | Empty workQueueId parameter |
| 400 Bad Request | More than 50 workQueueId values supplied |


The source material does not explicitly document additional HTTP response codes.

# 7. Error Handling

## Error Object

Validation failures return an error array.

```json
{
  "errors": [
    {
      "id": "699c3a32440ba77b14af2ad6",
      "code": 400,
      "message": "Invalid 'workQueueId' parameter. Must contain at least one valid value."
    }
  ]
}
```

### Error Schema

| Field | Type | Description |
|  --- | --- | --- |
| id | String | Internal error identifier |
| code | Integer | Error code |
| message | String | Detailed error description |


## Empty workQueueId

### Request

```http
GET /api/v3/workQueue/timeSlot?workQueueId=
```

### Response

```json
{
  "errors": [
    {
      "code": 400,
      "message": "Invalid 'workQueueId' parameter. Must contain at least one valid value."
    }
  ]
}
```

### Implementation Guidance

The `workQueueId` parameter is mandatory and must contain at least one value. Requests with an empty value are rejected and return no time-slot data. 【5-331287】

## Maximum Identifier Limit Exceeded

### Request

```http
GET /api/v3/workQueue/timeSlot?workQueueId=id1,id2,...,id51
```

### Response

```json
{
  "errors": [
    {
      "code": 400,
      "message": "Maximum of 50 work_queue_time_slots identifiers supported per request. Provided: 51."
    }
  ]
}
```

### Implementation Guidance

A request can contain a maximum of 50 work queue identifiers. Split larger requests into batches of 50 or fewer IDs. 【4-b0cb84】

# 8. Supported Values

## workQueueId

| Value Type | Meaning |
|  --- | --- |
| Single identifier | Returns time slots for one work queue |
| Comma-separated identifier list | Returns time slots for multiple work queues |


### Constraints

| Constraint | Value |
|  --- | --- |
| Minimum identifiers | 1 |
| Maximum identifiers | 50 |


The 50-identifier limit is explicitly documented and enforced through request validation. 【4-b0cb84】

## available

| Value | Meaning |
|  --- | --- |
| true | The time slot is available |


**Observed behavior:** Only `true` appears in the supplied examples. The semantics of `false` are not explicitly documented. 【2-52d60f】【3-e4fcc0】

# 9. Use Cases

## Retrieve Available Slots for Scheduling

A scheduling application can retrieve all available time slots for a work queue before presenting appointment availability to a user.

Workflow:

1. Send a request with a work queue identifier.
2. Read the returned `slotInformation` array.
3. Convert epoch timestamps into local time.
4. Display available slots.


## Retrieve Availability for Multiple Queues

When availability can be fulfilled by multiple teams or queues:

1. Send a comma-separated list of work queue identifiers.
2. Aggregate all returned slot records.
3. Select the appropriate queue based on business rules.


This reduces the number of API calls compared to requesting each work queue separately. 【3-e4fcc0】

## Batch Large Queries

When availability must be collected across a large number of queues:

1. Divide identifiers into batches of 50.
2. Execute multiple requests.
3. Combine results in the client application.


This approach avoids identifier-limit validation failures.