Import jobs

GET /import-jobs

List the organization's CSV import jobs, newest first. Poll this or the single-job endpoint to follow an import's progress.

Requires the imports:read permission.

Query Parameters

limitnumber

The number of records to return.

cursorstring

A pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.

sortcreatedAt | -createdAt

The sort order. Prefix a field with - to sort descending. Defaults to -createdAt.

filterstring

A JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: id, type, status, createdAt. See Filtering for the syntax.

Request
curl \
  "https://api.cascade.dev/import-jobs" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "userId": "550e8400-e29b-41d4-a716-446655440000",
      "fileUrl": "string",
      "type": "customers",
      "format": "cascade",
      "status": "pending",
      "totalCount": 0,
      "processedCount": 0,
      "errors": ["..."],
      "sendReviewRequests": true,
      "earnLoyalty": true,
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ],
  "nextCursor": "string"
}

POST /import-jobs

Queue a CSV import. Upload the file first with POST /files/upload-url using private access, then pass the key it returns. The import runs in the background, so poll the job to see how it is going. Only session-authenticated requests can start one, since an import is attributed to a user.

Requires the imports:write permission.

Costs 10 rate limit tokens instead of the usual one. See Rate limits.

Body Parameters

fileKeystringrequired

The storage key returned by POST /files/upload-url for the uploaded CSV.

typecustomers | products | orders | wishlists | reviews | loyalty-membersrequired

What the file contains, which decides the columns the importer expects.

formatcascade | loyaltylion | smile | rivo | yotpo | judgeme | okendo | stamped | loox | swym | wishlistking | growave | wishlisthero

Whose column names the file uses. Defaults to cascade, which is the column set the guides document. A competitor format is remapped to Cascade's columns before the import runs, and the file is refused if its columns do not match that format.

sendReviewRequestsboolean

For an orders import, whether to also queue a review-request survey for each imported order whose flow's trigger matches. Ignored for other types.

earnLoyaltyboolean

For an orders import, whether imported orders earn loyalty points and stamps. Off by default, so importing history never mints points. Ignored for other types.

Request
curl \
  -X POST \
  "https://api.cascade.dev/import-jobs" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "fileKey": "string",
  "type": "customers",
  "format": "cascade",
  "sendReviewRequests": true,
  "earnLoyalty": true
}'
Response
{
  "importJobId": "550e8400-e29b-41d4-a716-446655440000"
}

GET /import-jobs/{id}

Get a single import job by ID, including its progress counts and any rows it skipped.

Requires the imports:read permission.

Path Parameters

idstring (uuid)required

The ID of the import job.

Request
curl \
  "https://api.cascade.dev/import-jobs/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "userId": "550e8400-e29b-41d4-a716-446655440000",
  "fileUrl": "string",
  "type": "customers",
  "format": "cascade",
  "status": "pending",
  "totalCount": 0,
  "processedCount": 0,
  "errors": [
    {
      "row": 0,
      "message": "string",
      "severity": "error"
    }
  ],
  "sendReviewRequests": true,
  "earnLoyalty": true,
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}

GET /import-jobs/{id}/records

List the records an import wrote, in file order. A record deleted since the import keeps its place in the list and comes back with deleted set, so the history stays readable.

Requires the imports:read permission.

Path Parameters

idstring (uuid)required

The ID of the import job.

Query Parameters

limitnumber

The number of records to return.

cursorstring

A pagination cursor. Fetch the next page by passing the nextCursor value from the previous response.

sortcreatedAt | -createdAt

The sort order. Prefix a field with - to sort descending. Defaults to createdAt.

filterstring

A JSON-encoded filter document, for example {"createdAt":{"$gte":"2025-01-01T00:00:00Z"}}. Filterable fields: action, recordTable. See Filtering for the syntax.

Request
curl \
  "https://api.cascade.dev/import-jobs/550e8400-e29b-41d4-a716-446655440000/records" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "importJobId": "550e8400-e29b-41d4-a716-446655440000",
      "recordTable": "customers",
      "recordId": "550e8400-e29b-41d4-a716-446655440000",
      "action": "created",
      "row": 0,
      "label": "string",
      "deleted": true,
      "createdAt": "2025-01-15T09:30:00Z"
    }
  ],
  "nextCursor": "string",
  "counts": {
    "created": 0,
    "updated": 0,
    "total": 0
  }
}