# List a queue's waiting records

> The records waiting in the queue, oldest or newest first, with their payload, and how many wait in total.

Source: https://docs.stacksync.com/api-reference/queues/list_queue_records

`GET https://api.stacksync.com/v1/workspaces/{workspace_id}/queues/{workflows_app_queue_id}/records`

- Operation: `list_queue_records`
- Resource: Queues
- Access: read-only

## Authentication

- `Authorization: Bearer <key>`: A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace. List the ones your key can reach with GET /v1/workspaces. |
| `workflows_app_queue_id` | string (uuid) | Yes | The queue. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `limit` | integer, 1 to 100, default 20 | No | Maximum number of records returned, at most 100 |
| `offset` | integer, at least 0, default 0 | No | Number of items skipped before the first one returned |
| `region` | string (besg \| usnv) | Yes | Data region of the resources: besg (Europe) or usnv (United States), as GET /v1/regions lists them. |
| `order` | string (oldest \| newest), default "oldest" | No | Which waiting records come first: the oldest (the next to be flushed) or the newest |

## Returns

### 200 OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | array of object (QueueRecord) | Yes |  |
| `data[].record_id` | string | Yes |  |
| `data[].created_time` | string \| null | Yes |  |
| `data[].process_start_time` | string \| null | Yes | When a flush started sending the record, null while it waits |
| `data[].is_to_retry` | boolean \| null | Yes | The record failed in a flush and is sent again |
| `data[].data` | string | Yes | The record's payload, at most 10,000 characters |
| `has_more` | boolean | Yes | Whether more items follow this page: request the next one with offset + limit |
| `limit` | integer | Yes |  |
| `offset` | integer | Yes |  |
| `waiting_record_count` | integer | Yes | Every record waiting in the queue, not only this page |

## Example request

```bash
curl -X GET "https://api.stacksync.com/v1/workspaces/{workspace_id}/queues/{workflows_app_queue_id}/records?region=besg" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

## Example response (200)

```json
{
  "data": [
    {
      "record_id": "<record_id>",
      "created_time": "<created_time>",
      "process_start_time": "<process_start_time>",
      "is_to_retry": false,
      "data": "<data>"
    }
  ],
  "has_more": false,
  "limit": 0,
  "offset": 0,
  "waiting_record_count": 0
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | Bad Request | `{ "error": string, "msg": string, "field": string \| null }` |
| 403 | Forbidden | `{ "error": string, "msg": string, "field": string \| null }` |
| 404 | Not Found | `{ "error": string, "msg": string, "field": string \| null }` |

## Related

- [API Reference overview](https://docs.stacksync.com/api-reference): base URLs, regions, pagination, idempotency and errors
- [Authentication](https://docs.stacksync.com/api-reference/authentication): API keys and the 403 answers
- OpenAPI document: https://docs.stacksync.com/openapi.json
- [List queues](https://docs.stacksync.com/api-reference/queues/list_queues)
- [Get a queue](https://docs.stacksync.com/api-reference/queues/get_queue)
- [Create a queue](https://docs.stacksync.com/api-reference/queues/create_queue)
- [Update a queue](https://docs.stacksync.com/api-reference/queues/update_queue)
- [Delete a queue](https://docs.stacksync.com/api-reference/queues/delete_queue)
- [Flush a queue](https://docs.stacksync.com/api-reference/queues/flush_queue)
- [Clear a queue's waiting records](https://docs.stacksync.com/api-reference/queues/clear_queue_records)