> ## 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 Task

> This endpoint returns information about a task with the given ID.

## Request

<ParamField path="taskId" type="string" required>
  ID of the related task.
</ParamField>

## Response

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

<ResponseField name="deadline" type="int">
  Deadline is the deadline for the task. 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="string">
  LastErrorAt is the time time of the last failure if any. Unix timestamp with millisecond precision
</ResponseField>

<ResponseField name="maxRetry" type="string" 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>

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

<ResponseExample>
  ```json 200
  {
      "completedAt": 1678900876543,
      "error": "Connection timeout",
      "lastErrorAt": 1678901800000,
      "maxRetry": 5,
      "messageId": "msg_123",
      "nextProcessAt": 1678902100000,
      "retried": 4,
      "state": "retrying",
      "taskId": "tsk_123",
      "url": "https://example.com"
  }
  ```
</ResponseExample>
