Manage lists, people, organizations, opportunities, notes, and webhooks in Affinity's relationship-intelligence CRM.
Affinity ships in the w6w first-party pack. It declares 39 actions, 2 health checks, and the host runs its code in a sandbox that never sees the credential.
io.w6w.affinityAffinity is a relationship-intelligence CRM built around three top-level objects — Persons, Organizations, and Opportunities — plus the Lists (spreadsheet-like views) and Fields (columns) that organize them. This app covers that core: read and search all three entity types, manage list membership through List Entries, read and write custom Field Values (including the Ranked Dropdown fields Affinity uses for pipeline stages), and attach Notes to any entity.
It also covers the automation surface a workflow needs: Webhook subscriptions so a workflow can react to Affinity events instead of polling, and health checks against Affinity’s own status page and its per-minute/per-month rate limit accounting.
Affinity documents two ways to present the same API key — HTTP Basic (key as password, no username) or a Bearer token — for one API generation (v1); this app uses the Bearer form. It does not cover Interactions, Reminders, Entity Files, or Field Value Changes, all of which are documented by the vendor but left for a follow-up.
Three routes to the same 39 actions. The Workflow tab is generated from Affinity's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.
field-values-create Set a value in one cell (field) for a person, organization, or opportunity.
field-values-list Get the field values (cells) for exactly one person, organization, opportunity, or list entry. Does not include Smart Field values.
field-values-update Change the value of an existing field value. Use the field_value_id, not the field_id.
fields-list Get global and/or list-specific fields, optionally filtered by list or type.
list-entries-create Add an existing person or organization to a List as a new entry.
list-entries-delete Delete a List Entry. If the list holds Opportunities, this deletes the opportunity too.
notes-create Create a note attached to a person, organization, or opportunity — or a reply to an existing note (parent_id). At least one of person/organization/opportunity/parent must be set.
notes-list Get notes, optionally filtered by person, organization, opportunity, or creator.
notes-update Update a note's content. Cannot update a note with @ mentions, one created from an email, or a note's type.
opportunities-update Update an opportunity. To add a person or organization, resend the existing IDs too — this replaces the list rather than merging into it.
organizations-delete Delete an organization and its field values. Cannot delete a global organization.
organizations-fields-list Get every global field defined on organizations (not list-specific ones).
organizations-search Search organizations by name or domain. Also searches Affinity's global organization database, not just records your team created.
organizations-update Update an organization. To add a person, resend the existing person_ids too — this replaces the list rather than merging into it. A global organization's name/domain cannot be changed.
persons-fields-list Get every global field defined on people (not list-specific ones).
persons-update Update a person. To add an email or organization, resend the existing ones too — this replaces the list rather than merging into it.
webhooks-create Subscribe a URL to Affinity events. Leave subscriptions empty to receive every event type. Limit of 3 subscriptions per Affinity instance.
webhooks-delete Delete a webhook subscription. Only its creator or an admin can delete it.
webhooks-list Get every webhook subscription on this Affinity instance. Limit of 3 per instance.
webhooks-update Update a webhook subscription's URL, event types, or enabled state. Only the creator of a subscription can update it.
A workflow step names the app and the action, and the editor fills in the
connection when you pick one. This is the Step shape from the
workflow spec, carrying Affinity's real ids.
{
"manifestVersion": "2",
"name": "affinity-example",
"steps": [
{
"id": "field-values-create",
"uses": {
"app": "io.w6w.affinity",
"action": "field-values-create",
"connection": "conn_YOUR_CONNECTION_ID"
},
"with": {
"fieldId": "<fieldId>",
"entityId": "<entityId>",
"value": "<value>"
}
}
]
}field-values-create field-values-list field-values-update fields-list list-entries-create +34 more actions available
Every app-specific value here is a blank you have to fill in. An
app action is reached through the connection that authenticates it, so the
address is a connection id, not the app id — and connections belong to your account,
so a public page cannot know yours. Create one for Affinity, then fill in
the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the
parameters that action declares. The call itself is real — the shape is transcribed
from the studio's own snippet builder, which prints the same kind of blanks — but
nothing in it is specific to Affinity. The Workflow tab is where this app's
real ids are.
npm install @w6w/sdkyarn add @w6w/sdkpnpm add @w6w/sdkdeno add npm:@w6w/sdkimport { W6wClient, isActionRun } from "@w6w/sdk";
// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();
const envelope = await client.run({
urn: "conn_YOUR_CONNECTION_ID",
action: "field-values-create",
payload: {
fieldId: "<value>",
entityId: "<value>",
value: "<value>",
// listEntryId: "<value>",
},
});
if (isActionRun(envelope)) console.log(envelope.value); npm install -g @w6w/cli w6w run conn_YOUR_CONNECTION_ID --action field-values-create --payload '{"fieldId":"<value>","entityId":"<value>","value":"<value>"}' Give an AI agent Affinity — without giving it Affinity's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.
One tool call{
"name": "w6w_invoke",
"arguments": {
"ref": "app:io.w6w.affinity#field-values-create",
"input": {
"fieldId": "<fieldId>",
"entityId": "<entityId>",
"value": "<value>"
}
}
}
Every tool names its target with a single ref. The
app: form above doesn't name a connection at all — the
host resolves which of the caller's Affinity connections to sign
with, and refuses rather than guesses when the answer is ambiguous.
The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.
Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.
Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.
Affinity's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.
The MCP surface is part of the hosted platform. Affinity itself is MIT, and the runtime that executes it is source-available (FSL).
Affinity declares its own checks, so its health is a property of the app rather than something the host guesses at.
Component status from status.affinity.co: CRM, External API v1/v2, API Documentation, email/calendar processing, data enrichment, and the mobile/extension clients.
Per-minute (user) and per-month (org) API call budgets, read from GET /rate-limit — itself exempt from the monthly limit it reports.