Export jobs

GET /export-jobs

List the organization's CSV export jobs, newest first. A completed job carries a signed fileUrl to download.

Requires the exports: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://your-store.meisei.app/api/export-jobs" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "data": [
    {
      "id": "A4Ws1igz",
      "userId": "uHKNC81a",
      "fileUrl": "string",
      "type": "customers",
      "status": "pending",
      "totalCount": 0,
      "filter": "...",
      "search": "string",
      "createdAt": "2025-01-15T09:30:00Z",
      "updatedAt": "2025-01-15T09:30:00Z"
    }
  ],
  "nextCursor": "string"
}

POST /export-jobs

Queue a CSV export of records of one type, optionally narrowed by a filter. It runs in the background, so poll the job until it completes and then download fileUrl. Exports of one type run one at a time: if the same export (same type, filter and search) is already queued or running, its ID is returned rather than a second being queued. Only session-authenticated requests can start one, since an export is attributed to a user.

Requires the exports:write permission.

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

Body parameters

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

Which records to export.

filterstring

A JSON-encoded filter document, in the same shape the matching list endpoint takes. Only the records it matches are exported. Omit to export every record of this type.

searchstring

A free-text search term, matched the same way the matching list endpoint matches it. Combined with filter using AND.

Request
curl \
  -X POST \
  "https://your-store.meisei.app/api/export-jobs" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "customers",
  "filter": "string",
  "search": "string"
}'
Response
{
  "exportJobId": "A4Ws1igz"
}

GET /export-jobs/{id}

Get a single export job by ID. Once its status is completed, fileUrl is a signed link to the CSV.

Requires the exports:read permission.

Path parameters

idstringrequired

The ID of the export job.

Request
curl \
  "https://your-store.meisei.app/api/export-jobs/A4Ws1igz" \
  -H "Authorization: Bearer sk_YOUR_SECRET_KEY"
Response
{
  "id": "A4Ws1igz",
  "userId": "uHKNC81a",
  "fileUrl": "string",
  "type": "customers",
  "status": "pending",
  "totalCount": 0,
  "filter": "...",
  "search": "string",
  "createdAt": "2025-01-15T09:30:00Z",
  "updatedAt": "2025-01-15T09:30:00Z"
}