Skip to main content

Overview

The Sourcing API exposes InstaView’s AI-driven candidate sourcing pipeline as a fully programmable, asynchronous REST interface. You can initiate sourcing runs, refine criteria mid-session, enrich shortlisted profiles for contact discovery, and embed beautifully styled candidate cards directly into your ATS or internal dashboards. All sourcing operations are asynchronous — requests return immediately with a requestId, and results are delivered either via webhooks or polled through a results endpoint.

Asynchronous Request-Response Pattern

Required Scopes

Execution Pipeline

When a sourcing run is initiated, the sourcing agent executes a fully automated pipeline — no clarifying questions, no interactive steps:
1

ICP Generation

The agent derives a complete Ideal Candidate Profile (ICP) from your title, jobDescription, location, and optional query. Skill expansion, title synonyms, location variants, and negative keywords are all populated automatically.
2

Query Compilation

A tailored search query is compiled against InstaView’s sourcing index. Skill expansions and localized terms maximize recall.
3

Candidate Search

The search is executed against external platform indices. A strict 15-second timeout with 2 automatic retries applies — if the external index is unavailable, a circuit-breaker failover triggers immediately and a sourcing.failed webhook is dispatched.
4

Enrichment & Matching

Profiles are enriched sequentially. Failed individual profiles are isolated and marked unbilled — the batch continues with the remaining candidates.
5

Webhook / Polling Delivery

The completed, ranked candidate list is delivered to your webhook endpoint or made available via GET /sourcing/{id}/results.

Initiating a Sourcing Run

Response (202 Accepted)

Polling for Results

If you do not use webhooks, poll GET /sourcing/{requestId}/results until status transitions from "processing" to "completed" or "failed".
Avoid polling more frequently than once every 5 seconds. Excessive polling can trigger the GET /sourcing/*/results rate limit (120 requests/minute per API key).

Refining a Sourcing Session

After a run completes, use PATCH /sourcing/{requestId} to refine criteria or request additional candidates from the same session context. At least one of query or limit must be provided.
A PATCH request is only accepted after the current run transitions to "completed" or "failed". If a run is still "processing", the request returns 409 Conflict.
The agent applies the updated query as a context patch and then evaluates limit additional profiles — all in a single asynchronous pass.

Enriching Candidates

Enrichment performs deep profile analysis including email discovery. It is fully asynchronous: submit profile IDs, receive a requestId, and poll GET /sourcing/enrich/{requestId}/results or await the enrich.completed webhook.

Response (202 Accepted)

Each successfully enriched profile consumes 1 credit. Profiles that fail to enrich are not billed. For prepaid accounts, your balance must cover the full batch size upfront.

Enrichment Resilience

Individual profile failures within a batch are isolated: if one profile fails to enrich, the system marks it as failed, skips billing for it, and continues processing the rest of the batch.

Rendering HTML Candidate Cards

Generate self-contained, embeddable HTML profile cards for your ATS or dashboards. This endpoint is synchronous — it returns immediately with rendered cards.
Supported themes: "dark" (default) and "light".

Webhook Events

Configure a WebhookConfig and pass its id as webhookId when initiating runs. The webhook must subscribe to at least one of the relevant event types.

Sourcing Events

Enrichment Events

A webhook config that subscribes to a mix of event types (e.g. ["ANALYSIS_COMPLETED", "SOURCING_COMPLETED", "ENRICH_COMPLETED"]) is fully valid — all subscriptions are honored independently.

Billing & Credits

  • Sourcing: 1 credit per successfully sourced and matched candidate, billed based on the limit parameter.
  • Enrichment: 1 credit per successfully enriched profile (failed profiles are not billed).
  • Prepaid accounts: balance must cover the full limit before a run starts. Insufficient funds → 402 Payment Required.
  • Postpaid accounts: run immediately regardless of balance; invoiced at end of the billing cycle.

Multi-Tenant Security

All sourcing resources (requestIds, candidate lists, enrichment results) are strictly bound to the companyId associated with the authenticating API key:
  • An API key from Company A cannot access, patch, or enrich resources belonging to Company B.
  • Attempting to access another company’s requestId returns 404 REQUEST_NOT_FOUND — not 403 — to prevent resource enumeration.
  • A webhookId submitted with a sourcing run must belong to the same company as the API key; mismatched ownership returns 403 WEBHOOK_COMPANY_MISMATCH.

Rate Limits

Error Codes