# Source: https://upstash.com/docs/qstash/api/dlq/listMessages.md

# List messages in the DLQ

> List and paginate through all messages currently inside the DLQ

List all messages currently inside the DLQ

## Request

<ParamField query="cursor" type="string">
  By providing a cursor you can paginate through all of the messages in the DLQ
</ParamField>

<ParamField query="messageId" type="string">
  Filter DLQ messages by message id.
</ParamField>

<ParamField query="url" type="string">
  Filter DLQ messages by url.
</ParamField>

<ParamField query="topicName" type="string">
  Filter DLQ messages by url group.
</ParamField>

<ParamField query="scheduleId" type="string">
  Filter DLQ messages by schedule id.
</ParamField>

<ParamField query="queueName" type="string">
  Filter DLQ messages by queue name.
</ParamField>

<ParamField query="api" type="string">
  Filter DLQ messages by API name.
</ParamField>

<ParamField query="fromDate" type="number">
  Filter DLQ messages by starting date, in milliseconds (Unix timestamp). This is inclusive.
</ParamField>

<ParamField query="toDate" type="number">
  Filter DLQ messages by ending date, in milliseconds (Unix timestamp). This is inclusive.
</ParamField>

<ParamField query="responseStatus" type="number">
  Filter DLQ messages by HTTP response status code.
</ParamField>

<ParamField query="callerIp" type="string">
  Filter DLQ messages by IP address of the publisher.
</ParamField>

<ParamField query="count" type="number">
  The number of messages to return. Default and maximum is 100.
</ParamField>

<ParamField query="order" type="string">
  The sorting order of DLQ messages by timestamp. Valid values are "earliestFirst" and "latestFirst". The default is "earliestFirst".
</ParamField>

<ResponseField name="label" type="string">
  Filter DLQ messages by the label of the message assigned by the user.
</ResponseField>

## Response

<ResponseField name="cursor" type="string">
  A cursor which you can use in subsequent requests to paginate through all
  messages. If no cursor is returned, you have reached the end of the messages.
</ResponseField>

<ResponseField name="messages" type="Array">
  <Expandable defaultOpen title="message">
    <Snippet file="qstash-dlq-message-type.mdx" />
  </Expandable>
</ResponseField>

<RequestExample>
  ```sh  theme={"system"}
  curl https://qstash.upstash.io/v2/dlq \
    -H "Authorization: Bearer <token>"
  ```

  ```sh with cursor theme={"system"}
  curl https://qstash.upstash.io/v2/dlq?cursor=xxx \
    -H "Authorization: Bearer <token>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={"system"}
  { 
    "messages": [
      {
        "messageId": "msg_123",
        "topicId": "tpc_123",
        "url":"https://example.com",
        "method": "POST",
        "header": {
          "My-Header": ["my-value"]
        },
        "body": "{\"foo\":\"bar\"}",
        "createdAt": 1620000000000,
        "state": "failed"
      }
    ]
  }
  ```
</ResponseExample>