Lists

Api ReferenceUpdated February 18, 2025

Lists

A list represents one batch of leads (from a single generate or generate-batch request). You can list lists, get a list's status (to poll until completed), and export the processed results as CSV or JSON.


List lists

GET /api/v1/lists

Returns lead lists in the API key's workspace, with optional filters.

Headers

Authorization: Bearer <API_KEY> or X-API-Key: <API_KEY>.

Query parameters

ParameterTypeRequiredDescription
campaign_idstring (UUID)NoFilter by campaign.
statusstringNoFilter by processing_status: e.g. processing, completed, failed.
limitnumberNoMax results (default 50, max 100).
offsetnumberNoPagination offset (default 0).

Example request

curl -X GET "https://app.machfive.io/api/v1/lists?status=completed&limit=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (200 OK)

{
  "lists": [
    {
      "id": "uuid",
      "campaign_id": "uuid",
      "custom_name": "API Batch Q1",
      "processing_status": "completed",
      "created_at": "2025-01-15T12:00:00.000Z",
      "completed_at": "2025-01-15T12:15:00.000Z"
    }
  ]
}
FieldTypeDescription
lists[].idstring (UUID)List ID (use for status and export).
lists[].campaign_idstring | nullCampaign ID.
lists[].custom_namestring | nullDisplay name.
lists[].processing_statusstringpending, processing, completed, or failed.
lists[].created_atstring | nullCreation time (ISO 8601).
lists[].completed_atstring | nullWhen processing completed (if done).

Get list status

GET /api/v1/lists/:id

Returns status and metadata for one list. Use this to poll until processing_status is completed or failed after a generate-batch request.

Path parameters

ParameterTypeDescription
idstring (UUID)List ID (e.g. list_id from generate-batch response).

Example request

curl -X GET "https://app.machfive.io/api/v1/lists/LIST_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (200 OK)

Base fields (always present):

{
  "id": "uuid",
  "campaign_id": "uuid",
  "custom_name": "API Batch Q1",
  "processing_status": "completed",
  "created_at": "2025-01-15T12:00:00.000Z",
  "updated_at": "2025-01-15T12:15:00.000Z"
}

When processing_status is completed:

FieldTypeDescription
leads_countnumber | nullNumber of leads processed.
emails_creatednumber | nullTotal emails generated.
processed_file_pathstring | nullInternal path; use export endpoint to download.
completed_atstring | nullWhen processing completed (ISO 8601).

When processing_status is failed:

FieldTypeDescription
failed_atstring | nullWhen processing failed (ISO 8601).

Error responses

StatusErrorDescription
401UNAUTHORIZEDMissing or invalid API key.
404NOT_FOUNDList not found or not in this workspace.
500INTERNAL_ERRORServer error.

Export list results

GET /api/v1/lists/:id/export

Returns the processed output for a completed list. Call this only after GET /api/v1/lists/:id shows processing_status: "completed".

Path parameters

ParameterTypeDescription
idstring (UUID)List ID.

Query parameters

ParameterTypeRequiredDescription
formatstringNocsv (default) or json.

Example request (CSV)

curl -X GET "https://app.machfive.io/api/v1/lists/LIST_ID/export?format=csv" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -o results.csv

Example request (JSON)

curl -X GET "https://app.machfive.io/api/v1/lists/LIST_ID/export?format=json" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response (200 OK)

  • format=csv: Response body is the processed CSV (same columns as UI download). Use Content-Disposition if present for filename.
  • format=json: Body is a JSON object:
{
  "leads": [
    {
      "email": "jane@acme.com",
      "name": "Jane Doe",
      "company": "Acme Inc",
      "title": "VP Marketing",
      "sequence": [
        { "step": 1, "subject": "...", "body": "..." },
        { "step": 2, "subject": "...", "body": "..." }
      ]
    }
  ]
}

Error responses

StatusErrorDescription
409NOT_READYList not yet completed; poll GET /lists/:id first. Response includes processing_status.
401UNAUTHORIZEDMissing or invalid API key.
404NOT_FOUNDList not found or not in this workspace.
500INTERNAL_ERRORExport failed or no processed file available.