Membership
The state of one account or person in one campaign: review state, fit values and custom field values.
A membership is the state of one account or one person in one campaign. It holds the review state, the fit values, the custom field values and the comments of the record in that campaign. Membership is a relation, not a separate resource. The membership object appears on an account or a person in a campaign context. The membership operations add records to a campaign, set their review state and remove them. To move a V1 integration, read Migrate from V1.
The membership object
| Field | Type | Description |
|---|---|---|
campaign_id | UUID | Required. ID of the campaign. |
review_state | enum | Required. Review state in this campaign: new, reviewed or passed. |
fit | object | The criteria_* values of the record in this campaign, keyed by field name. |
fields | object | The values of the campaign custom fields, keyed by field name. Read Fields. |
comments | string | Nullable. User comments on the record in this campaign. |
added_at | timestamp | Required. Time when the record joined the campaign. |
An account or a person has a non-null membership in these responses:
search_accountsandsearch_peoplewith thecampaign_idfilter.- Every membership operation that returns records.
get_account and get_person take no campaign, so membership is null.
Review states
review_state has three values. A record joins a campaign with new. set_account_review_state and set_person_review_state set any of the three values.
| Value | Meaning |
|---|---|
new | The record joined the campaign, and no user reviewed it. |
reviewed | A user examined the record. |
passed | A user approved the record as a qualified target. |
- The review state applies in one campaign only. The same record can be
newin one campaign andpassedin another. search_accountsandsearch_peoplefilter onreview_statetogether withcampaign_id.start_exportcan export only the records in one review state.counts.by_review_stateon the campaign gives the number of records in each state.
Rules
- An add request or a review state request takes 1 to 100 IDs in
ids. - An unknown ID, or an ID of another organization, gives 404. The request then changes nothing.
- An account of another account type, or a person for a campaign without
person, gives 422 with the codeinvalid_entity_type. - The response lists the records in request order, each with its membership. A merged ID gives the surviving record.
Add
Each record joins the campaign with the review state new. A record that is already in the campaign does not change. added_ids lists the records that joined with this request. When add_people_to_campaign adds a person whose account is not in the campaign, the account joins too. added_account_ids lists these accounts.
An add starts no research. The new membership has empty fit and fields values.
Set the review state
Each record must be in the campaign, else the request gives 404. The change applies only in this campaign. The same records in other campaigns do not change. The people of an account, the account of a person and the contacted state do not change.
Remove
The record leaves the campaign with its review state, fit values, custom field values and comments in that campaign. The record stays in its other campaigns. When the campaign is the last campaign of the record, the record keeps its ID. get_account and get_person return it with an empty campaign_ids, and the add operations can add it to a campaign again. Search results do not show it. A later import can reuse the ID when the resolved record matches the identity rule. See Import identity. When you remove an account, its people stay in the campaign. When you remove a person, the contacted state does not change.
Duplicates in one campaign
A record can have several membership copies in one campaign, for example after another import. The response shows the oldest copy. Campaign counts include every copy. Review-state updates and removal change every copy of that record in the campaign.
Operations
Each path below follows $LINKT_API_URL/v2. Set LINKT_API_URL to the origin only, for example https://api.signal.linkt.ai.
| Operation | Method and path | Purpose |
|---|---|---|
add_accounts_to_campaign | POST /campaigns/{campaign_id}/accounts | Add accounts to a campaign. |
set_account_review_state | PATCH /campaigns/{campaign_id}/accounts | Set the review state of accounts in a campaign. |
remove_account_from_campaign | DELETE /campaigns/{campaign_id}/accounts/{account_id} | Remove an account from a campaign. Returns 204. |
add_people_to_campaign | POST /campaigns/{campaign_id}/people | Add people to a campaign. Their accounts join too. |
set_person_review_state | PATCH /campaigns/{campaign_id}/people | Set the review state of people in a campaign. |
remove_person_from_campaign | DELETE /campaigns/{campaign_id}/people/{person_id} | Remove a person from a campaign. Returns 204. |
The add operations return data and added_ids. add_people_to_campaign also returns added_account_ids. The review state operations return data only:
curl --fail-with-body --request POST "$LINKT_API_URL/v2/campaigns/$CAMPAIGN_ID/accounts" \
--header "x-api-key: $LINKT_API_KEY" \
--header "Content-Type: application/json" \
--data "$(jq -cn --arg ACCOUNT_ID "$ACCOUNT_ID" '{"ids":["0190a4e2-0000-7000-8000-000000000002"]} | walk(if . == "0190a4e2-0000-7000-8000-000000000002" then $ACCOUNT_ID else . end)')"curl --fail-with-body --request PATCH "$LINKT_API_URL/v2/campaigns/$CAMPAIGN_ID/accounts" \
--header "x-api-key: $LINKT_API_KEY" \
--header "Content-Type: application/json" \
--data "$(jq -cn --arg ACCOUNT_ID "$ACCOUNT_ID" '{"ids":["0190a4e2-0000-7000-8000-000000000002"],"review_state":"reviewed"} | walk(if . == "0190a4e2-0000-7000-8000-000000000002" then $ACCOUNT_ID else . end)')"