spideriq

Docs / lead-generation/enrichment-api

Enrichment API

Reference for the routes behind Enrichment in the dashboard. A recipe is an ordered list of AI steps. A run applies a recipe to leads your workspace already scraped, under a spending ceiling you set, and writes its results to the store or to one of your directory categories.

Base URL: https://spideriq.ai/api/v1/dashboard/enrichment

Auth: Authorization: Bearer $SPIDERIQ_API_KEY (an API key or a personal access token), or a dashboard session. Reads need the member role; writes need the admin role. Every row is scoped to your workspace: another workspace's id answers 404.

Formats: read routes take ?format=json|llm|yaml|md. Lists page with limit (1 to 200, default 50) and offset.

Concepts

Term

Meaning

Step

One prompt, one model (optional; falls back to the recipe's default_model), and the fields it must return. Up to 10 steps per recipe, 20 fields per step.

Field

name, type (text, long_text, list, faq, json), required, and limits that fit the type: max_chars (text); min_words, max_words (long_text); min_items, max_items, item_max_chars (list); min_items, max_items (faq); preset (json).

Token

A double-brace reference in a prompt: {{website_text}} (the lead's website text, cut to 8,000 characters), another lead column such as {{name}}, or an earlier step's field as {{step_id.field}}. A single brace is plain text.

Default model

openai/gpt-oss-120b for new recipes and the starter. Any step may name another model by the name SpiderGate serves it under.

Starter

A platform recipe (is_starter: true), readable by every workspace. Copy it to edit it. Today: "Local business profile", 4 steps.

Ceiling

ceiling_usd, required on every run. The run stops when its counted model cost reaches it. Cost is counted at the model's list price.

Limits

Per workspace: 5 runs per hour, 20 runs per day, and $5.00 of counted model cost per 24 hours.

Recipes

GET /recipes

Lists your recipes and the starters.

curl -s "https://spideriq.ai/api/v1/dashboard/enrichment/recipes?limit=20" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)
{"items": [{"id": "rcp_local_business_profile", "is_starter": true, "name": "Local business profile", "step_count": 4, "default_model": "openai/gpt-oss-120b"}], "total": 1, "limit": 20, "offset": 0}
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

401

No or invalid credentials

Send a valid API key

409

The credentials have no workspace

Use a key issued for a workspace

POST /recipes

Creates a recipe. The response is the stored recipe with its rcp_… id.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/recipes" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "name": "Two-step profile",
    "steps": [
      {"id": "about", "name": "About", "prompt": "From this website text, describe the business.\n\n{{website_text}}",
       "fields": [{"name": "description", "type": "long_text", "min_words": 40, "max_words": 120},
                  {"name": "services", "type": "list", "min_items": 2, "max_items": 6}]},
      {"id": "seo", "name": "SEO", "prompt": "Write an SEO title and meta description for: {{about.description}}",
       "fields": [{"name": "seo_title", "type": "text", "max_chars": 60},
                  {"name": "meta_description", "type": "text", "max_chars": 155}]}
    ]
  }'

Errors:

Status

When

What to do

422 RECIPE_REFERENCE_INVALID

A prompt references a later step, its own step, or an unknown step or column

Reference only earlier steps and known columns

422 RECIPE_FIELD_DUPLICATE

Two steps return a field with the same name

Rename one of the fields

422 RECIPE_STEP_ID_DUPLICATE

Two steps share an id

Give each step a unique id

422

A limit does not fit its field type, or a value is out of range

Use the limits listed under Concepts

409

A recipe with that name already exists

Pick another name

GET /recipes/{recipe_id}

Returns one recipe, yours or a starter.

curl -s "https://spideriq.ai/api/v1/dashboard/enrichment/recipes/rcp_local_business_profile?format=md" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such recipe in your workspace

Check the id with GET /recipes

PATCH /recipes/{recipe_id}

Changes the fields you send; the rest stay as they are. A run already started keeps the steps it was started with.

curl -s -X PATCH "https://spideriq.ai/api/v1/dashboard/enrichment/recipes/rcp_0123abcd" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY" -H "Content-Type: application/json" \
  -d '{"default_model": "openai/gpt-oss-120b"}'
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

403

The recipe is a starter

Copy it first with POST /recipes/{recipe_id}/copy

404

No such recipe

Check the id

409

The new name is taken

Pick another name

422

The same validation as create, or a required value set to null

Fix the body

DELETE /recipes/{recipe_id}

Deletes one of your recipes. Answers 204.

curl -s -X DELETE "https://spideriq.ai/api/v1/dashboard/enrichment/recipes/rcp_0123abcd" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 204 No Content (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

403

The recipe is a starter

Starters cannot be deleted

404

No such recipe

Check the id

POST /recipes/{recipe_id}/copy

Copies a recipe (usually a starter) into your workspace so you can edit it. Optional body: {"name": "My profile"}.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/recipes/rcp_local_business_profile/copy" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY" -H "Content-Type: application/json" -d '{"name": "My profile"}'
# → 201 Created (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such recipe

Check the id

409

A recipe with that name exists

Send another name

POST /recipes/{recipe_id}/test

Runs the recipe, or the steps up to step, on up to 3 of your leads and returns the output. Nothing is stored. Send steps to test unsaved edits, and business_ids (at most 3) to pick the leads; otherwise 3 recent leads are used.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/recipes/rcp_0123abcd/test" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY" -H "Content-Type: application/json" \
  -d '{"step": "seo"}'
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

429

More than 6 tests in a minute for your workspace

Wait, then retry

403

Enrichment is not available on your plan

Check your plan

409

Your workspace has no stored leads yet

Run a campaign or a bulk run first

503

Enrichment is paused, or the test is briefly unavailable

Retry later

Runs

POST /runs/estimate

How many leads a source and filter select and what one run would cost. Without source_type and source_id it prices one lead (lead_count and total_usd are null). Starts nothing.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/runs/estimate" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY" -H "Content-Type: application/json" \
  -d '{"recipe_id": "rcp_local_business_profile", "source_type": "campaign", "source_id": "bulk_9b14bb574c2e4f0a", "lead_filter": "with_website"}'
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

422

Only one of source_type and source_id was sent

Send both, or neither

404

No such recipe

Check the id

409

No stored leads yet

Run a campaign or a bulk run first

POST /runs

Starts a run. source_type is campaign (a campaign's stored leads) or bulk_run (the leads one bulk job stored). lead_filter is all, with_website or with_email. destination_type is store (default) or directory; a directory run needs destination_id, the category id. publish_mode is draft (default) or published. ceiling_usd is required. The response carries the run and its estimate.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/runs" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY" -H "Content-Type: application/json" \
  -d '{"recipe_id": "rcp_local_business_profile", "source_type": "campaign", "source_id": "bulk_9b14bb574c2e4f0a",
       "lead_filter": "with_website", "destination_type": "directory", "destination_id": "3f2b8c1e-5d4a-4e7b-9c1a-2b6d8e0f4a17",
       "publish_mode": "draft", "ceiling_usd": 0.50}'
# → 201 Created (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

422

ceiling_usd missing, no lead matches, too many leads, or a directory run without its category

Fix the body or widen the filter

429

A workspace limit is reached (runs per hour or per day, or the 24-hour cost cap); Retry-After says when

Wait for the window, or lower the run size

403

The plan refuses the run; the body carries reason_code and reason_human

Read the reason; nothing was written

404

No such recipe

Check the id

409

No stored leads yet

Run a campaign or a bulk run first

GET /runs

Lists your runs, newest first, with status, lead counts and cost.

curl -s "https://spideriq.ai/api/v1/dashboard/enrichment/runs?limit=10" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors: none beyond 401 for missing credentials.

GET /runs/{run_id}

One run: status (queued, running, completed, stopped, failed), counts, cost_usd, the recipe snapshot it runs, and for a directory run directory with written, matched_by_name, collisions and failed.

curl -s "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such run in your workspace

Check the id with GET /runs

POST /runs/{run_id}/stop

Stops a queued or running run. Valid results already written are kept, and a directory run still writes its valid leads.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd/stop" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

409

The run already finished

Nothing to stop

404

No such run

Check the id

POST /runs/{run_id}/run-again

Starts a new run over some of this run's leads. scope: failed (default), remaining, failed_and_remaining or all; or business_ids (up to 500) for chosen leads. ceiling_usd is required.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd/run-again" \
  -H "Authorization: Bearer $SPIDERIQ_API_KEY" -H "Content-Type: application/json" -d '{"scope": "failed", "ceiling_usd": 0.20}'
# → 201 Created (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

422

ceiling_usd missing, or no lead in the chosen scope

Fix the body

429

A workspace limit is reached

Wait for the window

404

No such run

Check the id

POST /runs/{run_id}/publish

Publishes the AI content of every listing a directory run wrote. POST /runs/{run_id}/unpublish takes it down again; the listing page then shows the category's own title.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd/publish" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such run, or it wrote no listings

Check the run is a directory run

POST /runs/{run_id}/unpublish

Takes down the AI content of every listing the run wrote. The listings stay; only the AI text goes.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd/unpublish" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such run, or it wrote no listings

Check the id

Results

GET /runs/{run_id}/results

The run's results, one per lead: status (pending, running, valid, failed, skipped), the fields each step returned, cost_usd, and for a failed lead failure_class (output_invalid, model_error, timeout, no_usable_key, website_text_unavailable) and failure_reason. Filter with ?status= and ?failure_class=.

curl -s "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd/results?status=failed" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such run

Check the id

GET /runs/{run_id}/results/{result_id}

One result in full.

curl -s "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd/results/4812" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such run or result

Check both ids

GET /runs/{run_id}/export.csv

Downloads the run's results as CSV, one row per lead.

curl -s -o results.csv "https://spideriq.ai/api/v1/dashboard/enrichment/runs/run_0123abcd/export.csv" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No such run

Check the id

GET /stats

Totals for your workspace over days (1 to 365, default 30): runs, leads, valid and failed results, and cost. Narrow with recipe_id or source_type.

curl -s "https://spideriq.ai/api/v1/dashboard/enrichment/stats?days=30" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

422

days out of range, or a malformed recipe_id

Fix the query

Directory listings

POST /directory/listings/{listing_id}/publish

Publishes the AI content of one listing. POST /directory/listings/{listing_id}/unpublish takes it down. A published listing page prints the AI seo_title, meta_description, and JSON-LD (an FAQPage when the recipe returns faq).

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/directory/listings/7c1d9e42-8a3b-4f6e-b2d5-0e9a4c7f1b38/publish" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No listing with enrichment content in your workspace

Check the listing was written by a directory run

POST /directory/listings/{listing_id}/unpublish

Takes down the AI content of one listing.

curl -s -X POST "https://spideriq.ai/api/v1/dashboard/enrichment/directory/listings/7c1d9e42-8a3b-4f6e-b2d5-0e9a4c7f1b38/unpublish" -H "Authorization: Bearer $SPIDERIQ_API_KEY"
# → 200 OK (a 4xx answers with the Errors table below)

Errors:

Status

When

What to do

404

No listing with enrichment content

Check the id

Enrichment in a campaign or bulk run

Campaign and bulk lead sourcing settings take a workflow.enrichment block. When it is on, one run is queued with these settings when the campaign or bulk run finishes, over its stored leads; it never runs inside the scrape, and a second finish queues nothing.

{"workflow": {"enrichment": {"enabled": true, "recipe_id": "rcp_0123abcd", "destination_type": "store",
  "lead_filter": "with_website", "ceiling_usd": 0.50}}}

Key

Default

Notes

enabled

false

Required to queue a run

recipe_id

none

Required when enabled

destination_type

store

store or directory

destination_id

none

The category id, directory only

publish_mode

draft

Directory only

lead_filter

all

all, with_website, with_email

ceiling_usd

none

Required when enabled