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

# Get task status and result

> Poll until status is Succeeded, Failed, or Cancelled. Read generated content or planning data from output; on failure inspect errorMessage.



## OpenAPI

````yaml /openapi.json get /tasks/{id}
openapi: 3.1.0
info:
  title: LuluLab API · First batch
  version: 1.0.0
  description: >-
    Image generation, video generation, product video planning, product image
    planning, and the common upload and task APIs.
servers:
  - url: https://customer.lululab.ai
    description: Production
security: []
tags:
  - name: Getting started
    description: Upload product photos and estimate credits.
  - name: Creative tasks
    description: Submit an asynchronous workflow task and retrieve its result.
paths:
  /tasks/{id}:
    get:
      tags:
        - Creative tasks
      summary: Get task status and result
      description: >-
        Poll until status is Succeeded, Failed, or Cancelled. Read generated
        content or planning data from output; on failure inspect errorMessage.
      operationId: getTask
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Task id returned by POST /tasks.
      responses:
        '200':
          description: Task status and result. The output shape depends on workflowId.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
              examples:
                processing:
                  summary: Still processing
                  value:
                    id: TASK_ID
                    workflowId: ImageGenV2
                    status: Running
                    output: null
                    errorMessage: null
                videoComplete:
                  summary: Video generated
                  value:
                    id: TASK_ID
                    workflowId: VideoGenV2
                    status: Succeeded
                    output:
                      video:
                        url: https://example.com/generated.mp4
                        mimeType: video/mp4
                    errorMessage: null
                productVideoPlan:
                  summary: Product video plan
                  value:
                    id: TASK_ID
                    workflowId: SalesVideoPromptV3
                    status: Succeeded
                    output:
                      videoPrompt:
                        summary: A short product showcase
                        duration: 5
                        prompt: FULL_VIDEO_PROMPT_FOR_VIDEO_CREATION
                    errorMessage: null
                productImagePlan:
                  summary: Product image plan
                  value:
                    id: TASK_ID
                    workflowId: ProductImagePromptV1
                    status: Succeeded
                    output:
                      imagePrompts:
                        cards:
                          - title: Product hero
                            prompt: ONE_CARD_IMAGE_PROMPT
                            textOverlay: Handmade finish
                    errorMessage: null
        '401':
          description: >-
            Request rejected. The response body contains an error title and
            detail.
        '404':
          description: >-
            Request rejected. The response body contains an error title and
            detail.
      security:
        - ApiKey: []
components:
  schemas:
    Task:
      type: object
      properties:
        id:
          type: string
          description: Save this id to query the result.
        workflowId:
          type: string
        status:
          type: string
          enum:
            - Created
            - Pending
            - Running
            - Succeeded
            - Failed
            - Cancelled
        output:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: >-
            Generated result or plan when the task succeeds; null before
            completion.
        errorMessage:
          type:
            - string
            - 'null'
          description: Failure detail when available.
        credits:
          type:
            - integer
            - 'null'
          description: Credits charged when available.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: Send the raw luk- API key. Do not add Bearer.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.