> ## Documentation Index
> Fetch the complete documentation index at: https://docs.legnext.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Task

> Retrieve job status and results

## Status Values

| Status       | Description                               |
| ------------ | ----------------------------------------- |
| `pending`    | Job is queued and waiting to be processed |
| `staged`     | Job is prepared and staged for processing |
| `processing` | Job is currently being processed          |
| `failed`     | Job has failed due to an error            |
| `completed`  | Job has completed successfully            |

## Headers

| Header      | Type   | Required | Description  |
| ----------- | ------ | -------- | ------------ |
| `x-api-key` | string | Yes      | Your API key |

## Path Parameters

| Parameter | Type   | Required | Description                      |
| --------- | ------ | -------- | -------------------------------- |
| `job_id`  | string | Yes      | The unique identifier of the job |

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.legnext.ai/api/v1/job/98761286-cdc7-4085-abfe-c9f149ff722b" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  job_id = "98761286-cdc7-4085-abfe-c9f149ff722b"
  url = f"https://api.legnext.ai/api/v1/job/{job_id}"
  headers = {
      "x-api-key": "YOUR_API_KEY"
  }

  response = requests.get(url, headers=headers)
  result = response.json()
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const jobId = '98761286-cdc7-4085-abfe-c9f149ff722b';
  const response = await fetch(`https://api.legnext.ai/api/v1/job/${jobId}`, {
    method: 'GET',
    headers: {
      'x-api-key': 'YOUR_API_KEY'
    }
  });

  const result = await response.json();
  console.log(result);
  ```
</CodeGroup>

## Response

Returns the complete job information including current status and results.

```json theme={null}
{
    "job_id": "a616de55-6130-4e1f-b8cd-531ed0599353",
    "model": "midjourney",
    "task_type": "diffusion",
    "status": "completed",
    "config": {
        "service_mode": "public",
        "webhook_config": {
            "endpoint": "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "secret": ""
        }
    },
    "input": null,
    "output": {
        "image_url": "https://cdn.legnext.ai/temp/1760408558306.png",
        "image_urls": [
            "https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_0.png",
            "https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_1.png",
            "https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_2.png",
            "https://cdn.legnext.ai/mj/a616de55-6130-4e1f-b8cd-531ed0599353_3.png"
        ],
        "seed": "1904983176",
        "available_actions": {
            "edit": [
                0,
                1,
                2,
                3
            ],
            "inpaint": [
                0,
                1,
                2,
                3
            ],
            "outpaint": [
                0,
                1,
                2,
                3
            ],
            "pan": [
                0,
                1,
                2,
                3
            ],
            "remix": [
                0,
                1,
                2,
                3
            ],
            "reroll": true,
            "upscale": [
                0,
                1,
                2,
                3
            ],
            "variation": [
                0,
                1,
                2,
                3
            ]
        }
    },
    "meta": {
        "created_at": "2025-10-14T02:22:04Z",
        "started_at": "2025-10-14T02:22:06Z",
        "ended_at": "2025-10-14T02:22:50Z",
        "usage": {
            "type": "point",
            "frozen": 80,
            "consume": 80
        }
    },
    "detail": null,
    "logs": [],
    "error": {
        "code": 0,
        "raw_message": "",
        "message": "",
        "detail": null
    }
}
```


## OpenAPI

````yaml GET /v1/job/{job_id}
openapi: 3.0.3
info:
  title: Legnext AI API
  description: >
    Comprehensive API for professional image and video generation and
    manipulation using Midjourney AI models.


    ## Authentication

    All API requests require an API key passed in the `x-api-key` header.


    ## Base URL

    `https://api.legnext.ai/api`


    ## Rate Limiting

    API requests are rate limited based on your subscription plan.


    ## Webhook Support

    Most endpoints support optional callbacks. When a callback URL is provided,
    the API will POST the completed job result to that URL.
  version: 1.0.0
  contact:
    name: Legnext Support
    email: support@legnext.ai
    url: https://legnext.ai
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - url: https://api.legnext.ai/api
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Image Generation
    description: Text to image, image editing, and manipulation endpoints
  - name: Video Generation
    description: Video creation and enhancement endpoints
  - name: Image Enhancement
    description: AI-powered image upscaling and enhancement using Topaz Labs
  - name: Task Management
    description: Job status tracking and retrieval
  - name: Account
    description: Account information and active tasks management
paths:
  /v1/job/{job_id}:
    get:
      tags:
        - Task Management
      summary: Get Task Status
      description: Retrieve the status and results of a job using its job ID
      operationId: getTaskStatus
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: The unique identifier of the job
      responses:
        '200':
          description: Task information retrieved successfully
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````