> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-vector.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Message Tasks

> This endpoint returns the last 100 tasks in descending chronological order.           
Use the cursor parameter to paginate.

## Request

<ParamField path="messageId" type="string" required>
  MessageId is the Id of the message to list tasks for.
</ParamField>

<ParamField query="cursor" type="int">
  Cursor is a unix timestamp with milliseconds precision. You can use it to
  paginate the results.
</ParamField>

## Response

<ResponseField name="cursor" type="int">
  If there are more logs, this is the cursor to use to get the next page.
  Returns 0 or undefined if there are no more logs.
</ResponseField>

<ResponseField name="tasks" type="Array<Task>" required>
  <Expandable title="Task">
    <ResponseField name="completedAt" type="int">
      CompletedAt is the time when the task is processed successfully. Unix timestamp with millisecond precision
    </ResponseField>

    <ResponseField name="error" type="string">
      Error is the error message from the last failure.
    </ResponseField>

    <ResponseField name="lastErrorAt" type="int">
      LastErrorAt is the time time of the last failure if any. Unix timestamp with millisecond precision
    </ResponseField>

    <ResponseField name="maxRetry" type="int" required>
      MaxRetry is the maximum number of times the task can be retried.
    </ResponseField>

    <ResponseField name="messageId" type="string" required>
      Id is the identifier of the the message for this task.
    </ResponseField>

    <ResponseField name="nextProcessAt" type="int">
      NextProcessAt is the time the task is scheduled to be processed, Unix timestamp with millisecond precision
    </ResponseField>

    <ResponseField name="retried" type="int" required>
      Retried is the number of times the task has retried so far.
    </ResponseField>

    <ResponseField name="state" type="string" required>
      The current state of this task
    </ResponseField>

    <ResponseField name="taskId" type="string" required>
      Id is the identifier of the task.
    </ResponseField>

    <ResponseField name="url" type="string" required>
      URL is the destination where we should send the message.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```shell curl
  curl -X GET "https://qstash.upstash.io/v1/messages/msg_123/tasks" \
   -H "Authorization: Bearer <token>"
  ```
</RequestExample>

<ResponseExample>
  ```json 200
  {
    "cursor": 1678901234567,
    "tasks": [
      {
        "completedAt": 1678901123456,
        "error": "",
        "lastErrorAt": 0,
        "maxRetry": 3,
        "messageId": "abc123",
        "nextProcessAt": 1678902000000,
        "retried": 2,
        "state": "processing",
        "taskId": "task001",
        "url": "https://example.com/task001"
      },
      {
        "completedAt": 1678900876543,
        "error": "Connection timeout",
        "lastErrorAt": 1678901800000,
        "maxRetry": 5,
        "messageId": "def456",
        "nextProcessAt": 1678902100000,
        "retried": 4,
        "state": "retrying",
        "taskId": "task002",
        "url": "https://example.com/task002"
      }
    ]
  }
  ```
</ResponseExample>
