Skip to content
LocalICPDocs
ProductDataPricingDevelopers
Sign inStart free
Guides
OverviewErrors and limits
Endpoints
Campaigns6
  • Create a campaign draft
  • Estimate campaign cost and time
  • Run a draft once
  • Poll a campaign
  • List campaigns
  • Cancel a campaign
Results and leads5Bulk runs6Account6
Integrations
MCP serverWebhooks

Campaigns

A campaign turns one request in plain words into a list of businesses. Create it as a draft, check the cost, run it once, then poll until it finishes.

Parse the prompt and save a draft without extraction. Unknown top-level keys are rejected. Qualification uses either any or all contact channels; only qualified leads are delivered and charged. Null disables qualification. Inspect, estimate, then run the draft.

Headers

  • Idempotency-Keystring

    Optional single header, 1-255 printable ASCII characters. Workspace-owned keys expire after 24 hours. Same canonical JSON body, method, route and campaign ID replay the stored response; different request returns 422 idempotency_key_reused. Live work returns 409 idempotency_in_progress and Retry-After: 1. A 5xx is not stored.

    max 255 characters

Bodyapplication/json

  • promptstringrequired

    Natural-language business search; required. Creates a draft without starting extraction.

  • ad_intelligenceboolean

    Collect advertising intelligence.

  • enrich_websiteboolean

    Collect business website metadata and contacts.

  • exclude_aggregatorsboolean

    Exclude directory and aggregator listings.

  • extract_emailsboolean

    Discover email addresses on the business website.

  • fieldsstring[]

    Place-field IDs from GET /place-fields. Omitted uses the default selection. Selected fields determine sparse result properties and enrichment.

  • generate_icebreakersboolean

    Generate an outreach icebreaker for each delivered business.

  • glstring

    Google country code; explicit region overrides prompt inference.

Response201application/json

Headers: Idempotent-Replayed, Location

  • idstring

    Campaign ID; the {id} in every campaign path.

  • namestring

    The name given at creation, or one derived from the prompt.

  • promptstring

    The plain-language request the campaign was created from.

  • statusstring

    draft, queued, running, cancelling, completed, failed or cancelled; each campaign runs once

    draftqueuedrunningcancellingcompletedfailedcancelled
  • target_countinteger

    Leads asked for.

  • result_countinteger

    Leads delivered so far.

  • qualifierany

    Contact channels a lead must have to be delivered (any or all of them); null when there is no qualifier.

  • fieldsstring[]

    Place-field IDs each result carries; see GET /place-fields.

Errors

400401402403404409413422429500What they mean
curl -X POST "https://app.localicp.com/api/v1/campaigns" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: 00000000-0000-4000-8000-000000000000" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "3 dentists in Iasi Romania",
    "name": "Local OpenAPI verification",
    "target_count": 3,
    "qualifier": null,
    "fields": [
      "name",
      "phone",
      "website"
    ],
    "max_photos": -1
  }'
201Example response
{
  "id": "53040d19-ba88-47df-9efa-0051a68e808a",
  "name": "Local OpenAPI verification",
  "prompt": "3 dentists in Iasi Romania",
  "status": "draft",
  "target_count": 3,
  "result_count": 0,
  "qualifier": null,
  "fields": [
    "name",
    "phone",
    "website"
  ],
  "progress": null,
  "shortfall": null,
  "error": null,
  "usage": {
    "held": 0,
    "charged": 0,
    "refunded": 0,
    "state": "none"
  },
  "created_at": "2026-10-10T15:30:24.945617Z",
  "updated_at": "2026-10-10T15:30:24.951703Z",
  "started_at": null,
  "completed_at": null,
  "language": {
    "lang": "ro",
    "gl": "ro",
    "source": "inferred"
  },
  "links": {
    "self": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a",
    "results": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a/results",
    "export": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a/export",
    "app": "http://localhost:5173/campaigns/53040d19-ba88-47df-9efa-0051a68e808a"
  }
}

Quote saved campaign_id or options. Credits are a ceiling, not a reservation; actual charges reflect delivered work. ETA uses measured work and queue load.

Bodyapplication/json

  • actionstring

    Action to quote: campaign (default), bulk, leads, enrichment, reviews, website, grid. This shared estimate endpoint reserves no credits.

    campaignbulkleadsenrichmentreviewswebsitegrid

    default: campaign

  • ad_intelligenceboolean

    Optional ad_intelligence option for the shared estimate; saved source options take precedence.

  • ai_askstring[]

    Optional ai_ask option for the shared estimate; saved source options take precedence.

    max 20 items

  • ai_researchboolean

    Optional ai_research option for the shared estimate; saved source options take precedence.

  • analyze_reputationboolean

    Optional analyze_reputation option for the shared estimate; saved source options take precedence.

  • analyze_vulnerabilitiesboolean

    Optional analyze_vulnerabilities option for the shared estimate; saved source options take precedence.

  • bulk_idstring

    Optional bulk_id option for the shared estimate; saved source options take precedence.

  • campaign_idstring

    Quote saved campaign options and intent; target_count may override the saved target.

Response200application/json

  • creditsEstimateCredits

    The most the run can cost.

    • flatinteger

      Credits charged once per run.

    • linesEstimateLine[]

      What each credit is for.

    • per_resultinteger

      Credits per delivered lead.

    • totalinteger

      The most the run can cost: flat plus per_result for every lead asked for.

  • etaETA

    How long the run is expected to take.

    • high_secondsinteger

      Longest expected run, in seconds.

    • low_secondsinteger

      Shortest expected run, in seconds.

  • target_countinteger

    Leads the estimate is for.

Errors

400401403404413429500What they mean
curl -X POST "https://app.localicp.com/api/v1/campaigns/estimate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
200Response shape (no example yet)
{
  "credits": {
    "flat": 0,
    "lines": [
      {
        "credits": 0,
        "key": "string",
        "per": "result"
      }
    ],
    "per_result": 0,
    "total": 0
  },
  "eta": {
    "high_seconds": 0,
    "low_seconds": 0
  },
  "target_count": 0
}

Accept a draft for asynchronous extraction. Any non-draft returns conflict. An idempotent replay returns the original accepted response. Poll the campaign for progress and settlement.

Path parameters

  • idstringrequired

    Campaign ID or Google place ID returned by the API.

Headers

  • Idempotency-Keystring

    Optional single header, 1-255 printable ASCII characters. Workspace-owned keys expire after 24 hours. Same canonical JSON body, method, route and campaign ID replay the stored response; different request returns 422 idempotency_key_reused. Live work returns 409 idempotency_in_progress and Retry-After: 1. A 5xx is not stored.

    max 255 characters

Bodyoptional

  • target_countinteger

    Override the saved target before running a draft once. API keys must target 1 through the configured beta cap.

    1 to 500

Response202application/json

Headers: Idempotent-Replayed

  • idstring

    Campaign ID; the {id} in every campaign path.

  • namestring

    The name given at creation, or one derived from the prompt.

  • promptstring

    The plain-language request the campaign was created from.

  • statusstring

    draft, queued, running, cancelling, completed, failed or cancelled; each campaign runs once

    draftqueuedrunningcancellingcompletedfailedcancelled
  • target_countinteger

    Leads asked for.

  • result_countinteger

    Leads delivered so far.

  • qualifierany

    Contact channels a lead must have to be delivered (any or all of them); null when there is no qualifier.

  • fieldsstring[]

    Place-field IDs each result carries; see GET /place-fields.

Errors

400401402403404409413422429500What they mean
curl -X POST "https://app.localicp.com/api/v1/campaigns/CAMPAIGN_ID/run" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: 00000000-0000-4000-8000-000000000000" \
  -H "Content-Type: application/json" \
  -d '{}'
202Example response
{
  "id": "53040d19-ba88-47df-9efa-0051a68e808a",
  "name": "Local OpenAPI verification",
  "prompt": "3 dentists in Iasi Romania",
  "status": "running",
  "target_count": 3,
  "result_count": 0,
  "qualifier": null,
  "fields": [
    "name",
    "phone",
    "website"
  ],
  "progress": {
    "found": 0,
    "evaluated": 0,
    "target": 3
  },
  "shortfall": null,
  "error": null,
  "usage": {
    "held": 0,
    "charged": 0,
    "refunded": 0,
    "state": "none"
  },
  "created_at": "2026-10-10T15:30:24.945617Z",
  "updated_at": "2026-10-10T15:30:25.053426Z",
  "started_at": "2026-10-10T15:30:25.053426Z",
  "completed_at": null,
  "language": {
    "lang": "ro",
    "gl": "ro",
    "source": "inferred"
  },
  "links": {
    "self": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a",
    "results": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a/results",
    "export": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a/export",
    "app": "http://localhost:5173/campaigns/53040d19-ba88-47df-9efa-0051a68e808a"
  }
}

Poll until completed, failed or cancelled. usage reflects the ledger; shortfall explains fewer delivered leads than requested. Conditional GET uses the full DTO including usage.

Path parameters

  • idstringrequired

    Campaign ID or Google place ID returned by the API.

Headers

  • If-None-Matchstring

    Send the prior ETag; a matching representation returns bodyless 304.

Response200application/json

Headers: ETag

  • idstring

    Campaign ID; the {id} in every campaign path.

  • namestring

    The name given at creation, or one derived from the prompt.

  • promptstring

    The plain-language request the campaign was created from.

  • statusstring

    draft, queued, running, cancelling, completed, failed or cancelled; each campaign runs once

    draftqueuedrunningcancellingcompletedfailedcancelled
  • target_countinteger

    Leads asked for.

  • result_countinteger

    Leads delivered so far.

  • qualifierany

    Contact channels a lead must have to be delivered (any or all of them); null when there is no qualifier.

  • fieldsstring[]

    Place-field IDs each result carries; see GET /place-fields.

Errors

401403404429500What they mean
curl "https://app.localicp.com/api/v1/campaigns/CAMPAIGN_ID" \
  -H "Authorization: Bearer YOUR_API_KEY"
200
{
  "id": "53040d19-ba88-47df-9efa-0051a68e808a",
  "name": "Local OpenAPI verification",
  "prompt": "3 dentists in Iasi Romania",
  "status": "completed",
  "target_count": 3,
  "result_count": 3,
  "qualifier": null,
  "fields": [
    "name",
    "phone",
    "website"
  ],
  "progress": null,
  "shortfall": null,
  "error": null,
  "usage": {
    "held": 5,
    "charged": 5,
    "refunded": 0,
    "state": "settled"
  },
  "created_at": "2026-10-10T15:30:24.945617Z",
  "updated_at": "2026-10-10T15:30:42.596173Z",
  "started_at": "2026-10-10T15:30:25.069813Z",
  "completed_at": "2026-10-10T15:30:42.596173Z",
  "language": {
    "lang": "ro",
    "gl": "ro",
    "source": "inferred"
  },
  "links": {
    "self": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a",
    "results": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a/results",
    "export": "/api/v1/campaigns/53040d19-ba88-47df-9efa-0051a68e808a/export",
    "app": "http://localhost:5173/campaigns/53040d19-ba88-47df-9efa-0051a68e808a"
  }
}

Paginated workspace campaigns. Queued and cancelling states are derived from core run flags; filters use the stored core status.

Query parameters

  • pageinteger

    One-based page.

    default: 1 · min 1

  • page_sizeinteger

    Results per page.

    default: 20 · 1 to 100

  • tabstring

    Optional campaign or draft tab; omitted includes both.

    campaignsdrafts
  • statusstring

    Filter by status. `running` includes campaigns that are queued or cancelling; any other value is a 400.

    draftrunningcompletedfailedcancelled
  • qstring

    Search prompt/name; truncated to 200 characters.

  • sortstring

    List ordering.

    newestoldestmost_leadsfewest_leadstop_scorelow_scoreazza

    default: newest

  • locationstring

    Exact City, ST label; at most 200 characters.

    max 200 characters

  • originstring

    Campaign wizard or bulk origin; omitted includes both.

    campaignbulk

Response200application/json

  • dataCampaign[]

    This page's items.

  • has_moreboolean

    true when a later page has items.

  • pageinteger

    Page number, from 1.

  • page_sizeinteger

    Items per page.

  • totalinteger

    Items across all pages.

Errors

400401403429500What they mean
curl "https://app.localicp.com/api/v1/campaigns" \
  -H "Authorization: Bearer YOUR_API_KEY"
200Response shape (no example yet)
{
  "data": [
    {
      "completed_at": "string",
      "created_at": "string",
      "error": {
        "code": "insufficient_credits",
        "message": "string"
      },
      "fields": [
        "string"
      ],
      "id": "string",
      "language": {
        "gl": "string",
        "lang": "string",
        "source": "string"
      },
      "links": {
        "app": "string",
        "export": "string",
        "results": "string",
        "self": "string"
      },
      "name": "string",
      "progress": {
        "evaluated": 0,
        "found": 0,
        "target": 0
      },
      "prompt": "string",
      "qualifier": {},
      "result_count": 0,
      "shortfall": {
        "check_limit": 0,
        "delivered": 0,
        "evaluated": 0,
        "message": "string",
        "rejected_by": {},
        "target": 0
      },
      "started_at": "string",
      "status": "draft",
      "target_count": 0
    }
  ],
  "has_more": true,
  "page": 0,
  "page_size": 0,
  "total": 0
}

Request cancellation and poll for termination. Already cancelling or terminal campaigns return their current state; a draft returns conflict. Partial qualified results are kept and charged, unused hold is refunded. No body is needed; a supplied JSON body is only used for idempotency hashing.

Path parameters

  • idstringrequired

    Campaign ID or Google place ID returned by the API.

Headers

  • Idempotency-Keystring

    Optional single header, 1-255 printable ASCII characters. Workspace-owned keys expire after 24 hours. Same canonical JSON body, method, route and campaign ID replay the stored response; different request returns 422 idempotency_key_reused. Live work returns 409 idempotency_in_progress and Retry-After: 1. A 5xx is not stored.

    max 255 characters

Response202application/json

Headers: Idempotent-Replayed

  • completed_atstring

    When the run finished (UTC); null until it does.

  • created_atstring

    When the draft was created (UTC).

  • errorRunError | null

    Why the run failed; null unless it did.

    • codestring

      Machine-readable reason, such as insufficient_credits, plan_required or run_failed.

      insufficient_creditsplan_requiredrun_failed
    • messagestring

      What went wrong, for a person.

  • fieldsstring[]

    Place-field IDs each result carries; see GET /place-fields.

  • idstring

    Campaign ID; the {id} in every campaign path.

  • languageLanguage

    Google language and country the search runs in.

    • glstring

      Google country code, such as us.

    • langstring

      Google language code, such as en.

    • sourcestring

      chosen (set in the request), inferred (read from the prompt) or default (en, us).

  • linksLinks

    Paths to this campaign, its results and export, and its page in the app.

    • appstring

      The campaign's page in the LocalICP app.

    • exportstring

      Its results as one file.

    • resultsstring

      Its results, page by page.

    • selfstring

      This campaign.

  • namestring

    The name given at creation, or one derived from the prompt.

Errors

400401403404409413422429500What they mean
curl -X POST "https://app.localicp.com/api/v1/campaigns/CAMPAIGN_ID/cancel" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: 00000000-0000-4000-8000-000000000000"
202Response shape (no example yet)
{
  "completed_at": "string",
  "created_at": "string",
  "error": {
    "code": "insufficient_credits",
    "message": "string"
  },
  "fields": [
    "string"
  ],
  "id": "string",
  "language": {
    "gl": "string",
    "lang": "string",
    "source": "string"
  },
  "links": {
    "app": "string",
    "export": "string",
    "results": "string",
    "self": "string"
  },
  "name": "string",
  "progress": {
    "evaluated": 0,
    "found": 0,
    "target": 0
  },
  "prompt": "string",
  "qualifier": {},
  "result_count": 0,
  "shortfall": {
    "check_limit": 0,
    "delivered": 0,
    "evaluated": 0,
    "message": "string",
    "rejected_by": {},
    "target": 0
  },
  "started_at": "string",
  "status": "draft",
  "target_count": 0
}
© 2026 LocalICPDevelopersOpenAPIPrivacyTerms