Remove Target List Companies
Remove up to 100 companies from 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: removed, not_in_list or not_found. Removing a company that is not on the list changes nothing, so a sync can retry safely. A removed company's stage history and assignees on this list go with it, as when it is removed in the app.
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, or an unknown field. Nothing is removed on any of them.
curl -X POST "https://api.handshaik.com/v1/target-lists/3fa85f64-5717-4562-b3fc-2c963f66afa6/companies/remove" \
-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 remove, by the
idthatGET /v1/companies/searchandGET /v1/target-lists/{target_list_id}/companiesreturncompany_numbersstring[] | nullCompanies to remove, by Companies House registration number, matched exactly as Companies House writes it, e.g.
00445790orSC123456
Response
Successful Response
resultsTargetListCompanyRemoveResultPublic[]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": "removed"
}
]
}