Catalog AI
Sign In

AI Import API

Start AI-powered import jobs to extract structured product data from documents and files.

Endpoints Overview

Method Endpoint Description
POST /ai-import-jobs/create Start an import job
POST /ai-import-jobs/get List import jobs
POST /ai-import-jobs/{job_id}/items/get Get extracted products
POST /ai-import-jobs/{job_id}/finalize Import selected products into catalog
POST /ai-import-jobs/{job_id}/stop Stop a running job

Create Import Job

Upload files and start a new AI import job.

Endpoint: POST /api/{organization}/ai-import-jobs/create

This endpoint accepts multipart/form-data.

Request Fields

Field Type Required Description
files File[] Yes Files to import (max 5, 20 MB each, 100 MB total)
modelType string No AI model to use — budget-v1 or pro-v1 (default: pro-v1)
prompt string No Custom extraction instructions (min 10 chars)
autoEnrich boolean No Auto-enrich products after extraction (default: false)
enrichmentConfig object No Enrichment settings — only applies when autoEnrich is true

Enrichment config fields:

Field Type Description
modelType string budget-v1 or pro-v1
websearch boolean Search the web for additional product info (default: false)
extractImages boolean Extract product images from web sources (default: false)
includeExistingAttributes boolean Pass current product attributes to enrichment (default: true)
attributeSetId string | null Attribute set to scope enrichment

Model Types

Model Description
budget-v1 Cost-effective for large volumes of simple products
pro-v1 Advanced extraction for complex documents and technical products

Example Request

curl -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/create \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@catalog.pdf" \
  -F "files=@products.csv" \
  -F "modelType=pro-v1" \
  -F "prompt=Extract product name, SKU, brand, and available colors" \
  -F "autoEnrich=false"

Response

{
  "success": true,
  "data": {
    "jobId": "job_abc123",
    "status": "pending",
    "totalFiles": 2,
    "modelType": "pro-v1",
    "createdAt": "2026-04-18T10:00:00Z"
  }
}

List Import Jobs

Retrieve a paginated list of AI import jobs for your organization.

Endpoint: POST /api/{organization}/ai-import-jobs/get

Request Body

Field Type Required Default Description
page number No 1 Page number
limit number No 10 Items per page (max 100)

Example Request

curl -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/get \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page": 1, "limit": 10}'

Response

{
  "success": true,
  "data": {
    "jobs": [
      {
        "id": "job_abc123",
        "status": "completed",
        "modelType": "pro-v1",
        "totalFiles": 2,
        "totalExtracted": 84,
        "createdAt": "2026-04-18T10:00:00Z",
        "completedAt": "2026-04-18T10:12:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 5,
      "totalPages": 1
    }
  }
}

Job Status Values

Status Description
pending Job is queued
processing Extracting products from files
completed All products extracted successfully
completed_with_errors Finished but some products failed
failed Job could not complete
stopped Manually stopped — extracted products are retained

Get Job Items

Retrieve the extracted products from an import job.

Endpoint: POST /api/{organization}/ai-import-jobs/{job_id}/items/get

Path Parameters

Parameter Type Required Description
job_id string Yes The import job ID

Request Body

Field Type Required Default Description
page number No 1 Page number
limit number No 200 Items per page (max 200)
searchQuery string No — Filter by product name or SKU
sort string No name-asc name-asc, name-desc, type-asc, type-desc

Example Request

curl -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/job_abc123/items/get \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page": 1, "limit": 50}'

Response

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "item_111",
        "type": "family",
        "status": "pending",
        "parentItemId": null,
        "data": {
          "name": "Wireless Headphones",
          "sku": "WH-PARENT",
          "brand": "AudioTech",
          "category": "Electronics",
          "manufacturer": null,
          "mpn": null,
          "variantOptions": {}
        },
        "errorMessage": null,
        "childCount": 2
      },
      {
        "id": "item_112",
        "type": "product",
        "status": "pending",
        "parentItemId": "item_111",
        "data": {
          "name": "Wireless Headphones - Black",
          "sku": "WH-001-BLK",
          "brand": "AudioTech",
          "category": "Electronics",
          "variantOptions": { "Color": "Black" }
        },
        "errorMessage": null,
        "childCount": 0
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 50,
      "total": 84,
      "totalPages": 2
    }
  }
}

Item Types

Type Description
family Parent product — groups variants under it
product Variant — belongs to a family via parentItemId
standalone Product with no variants

Item Status Values

Status Description
pending Not yet imported into catalog
completed Successfully imported
failed Import failed — see errorMessage

Finalize Import Job

Import selected products into your catalog.

Endpoint: POST /api/{organization}/ai-import-jobs/{job_id}/finalize

You can call this multiple times on the same job to import products in batches.

Path Parameters

Parameter Type Required Description
job_id string Yes The import job ID

Request Body

Field Type Required Description
all boolean No Import all pending products
itemIds string[] No Import specific item IDs
excludedIds string[] No Import all except these IDs (use with all: true)

Example Request

# Import specific items
curl -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/job_abc123/finalize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"itemIds": ["item_111", "item_112"]}'

# Import all pending items
curl -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/job_abc123/finalize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"all": true}'

Response

{
  "success": true,
  "data": {
    "jobId": "job_abc123",
    "imported": 42,
    "failed": 1
  }
}

Stop Import Job

Stop a running or pending import job. Already-extracted products are retained.

Endpoint: POST /api/{organization}/ai-import-jobs/{job_id}/stop

Path Parameters

Parameter Type Required Description
job_id string Yes The import job ID

Example Request

curl -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/job_abc123/stop \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

{
  "success": true,
  "data": {
    "jobId": "job_abc123",
    "status": "stopped"
  }
}

Only jobs with status pending or processing can be stopped.


Workflow Example

1. Start an import job

JOB_ID=$(curl -s -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/create \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "files=@products.pdf" \
  -F "modelType=pro-v1" | jq -r '.data.jobId')

2. Poll until complete

while true; do
  STATUS=$(curl -s -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/get \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d "{}" | jq -r ".data.jobs[] | select(.id==\"$JOB_ID\") | .status")

  echo "Status: $STATUS"
  [ "$STATUS" = "completed" ] || [ "$STATUS" = "failed" ] && break
  sleep 10
done

3. Review and finalize

# Get extracted products
curl -s -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/$JOB_ID/items/get \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"limit": 200}'

# Import all into catalog
curl -X POST https://catalog-ai.tdcapps.com/api/your-org/ai-import-jobs/$JOB_ID/finalize \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"all": true}'

See Also