Integrations / Affinity
Affinity
Relationship CRM (API v2): lists, list entries, persons and companies with search.
6 actions
API key
6 read0 write
Calls api.affinity.co
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "affinity" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();Permissions requested
This toolkit uses a single credential and requests no scopes.
Actions
List companiesreadaffinity.list_companiesList companies in the Affinity directory (needs the Export All Organizations directory permission).
| Input | Type | Description | |
|---|---|---|---|
cursor | string | Optional | Cursor from pagination.nextUrl for the next page |
limit | integer | Optional | Items per page, 1 to 100 (default 100) |
await setu.execute({
userId: "user_1",
action: "affinity.list_companies",
input: {},
});List list entriesreadaffinity.list_list_entriesList the entries (people, companies or opportunities) on one list; add field ids to include their field values.
| Input | Type | Description | |
|---|---|---|---|
list_id | integer | Required | List id |
field_id | string | Optional | One field id whose values to include, e.g. field-1234 |
cursor | string | Optional | Cursor from pagination.nextUrl for the next page |
limit | integer | Optional | Items per page, 1 to 100 (default 100) |
await setu.execute({
userId: "user_1",
action: "affinity.list_list_entries",
input: {
"list_id": 1
},
});List listsreadaffinity.list_listsList the Affinity lists (person, company and opportunity lists) with their ids and types.
| Input | Type | Description | |
|---|---|---|---|
term | string | Optional | Case-insensitive substring of the list name |
cursor | string | Optional | Cursor from pagination.nextUrl for the next page |
limit | integer | Optional | Items per page, 1 to 100 (default 100) |
await setu.execute({
userId: "user_1",
action: "affinity.list_lists",
input: {},
});List personsreadaffinity.list_personsList people in the Affinity directory (needs the Export All People directory permission).
| Input | Type | Description | |
|---|---|---|---|
cursor | string | Optional | Cursor from pagination.nextUrl for the next page |
limit | integer | Optional | Items per page, 1 to 100 (default 100) |
await setu.execute({
userId: "user_1",
action: "affinity.list_persons",
input: {},
});Search companiesreadaffinity.search_companiesSearch companies by name or primary domain (term of at least 3 characters). Beta endpoint.
| Input | Type | Description | |
|---|---|---|---|
term | string | Required | Search term, minimum 3 characters |
cursor | string | Optional | Cursor from pagination.nextUrl for the next page |
limit | integer | Optional | Items per page, 1 to 100 (default 100) |
await setu.execute({
userId: "user_1",
action: "affinity.search_companies",
input: {
"term": "<term>"
},
});Search personsreadaffinity.search_personsSearch people by name or primary email (term of at least 3 characters). Beta endpoint.
| Input | Type | Description | |
|---|---|---|---|
term | string | Required | Search term, minimum 3 characters |
cursor | string | Optional | Cursor from pagination.nextUrl for the next page |
limit | integer | Optional | Items per page, 1 to 100 (default 100) |
await setu.execute({
userId: "user_1",
action: "affinity.search_persons",
input: {
"term": "<term>"
},
});