# Fetch category queues for a location

POST https://services.leadconnectorhq.com/social-media-posting/category/queues/list

Retrieves a paginated list of all category queues for a given location, excluding any that have been marked as deleted.

## Authentication

Send `Authorization: Bearer <token>` using:

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

## Parameters

### Header Parameters

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

## 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/list": {
      "post": {
        "summary": "Fetch category queues for a location",
        "operationId": "fetchCategoryQueuesForALocation",
        "description": "Retrieves a paginated list of all category queues for a given location, excluding any that have been marked as deleted.",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "description": "API Version",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FetchCategoryQueuesDTO"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully retrieved category queues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WrappedFetchCategoryQueuesResponseDTO"
                }
              }
            }
          },
          "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.readonly"
            ]
          }
        ]
      }
    }
  },
  "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": {
      "FetchCategoryQueuesDTO": {
        "type": "object",
        "properties": {
          "locationId": {
            "type": "string",
            "description": "Location ID",
            "example": "609e126a1c4ae1001291e1b5"
          },
          "skip": {
            "type": "number",
            "description": "Number of items to skip",
            "example": 0
          },
          "limit": {
            "type": "number",
            "description": "Maximum number of items to return",
            "example": 10
          }
        },
        "required": [
          "locationId"
        ],
        "title": "FetchCategoryQueuesDTO"
      },
      "WrappedFetchCategoryQueuesResponseDTO": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "description": "Success or Failure",
            "example": true
          },
          "statusCode": {
            "type": "number",
            "description": "Status Code",
            "example": 201
          },
          "results": {
            "description": "Response payload",
            "example": {
              "message": "Queues fetched successfully",
              "queues": [
                {
                  "_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"
                  }
                }
              ],
              "meta": {
                "count": "100"
              }
            },
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Message",
                    "example": "Queues fetched successfully"
                  },
                  "queues": {
                    "description": "List of category queues with their associated categories",
                    "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"
                        }
                      }
                    ],
                    "type": "array",
                    "items": {
                      "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"
                        },
                        "category": {
                          "description": "The category associated with the queue.",
                          "example": {
                            "_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": "6756f381be2553245b08d30c",
                                  "description": "Category ID"
                                },
                                "name": {
                                  "type": "string",
                                  "example": "Category Name",
                                  "description": "Name of the category"
                                },
                                "primaryColor": {
                                  "type": "string",
                                  "example": "#FFFFFF",
                                  "description": "Primary color of the category"
                                },
                                "secondaryColor": {
                                  "type": "string",
                                  "example": "#000000",
                                  "description": "Secondary color of the category"
                                },
                                "deleted": {
                                  "type": "boolean",
                                  "example": false,
                                  "description": "Indicates if the category is deleted"
                                },
                                "locationId": {
                                  "type": "string",
                                  "example": "fvg1TXIiVxGcdOaL0riG",
                                  "description": "Location ID"
                                },
                                "createdBy": {
                                  "type": "string",
                                  "example": "SQ6d63Va2PUbWEZ9k0TD",
                                  "description": "ID of the user who created the category"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "example": "2024-12-09T13:41:21.385Z",
                                  "description": "Creation timestamp"
                                },
                                "updatedAt": {
                                  "type": "string",
                                  "example": "2024-12-09T13:41:21.385Z",
                                  "description": "Last update timestamp"
                                }
                              },
                              "title": "CategoryInfoDTO"
                            }
                          ]
                        }
                      },
                      "title": "CategoryQueueWithCategoryDTO"
                    }
                  },
                  "meta": {
                    "description": "Pagination metadata",
                    "example": {
                      "count": "100"
                    },
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "count": {
                            "type": "string",
                            "example": "100",
                            "description": "Total count of items"
                          }
                        },
                        "title": "MetaDTO"
                      }
                    ]
                  }
                },
                "title": "FetchCategoryQueuesResponseDTO"
              }
            ]
          },
          "traceId": {
            "type": "string",
            "description": "Trace ID for debugging",
            "example": "TRACE-abc123-def456"
          }
        },
        "required": [
          "success",
          "statusCode",
          "results"
        ],
        "title": "WrappedFetchCategoryQueuesResponseDTO"
      },
      "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 POST 'https://services.leadconnectorhq.com/social-media-posting/category/queues/list' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skip": 0,
  "limit": 10
}'
```

**Node.js**

```javascript
const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
      "locationId": "609e126a1c4ae1001291e1b5",
      "skip": 0,
      "limit": 10
  })
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/category/queues/list', 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/list"

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

payload = {
    "locationId": "609e126a1c4ae1001291e1b5",
    "skip": 0,
    "limit": 10
}

response = requests.post(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/list',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
    'Content-Type: application/json',
  ],
  CURLOPT_POSTFIELDS => '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skip": 0,
  "limit": 10
}',
]);

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

**Java**

```java
HttpResponse<String> response = Unirest
  .post("https://services.leadconnectorhq.com/social-media-posting/category/queues/list")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .header("Content-Type", "application/json")
  .body("{\"locationId\":\"609e126a1c4ae1001291e1b5\",\"skip\":0,\"limit\":10}")
  .asString();
```

**Go**

```go
package main

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

func main() {
  url := "https://services.leadconnectorhq.com/social-media-posting/category/queues/list"
  payload := strings.NewReader(`{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skip": 0,
  "limit": 10
}`)
  req, _ := http.NewRequest("POST", 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/list")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"
request["Content-Type"] = "application/json"
request.body = '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skip": 0,
  "limit": 10
}'

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

**PowerShell**

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

$body = '{
  "locationId": "609e126a1c4ae1001291e1b5",
  "skip": 0,
  "limit": 10
}'

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