Discovery
Start discovery now or configure recurring discovery for a campaign.
Discovery finds new accounts and their people for the campaign. There are two ways to start it:
- Start one run now with
start_discovery. Read Runs. - Set a schedule with
update_campaignanddiscovery.frequency.
| Field | Type | Description |
|---|---|---|
frequency | enum | Nullable. daily, weekly or monthly. Null when the discovery has no schedule. |
count | integer | Number of accounts that one scheduled run looks for. Minimum 1. Default 25. |
contacts_per_account | integer | Number of people that a run looks for at each account. Minimum 1. Default 1. |
status | enum | active or paused. A paused schedule starts no run. A discovery with no schedule reads paused. |
next_run_at | timestamp | Nullable. Time of the next scheduled run. Null when no schedule exists or the schedule is paused. |
discoveryis null until the first discovery write:start_discovery, orupdate_campaignwithdiscovery.- The first
frequencyvalue creates the schedule. The schedule time is the time of the request in UTC. - A change to
countorstatusneeds a schedule. Sendfrequencytoo when the discovery has no schedule. update_campaignstarts no run. Usestart_discoveryto start a run now.- Every
update_campaignneedscampaign.write. Changingfrequency,countorstatusalso needsschedule.write. Enabling the schedule or changing its spend while active needsrun.write.contacts_per_accountalone needs no schedule permission. See Permissions. countandcontacts_per_accountonstart_discoveryapply to that run only. Useupdate_campaignwithdiscoveryto change saved settings.- A discovery run uses credits. A scheduled run that cannot start for lack of credits gets the status
skipped.
Start one run
Send start_discovery with campaign_id, count and contacts_per_account. count is 1 to 1,000; omit it to use the stored campaign count (25 by default). contacts_per_account is at least 1; omit it to use the saved campaign value. Both overrides apply only to this run. They leave the saved targets, settings and schedule unchanged, including when the start fails. The request has no criteria override parameter. Change saved criteria through update_campaign. A concurrent change to discovery setup gives 409. See Retry safely.
curl --fail-with-body --request POST "$LINKT_API_URL/v2/runs/discovery" \
--header "x-api-key: $LINKT_API_KEY" \
--header "Content-Type: application/json" \
--data "$(jq -cn --arg CAMPAIGN_ID "$CAMPAIGN_ID" '{"campaign_id":"0190a4e2-0000-7000-8000-000000000001","contacts_per_account":2,"count":10} | walk(if . == "0190a4e2-0000-7000-8000-000000000001" then $CAMPAIGN_ID else . end)')"Schedules
discovery: null means no discovery settings. A non-null discovery with frequency: null and status: paused has settings but no schedule. A non-null frequency and status: paused means an existing schedule is paused. The API cannot remove a schedule; pause it.
A monthly schedule made on day 29, 30 or 31 skips months without that day. Read next_run_at for the real time.
curl --fail-with-body --request PATCH "$LINKT_API_URL/v2/campaigns/$CAMPAIGN_ID" \
--header "x-api-key: $LINKT_API_KEY" \
--header "Content-Type: application/json" \
--data '{"discovery":{"count":3,"frequency":"weekly","status":"active"}}'curl --fail-with-body --request PATCH "$LINKT_API_URL/v2/campaigns/$CAMPAIGN_ID" \
--header "x-api-key: $LINKT_API_KEY" \
--header "Content-Type: application/json" \
--data '{"discovery":{"frequency":"weekly","status":"paused"}}'Results
result.completed counts accounts added by the run. It excludes people. result.discarded counts rejected candidates. A candidate can be rejected when it fails the campaign criteria or is already in the campaign. The result has no per-candidate reason or list of added IDs. See Run progress.