Add People Target List Member
Add a person to a people target list.
The same request, response and rules as POST /v1/target-lists/{target_list_id}/members. Requires the people_target_lists:share scope; people_target_lists:write alone is not enough. With an API client's token, only a list created by an API client can have its members changed; a list created in the Handshaik app returns 404, even one shared with the organisation at write. With a user's token, the user needs owner access, as in Handshaik.
access is owner, editor or viewer. A list has exactly one owner, so adding someone as owner hands ownership to them and the previous owner becomes an editor. The person is notified in Handshaik if they have people target list notifications switched on, as when a user shares the list.
Errors: 403 missing people_target_lists:share, or a user below owner ยท 404 the list does not exist, belongs to another organisation, or is hidden from the caller (indistinguishable) ยท 409 the person is already a member; the detail names their member_id, so change their access with PATCH .../members/{member_id} ยท 422 email is not an active user in your organisation (the detail names only that email), or the body is invalid. Nothing is written on any of them.
curl -X POST "https://api.handshaik.com/v1/people-target-lists/3fa85f64-5717-4562-b3fc-2c963f66afa6/members" \
-H "Authorization: Bearer $HANDSHAIK_PUBLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"access": "viewer"
}'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
people_target_list_idstring<uuid>pathrequiredThe people target list's
id, as returned byGET /v1/people-target-lists
Body
emailstringrequiredEmail of an active user in your organisation, matched case-insensitively
accessenum<string>requiredowneradministers the list,editorcan change its companies, andviewercan only read it. A list has exactly one owner: settingownerhands ownership to this person, and the previous owner becomes an editorOne of:ownereditorviewer
Response
Successful Response
member_idstring<uuid>requiredIdentifies this person's access to this list
emailstringrequiredThe member's email address
namestringrequiredThe member's full name
accessenum<string>requiredowneradministers the list,editorcan change its companies or people, andviewercan only read itOne of:ownereditorviewer
{
"member_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"email": "string",
"name": "string",
"access": "owner"
}