Skip to content

List task artifacts

GET/v1/tasks/{task_id}/artifacts

List the images of an asynchronous image task. Returns an empty array until the task is SUCCESS.

Headers

  • AuthorizationstringRequired

    Bearer <API_KEY> of the user who owns the task.

Path parameters

  • task_idstringRequired

    The task_id returned by POST /v1/images/tasks.

Returns

HTTP 200.

  • task_idstringOptional

    Task ID.

  • artifactsobject[]Optional

    Images in generation order.

    Show child fields (6)
    • keystringOptional

      Artifact key: image-1, image-2, …

    • typestringOptional

      Always image.

    • mime_typestringOptional

      Such as image/png.

    • content_urlstringOptional

      View URL; do not send your API key.

    • download_urlstringOptional

      Download URL with a file name; do not send your API key.

    • expires_atintegerOptional

      Expiry of the URLs above in Unix seconds, valid for 15 minutes. Call this endpoint again for fresh URLs.

Errors

HTTPcodeCause and action
404artifact_not_found / invalid_request_errorThe task does not exist or belongs to another user.
401—The API key is invalid, expired or disabled.
503artifact_store_errorImage storage is temporarily unavailable; retry later.
List task images
curl https://ling-light.com/v1/tasks/task_xxxxxxxxxxxxxxxx/artifacts \
  -H "Authorization: Bearer $LINGLIGHT_API_KEY"
const response = await fetch('https://ling-light.com/v1/tasks/task_xxxxxxxxxxxxxxxx/artifacts', {
  headers: {
    Authorization: `Bearer ${process.env.LINGLIGHT_API_KEY}`,
  },
})
console.log(response.status, await response.json())
import os

import requests

response = requests.get(
    "https://ling-light.com/v1/tasks/task_xxxxxxxxxxxxxxxx/artifacts",
    headers={
        "Authorization": f"Bearer {os.environ['LINGLIGHT_API_KEY']}",
    },
    timeout=60,
)
print(response.status_code, response.json())
Response
{
  "task_id": "task_xxxxxxxxxxxxxxxx",
  "artifacts": [
    {
      "key": "image-1",
      "type": "image",
      "mime_type": "image/png",
      "content_url": "https://media.example.com/signed/image-1.png",
      "download_url": "https://media.example.com/signed/image-1.png?download=1",
      "expires_at": 1795661760
    }
  ]
}
API reference overview
Authentication, media URLs, idempotency and errors.
Integration guide
The full flow from API key to downloaded result.
Last updated