InTouch Hub · Blue Isle Software

Affinity

Sync relationships, organizations, and deal lists in Affinity CRM via its REST API.

Provided free and as is, without warranty of any kind — including merchantability, fitness for a particular purpose, and the accuracy or completeness of any result. See the licence. You are responsible for checking what this produces before relying on it.

crmcrm-salesemailrelationshipssalessearchstatussyncvalidation

Affinity

Sync relationships, organizations, and deal lists in Affinity CRM via its V1 REST API.

This tool is a thin, deterministic wrapper over the Affinity V1 API (https://api.affinity.co). It reads lists and searches people and organizations, and writes new people, organizations, and lists. Responses are returned verbatim as the raw JSON body plus the HTTP status code, so jobs can parse or branch on them.

Operations

operation method + path type required params
list_lists GET /lists read
search_persons GET /persons?term=... read term
search_organizations GET /organizations?term=... read term
create_person POST /persons write firstName, lastName
create_organization POST /organizations write name
create_list POST /lists write name, listType

For search_persons, term may be an email address, first name, or last name. For search_organizations, term may be an organization name or a domain.

For create_list, listType is the Affinity list entity type code: 0 = person, 1 = organization, 8 = opportunity. Set isPublic to true to make the list visible to the whole team (default is private).

apiKey setup

  1. Sign in to Affinity and open Settings > API.
  2. Generate an API key.
  3. Pass it as the apiKey input.

Affinity authenticates with HTTP Basic auth: the API key is sent as the basic-auth password with an empty username (Authorization: Basic base64(":" + apiKey)). This tool handles that encoding for you — you only supply the raw key.

Outputs

On a transport-level failure the tool prints {"error": "..."} and exits non-zero so the job step is marked FAILED. Non-2xx HTTP responses (e.g. 401 unauthorized, 422 validation) are returned as result + status so the caller can inspect them.

Examples

List all accessible lists:

{ "apiKey": "AFFINITY_KEY", "operation": "list_lists" }

Search people by email or name:

{ "apiKey": "AFFINITY_KEY", "operation": "search_persons", "term": "[email protected]" }

Search organizations by name or domain:

{ "apiKey": "AFFINITY_KEY", "operation": "search_organizations", "term": "acme.com" }

Create a person:

{
  "apiKey": "AFFINITY_KEY",
  "operation": "create_person",
  "firstName": "Jane",
  "lastName": "Doe",
  "email": "[email protected]"
}

Create an organization:

{
  "apiKey": "AFFINITY_KEY",
  "operation": "create_organization",
  "name": "Acme Inc",
  "domain": "acme.com"
}

Create an organization list:

{
  "apiKey": "AFFINITY_KEY",
  "operation": "create_list",
  "name": "Q3 Pipeline",
  "listType": "1",
  "isPublic": "true"
}

Publishes

The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.

Input Properties

Every property this tool accepts, from its own tool.iml.

Property Type Required Default Description
apiKey string yes DEPRECATED — bind an API Key credential to the task with credentialName instead. A key pasted here is stored in the workflow definition in clear and appears in every export of it. Still honoured for workflows built before the change.
operation string yes One of: list_lists, search_persons, search_organizations, create_person, create_organization, create_list
term string no Search string. For search_persons: an email, first name, or last name. For search_organizations: an organization name or domain. Required for those operations; ignored otherwise.
firstName string no First name for create_person. Required (with lastName) when creating a person.
lastName string no Last name for create_person. Required (with firstName) when creating a person.
email string no Email address attached to the new person on create_person. Optional; if empty an empty emails array is sent.
name string no For create_organization this is the organization name (required). For create_list this is the list name (required). Ignored by read operations.
domain string no Website domain for create_organization (e.g. acme.com). Optional.
listType string no For create_list: list entity type as an integer — 0=person, 1=organization, 8=opportunity. Required for create_list.
isPublic string no For create_list: 'true' to make the list visible to the whole team, 'false' (default) for private. Optional.