# Update queue settings or status

PUT https://services.leadconnectorhq.com/social-media-posting/category/queues/{queueId}

Updates queue status (active/paused/deleted), time slots, or skip dates.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `socialplanner/category.write`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | API Version |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `queueId` | string | Yes | Category queue ID |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "LeadConnector API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/social-media-posting/category/queues/{queueId}": {
      "put": {
        "summary": "Update queue settings or status",
        "operationId": "updateQueueSettingsOrStatus",
        "description": "Updates queue status (active/paused/deleted), time slots, or skip dates.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          },
          {
            "name": "queueId",
            "required": true,
            "in": "path",
            "description": "Category queue ID",
            "schema": {
              "example": "507f1f77bcf86cd799439011",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCategoryQueueDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Queue updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WrappedUpdateCategoryQueueResponseDTO"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestDTO"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedDTO"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnprocessableDTO"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "socialplanner/category.write"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.",
        "type": "http"
      },
      "Location-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Sub-Account.",
        "type": "http"
      },
      "Agency-Access": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.",
        "type": "http"
      },
      "Agency-Access-Only": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "name": "Authorization",
        "in": "header",
        "description": "Use the Access Token generated with user type as Agency.",
        "type": "http"
      }
    },
    "schemas": {
      "UpdateCategoryQueueDTO": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string",
            "description": "Location ID",
            "example": "609e126a1c4ae1001291e1b5"
          },
          "skipLegacyWatermark": {
            "type": "boolean",
            "description": "Skip legacy watermark cleanup when rescheduling posts",
            "example": false
          },
          "status": {
            "type": "string",
            "description": "Status of the Queue",
            "enum": [
              "active",
              "paused",
              "deleted"
            ],
            "example": "paused"
          },
          "skipDateTime": {
            "type": "string",
            "description": "Skip Date Time in ISO format",
            "example": "2023-10-05T14:48:00.000Z"
          },
          "timeSlots": {
            "description": "Time slots defining when posts should be published",
            "example": [
              {
                "dayOfWeek": 1,
                "time": "09:00"
              },
              {
                "dayOfWeek": 3,
                "time": "14:30"
              }
            ],
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "dayOfWeek": {
                  "type": "number",
                  "description": "Day of the week (0-6)",
                  "example": 0
                },
                "time": {
                  "type": "string",
                  "description": "Time in HH:mm format",
                  "example": "09:00"
                }
              },
              "required": [
                "dayOfWeek",
                "time"
              ],
              "title": "TimeSlotDTO"
            }
          },
          "enableFuturePosts": {
            "type": "boolean",
            "description": "Enable posting future content. Automatically Queue any New Posts Created in this Category.",
            "example": true
          },
          "prioritizeNewContent": {
            "type": "boolean",
            "description": "Prioritize new content over older content. When true, new items added via directToQueue will be placed at the top of the queue.",
            "example": false
          }
        },
        "required": [
          "locationId"
        ],
        "title": "UpdateCategoryQueueDTO"
      },
      "WrappedUpdateCategoryQueueResponseDTO": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Success or Failure",
            "example": true
          },
          "statusCode": {
            "type": "number",
            "description": "Status Code",
            "example": 200
          },
          "results": {
            "description": "Response payload",
            "example": {
              "message": "Queue paused successfully.",
              "queue": {
                "_id": "60af88475f1b2c001f5d5f4b",
                "locationId": "location-123",
                "categoryId": "6756f381be2553245b08d30c",
                "timeSlots": [
                  {
                    "_id": "65f1a4e1b1d7f0b8d5a7d6a5",
                    "dayOfWeek": 1,
                    "time": "10:00"
                  }
                ],
                "enableFuturePosts": false,
                "prioritizeNewContent": false,
                "status": "active",
                "startDate": "2023-01-01T12:00:00Z",
                "totalPosts": 10,
                "lastScheduledTime": "2023-01-01T12:00:00Z",
                "createdBy": "user-123",
                "createdAt": "2023-01-01T00:00:00Z",
                "updatedAt": "2023-01-01T00:00:00Z",
                "category": {
                  "_id": "6756f381be2553245b08d30c",
                  "name": "Category Name",
                  "primaryColor": "#FFFFFF",
                  "secondaryColor": "#000000",
                  "deleted": false,
                  "locationId": "fvg1TXIiVxGcdOaL0riG",
                  "createdBy": "SQ6d63Va2PUbWEZ9k0TD",
                  "createdAt": "2024-12-09T13:41:21.385Z",
                  "updatedAt": "2024-12-09T13:41:21.385Z"
                }
              }
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "example": "Queue paused successfully.",
                    "description": "A message indicating the result of the operation. Examples: \"Queue updated successfully.\", \"Queue paused successfully.\", \"Queue activated successfully.\", \"Queue deleted successfully.\""
                  },
                  "queue": {
                    "description": "The updated queue.",
                    "example": {
                      "_id": "60af88475f1b2c001f5d5f4b",
                      "locationId": "location-123",
                      "categoryId": "6756f381be2553245b08d30c",
                      "timeSlots": [
                        {
                          "_id": "65f1a4e1b1d7f0b8d5a7d6a5",
                          "dayOfWeek": 1,
                          "time": "10:00"
                        }
                      ],
                      "enableFuturePosts": false,
                      "prioritizeNewContent": false,
                      "status": "active",
                      "startDate": "2023-01-01T12:00:00Z",
                      "totalPosts": 10,
                      "lastScheduledTime": "2023-01-01T12:00:00Z",
                      "createdBy": "user-123",
                      "createdAt": "2023-01-01T00:00:00Z",
                      "updatedAt": "2023-01-01T00:00:00Z",
                      "category": {
                        "_id": "6756f381be2553245b08d30c",
                        "name": "Category Name",
                        "primaryColor": "#FFFFFF",
                        "secondaryColor": "#000000",
                        "deleted": false,
                        "locationId": "fvg1TXIiVxGcdOaL0riG",
                        "createdBy": "SQ6d63Va2PUbWEZ9k0TD",
                        "createdAt": "2024-12-09T13:41:21.385Z",
                        "updatedAt": "2024-12-09T13:41:21.385Z"
                      }
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "example": "60af88475f1b2c001f5d5f4b",
                            "description": "Queue ID"
                          },
                          "locationId": {
                            "type": "string",
                            "example": "location-123",
                            "description": "Location ID"
                          },
                          "categoryId": {
                            "type": "string",
                            "example": "60af88475f1b2c001f5d5f4b",
                            "description": "Category ID"
                          },
                          "timeSlots": {
                            "description": "Time slots for scheduling posts",
                            "example": [
                              {
                                "_id": "65f1a4e1b1d7f0b8d5a7d6a5",
                                "dayOfWeek": 1,
                                "time": "10:00"
                              }
                            ],
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "dayOfWeek": {
                                  "type": "number",
                                  "description": "Day of the week (0-6)",
                                  "example": 0
                                },
                                "time": {
                                  "type": "string",
                                  "description": "Time in HH:mm format",
                                  "example": "09:00"
                                }
                              },
                              "required": [
                                "dayOfWeek",
                                "time"
                              ],
                              "title": "TimeSlotDTO"
                            }
                          },
                          "enableFuturePosts": {
                            "type": "boolean",
                            "example": false,
                            "description": "Enable posting future content"
                          },
                          "prioritizeNewContent": {
                            "type": "boolean",
                            "example": false,
                            "description": "Prioritize new content over older content"
                          },
                          "currentOrder": {
                            "type": "number",
                            "example": 1000,
                            "description": "Current order number in the queue"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "paused",
                              "draft"
                            ],
                            "example": "active",
                            "description": "Status of the queue. Possible values: active, paused, draft."
                          },
                          "startDate": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T12:00:00Z",
                            "description": "Start date of the queue"
                          },
                          "skipDateTime": {
                            "example": [
                              "2023-01-02T12:00:00Z"
                            ],
                            "description": "Dates/times to skip posting",
                            "type": "array",
                            "items": {
                              "format": "date-time",
                              "type": "string"
                            }
                          },
                          "currentPostId": {
                            "type": "string",
                            "example": "60af88475f1b2c001f5d5f4b",
                            "description": "ID of the currently scheduled post",
                            "nullable": true
                          },
                          "totalPosts": {
                            "type": "number",
                            "example": 10,
                            "description": "Total number of posts in the queue"
                          },
                          "lastScheduledTime": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T12:00:00Z",
                            "description": "Timestamp of the last scheduled post",
                            "nullable": true
                          },
                          "createdBy": {
                            "type": "string",
                            "example": "user-123",
                            "description": "ID of the user who created the queue"
                          },
                          "createdAt": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T00:00:00Z",
                            "description": "Creation timestamp"
                          },
                          "updatedAt": {
                            "format": "date-time",
                            "type": "string",
                            "example": "2023-01-01T00:00:00Z",
                            "description": "Last update timestamp"
                          }
                        },
                        "title": "CategoryQueueDTO"
                      }
                    ]
                  }
                },
                "title": "UpdateCategoryQueueResponseDTO"
              }
            ]
          },
          "traceId": {
            "type": "string",
            "description": "Trace ID for debugging",
            "example": "TRACE-abc123-def456"
          }
        },
        "required": [
          "success",
          "statusCode",
          "results"
        ],
        "title": "WrappedUpdateCategoryQueueResponseDTO"
      },
      "BadRequestDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 400
          },
          "message": {
            "type": "string",
            "example": "Bad Request"
          }
        },
        "title": "BadRequestDTO"
      },
      "UnauthorizedDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 401
          },
          "message": {
            "type": "string",
            "example": "Invalid token: access token is invalid"
          },
          "error": {
            "type": "string",
            "example": "Unauthorized"
          }
        },
        "title": "UnauthorizedDTO"
      },
      "UnprocessableDTO": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number",
            "example": 422
          },
          "message": {
            "example": [
              "Unprocessable Entity"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "error": {
            "type": "string",
            "example": "Unprocessable Entity"
          }
        },
        "title": "UnprocessableDTO"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X PUT 'https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skipLegacyWatermark": false,
  "status": "paused",
  "skipDateTime": "2023-10-05T14:48:00.000Z",
  "timeSlots": [
    {
      "dayOfWeek": 1,
      "time": "09:00"
    },
    {
      "dayOfWeek": 3,
      "time": "14:30"
    }
  ],
  "enableFuturePosts": true,
  "prioritizeNewContent": false
}'
```

**Node.js**

```javascript
const options = {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "locationId": "609e126a1c4ae1001291e1b5",
      "skipLegacyWatermark": false,
      "status": "paused",
      "skipDateTime": "2023-10-05T14:48:00.000Z",
      "timeSlots": [
        {
          "dayOfWeek": 1,
          "time": "09:00"
        },
        {
          "dayOfWeek": 3,
          "time": "14:30"
        }
      ],
      "enableFuturePosts": true,
      "prioritizeNewContent": false
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/social-media-posting/category/queues/{queueId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

payload = {
    "locationId": "609e126a1c4ae1001291e1b5",
    "skipLegacyWatermark": false,
    "status": "paused",
    "skipDateTime": "2023-10-05T14:48:00.000Z",
    "timeSlots": [
        {
            "dayOfWeek": 1,
            "time": "09:00"
        },
        {
            "dayOfWeek": 3,
            "time": "14:30"
        }
    ],
    "enableFuturePosts": true,
    "prioritizeNewContent": false
}

response = requests.put(url, json=payload, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skipLegacyWatermark": false,
  "status": "paused",
  "skipDateTime": "2023-10-05T14:48:00.000Z",
  "timeSlots": [
    {
      "dayOfWeek": 1,
      "time": "09:00"
    },
    {
      "dayOfWeek": 3,
      "time": "14:30"
    }
  ],
  "enableFuturePosts": true,
  "prioritizeNewContent": false
}',
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .put("https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .header("Content-Type", "application/json")
  .body("{\"locationId\":\"609e126a1c4ae1001291e1b5\",\"skipLegacyWatermark\":false,\"status\":\"paused\",\"skipDateTime\":\"2023-10-05T14:48:00.000Z\",\"timeSlots\":[{\"dayOfWeek\":1,\"time\":\"09:00\"},{\"dayOfWeek\":3,\"time\":\"14:30\"}],\"enableFuturePosts\":true,\"prioritizeNewContent\":false}")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
  "strings"
)

func main() {
  url := "https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>"
  payload := strings.NewReader(`{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skipLegacyWatermark": false,
  "status": "paused",
  "skipDateTime": "2023-10-05T14:48:00.000Z",
  "timeSlots": [
    {
      "dayOfWeek": 1,
      "time": "09:00"
    },
    {
      "dayOfWeek": 3,
      "time": "14:30"
    }
  ],
  "enableFuturePosts": true,
  "prioritizeNewContent": false
}`)
  req, _ := http.NewRequest("PUT", url, payload)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"
request["Content-Type"] = "application/json"
request.body = '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skipLegacyWatermark": false,
  "status": "paused",
  "skipDateTime": "2023-10-05T14:48:00.000Z",
  "timeSlots": [
    {
      "dayOfWeek": 1,
      "time": "09:00"
    },
    {
      "dayOfWeek": 3,
      "time": "14:30"
    }
  ],
  "enableFuturePosts": true,
  "prioritizeNewContent": false
}'

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$body = '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skipLegacyWatermark": false,
  "status": "paused",
  "skipDateTime": "2023-10-05T14:48:00.000Z",
  "timeSlots": [
    {
      "dayOfWeek": 1,
      "time": "09:00"
    },
    {
      "dayOfWeek": 3,
      "time": "14:30"
    }
  ],
  "enableFuturePosts": true,
  "prioritizeNewContent": false
}'

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/social-media-posting/category/queues/<queueId>' -Method 'PUT' -Headers $headers -Body $body -ContentType 'application/json'
$response | ConvertTo-Json
```
