Retrieve Kling tasks

April 18, 2025

Table of contents

  1. Request Headers
  2. Query Parameters
  3. Responses
  4. Model
  5. Examples
  6. Try It

This endpoint retrieves a list of tasks from your Kling account.

https://api.useapi.net/v1/kling/tasks/?…

Request Headers
Authorization: Bearer {API token}
Query Parameters
  • email is optional when only one account configured.
    However, if you have multiple accounts configured, this parameter becomes required.

  • contentType is optional, filter tasks by content type.
    Supported values: video, image, or audio.

  • pageSize is optional, specify the number of tasks to return.

  • createdBefore is optional, timestamp (in milliseconds) to get tasks created before this time.
    Cannot be used with createdAfter.

  • createdAfter is optional, timestamp (in milliseconds) to get tasks created after this time.
    Cannot be used with createdBefore.

Responses
  • 200 OK

    {
      "history": [
        {
          "works": [
            {
              "workId": 123456789,
              "workItemId": 0,
              "taskId": 123456789,
              "userId": 12345,
              "type": "m2v_img2video_hq",
              "status": 99,
              "status_name": "succeed",
              "status_final": true          
              "contentType": "video",
              "resource": {
                "resource": "https://s21-kling.klingai.com/....mp4",
                "height": 1268,
                "width": 724,
                "duration": 5041,
                "resourceKey": ""
              },
              "cover": {
                "resource": "https://s21-kling.klingai.com/....jpg",
                "height": 1268,
                "width": 724,
                "duration": 0,
                "resourceKey": ""
              },
              "starNum": 0,
              "cloneCount": 0,
              "reportNum": 0,
              "createTime": 1744858514515,
              "taskInfo": {
                "type": "m2v_img2video_hq",
                "inputs": [
                  {
                    "name": "input",
                    "inputType": "URL",
                    "token": null,
                    "blobStorage": null,
                    "url": "https://s21-kling.klingai.com/....jpg",
                    "cover": null,
                    "fromWorkId": null,
                    "fromUploadId": null
                  }
                ],
                "arguments": [
                  {
                    "name": "prompt",
                    "value": "A person dancing"
                  },
                  {
                    "name": "negative_prompt",
                    "value": ""
                  },
                  {
                    "name": "duration",
                    "value": "5"
                  },
                  {
                    "name": "kling_version",
                    "value": "2.0"
                  }
                ],
                "extraArgs": {},
                "callbackPayloads": [],
                "scene": "NORMAL_CREATION"
              },
              "selfAttitude": "unknown",
              "selfComment": {
                "rate": 0,
                "tags": [],
                "content": "",
                "prompts": []
              },
              "favored": false,
              "starred": false,
              "publishStatus": "unpublished",
              "deleted": false,
              "publishTime": 0,
              "submitTime": 1744858514515,
              "lipSyncStatus": 99,
              "downloadInfo": {
                "fileTypes": [
                  {
                    "type": "MP4",
                    "watermark": true
                  }
                ]
              },
              "allowPublish": true
            }
          ],
          "task": {
            "id": 123456789,
            "userId": 12345,
            "type": "m2v_img2video_hq",
            "scene": "NORMAL_CREATION",
            "status": 99,
            "status_name": "succeed",
            "status_final": true          
            "taskInfo": {
              "type": "m2v_img2video_hq",
              "inputs": [
                {
                  "name": "input",
                  "inputType": "URL",
                  "token": null,
                  "blobStorage": null,
                  "url": "https://s21-kling.klingai.com/....jpg",
                  "cover": null,
                  "fromWorkId": null,
                  "fromUploadId": null
                }
              ],
              "arguments": [
                {
                  "name": "prompt",
                  "value": "A person dancing"
                },
                {
                  "name": "negative_prompt",
                  "value": ""
                },
                {
                  "name": "duration",
                  "value": "5"
                },
                {
                  "name": "kling_version",
                  "value": "2.0"
                }
              ],
              "extraArgs": {},
              "callbackPayloads": [],
              "scene": "NORMAL_CREATION"
            },
            "favored": false,
            "deleted": false,
            "viewed": true,
            "createTime": 1744858514499,
            "updateTime": 1744858823172,
            "viewTime": 1744916388016
          },
          "etaTime": 0,
          "etaTimeOverSla": false,
          "queuingEtaTime": 0,
          "originEtaTime": 0,
          "originQueuingEtaTime": 0,
          "currentTimestamp": 1744955215247
        }
      ],
      "userPoints": {
        "total": 190500
      },
      "userTickets": {
        "ticket": [
          {
            "orderId": "123456789",
            "type": "priority",
            "packageType": "reward",
            "amount": 1,
            "balance": 1,
            "startTime": 1744046060883,
            "endTime": 1746724460883
          }
        ]
      }
    }
    
  • 400 Bad Request

    {
      "error": "createdAfter and createdBefore cannot be used together"
    }
    
  • 401 Unauthorized

    {
      "error": "Unauthorized",
      "code": 401
    }
    
Model

List of known status values:

status status_name status_final Notes
5 submitted false  
6 failed true  
7 failed true The input prompt contains sensitive words
9 failed true Change the input prompt and try again
10 processing false  
50 failed true Change the input prompt and try again
99 succeed true  

To download assets without watermarks, use the GET /assets/download endpoint with the workId values found in the works array of the response.

{ // TypeScript, all fields are optional
    history: {
        works: {
            workId: number
            workItemId: number
            taskId: number
            userId: number
            type: string
            status: number
            status_name: string
            status_final: boolean    
            contentType: string
            resource: {
                resource: string
                height: number
                width: number
                duration: number
                resourceKey: string
            }
            cover: {
                resource: string
                height: number
                width: number
                duration: number
                resourceKey: string
            }
            starNum: number
            cloneCount: number
            reportNum: number
            createTime: number
            taskInfo: {
                type: string
                inputs: {
                    name: string
                    inputType: string
                    token: string | null
                    blobStorage: string | null
                    url: string
                    cover: string | null
                    fromWorkId: number | null
                    fromUploadId: number | null
                }[]
                arguments: {
                    name: string
                    value: string
                }[]
                extraArgs: Record<string, any>
                callbackPayloads: any[]
                scene: string
            }
            selfAttitude: string
            selfComment: {
                rate: number
                tags: any[]
                content: string
                prompts: any[]
            }
            favored: boolean
            starred: boolean
            publishStatus: string
            deleted: boolean
            publishTime: number
            submitTime: number
            lipSyncStatus: number
            downloadInfo: {
                fileTypes: {
                    type: string
                    watermark: boolean
                }[]
            }
            allowPublish: boolean
        }[]
        task: {
            id: number
            userId: number
            type: string
            scene: string
            status: number
            status_name: string
            status_final: boolean    
            taskInfo: {
                type: string
                inputs: {
                    name: string
                    inputType: string
                    token: string | null
                    blobStorage: string | null
                    url: string
                    cover: string | null
                    fromWorkId: number | null
                    fromUploadId: number | null
                }[]
                arguments: {
                    name: string
                    value: string
                }[]
                extraArgs: Record<string, any>
                callbackPayloads: any[]
                scene: string
            }
            favored: boolean
            deleted: boolean
            viewed: boolean
            createTime: number
            updateTime: number
            viewTime: number
        }
        etaTime: number
        etaTimeOverSla: boolean
        queuingEtaTime: number
        originEtaTime: number
        originQueuingEtaTime: number
        currentTimestamp: number
    }[]
    userPoints: {
        total: number
    }
    userTickets: {
        ticket: {
            orderId: string
            type: string
            packageType: string
            amount: number
            balance: number
            startTime: number
            endTime: number
        }[]
    }
}
Examples
  • curl "https://api.useapi.net/v1/kling/tasks/[email protected]" \
       -H "Accept: application/json" \
       -H "Authorization: Bearer …" 
    
  • const token = "API token";
    const email = "Previously configured account email";
    const apiUrl = `https://api.useapi.net/v1/kling/tasks/?email=${email}`; 
    const response = await fetch(apiUrl, {
      headers: {
        "Authorization": `Bearer ${token}`,
      },
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    email = "Previously configured account email"
    apiUrl = f"https://api.useapi.net/v1/kling/tasks/?email={email}"
    headers = {
        "Authorization" : f"Bearer {token}"
    }
    response = requests.get(apiUrl, headers=headers)
    print(response, response.json())
    
Try It