Add Target List Companies
Add up to 100 companies to a target list, by id or by registration number.
Requires the target_lists:write scope. With an API client's token, works on lists created by an API client and on lists shared with your organisation at write. With a user's token, the user needs editor access, as in Handshaik.
Every identifier sent gets a result, in the order sent: added, already_in_list or not_found. Adding a company that is already on the list changes nothing, so a sync can retry safely. Companies are recorded as added by your API client or the signed-in user; list members are told about API adds in an hourly digest, not one notification per call.
Your plan may cap how many different companies your organisation keeps across all its target lists. A request that would go over it is rejected whole, with the number of companies that can still be added; companies already on any of your lists don't count.
Errors: 403 missing target_lists:write, or a user with only viewer access ยท 404 the list does not exist, belongs to another organisation, or is hidden from the caller or, for an API client, not open to API edits (indistinguishable) ยท 422 fewer than 1 or more than 100 identifiers, an unknown field, or the add would exceed your plan's company cap. Nothing is written on any of them.
curl -X POST "https://api.handshaik.com/v1/target-lists/3fa85f64-5717-4562-b3fc-2c963f66afa6/companies" \
-H "Authorization: Bearer $HANDSHAIK_PUBLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"company_ids": [
"00000000-0000-4000-8000-000000000000"
],
"company_numbers": [
"00000000"
]
}'Authorization
AuthorizationstringheaderrequiredOAuth2 client_credentials (M2M). Request a token with the
audienceset tohttps://api.handshaik.com.Handshaik's own first-party apps, such as the Chrome extension, instead sign a Handshaik user in with the authorization code flow and PKCE, with the same
audience. Such a token acts as that user, within their organisation. Partner integrations use client_credentials.
Parameters
target_list_idstring<uuid>pathrequiredThe target list's
id, as returned byGET /v1/target-lists
Body
company_idsstring[] | nullCompanies to add, by the
idthatGET /v1/companies/searchandGET /v1/companies/{company_id}returncompany_numbersstring[] | nullCompanies to add, by Companies House registration number, matched exactly as Companies House writes it, e.g.
00445790orSC123456
Response
Successful Response
resultsTargetListCompanyAddResultPublic[]requiredOne result per identifier sent, in the order sent:
company_idsfirst, thencompany_numbers. A company named twice has a result each time
{
"results": [
{
"company_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"company_number": "string",
"status": "added"
}
]
}