First-party app
Affinity

Affinity

Manage lists, people, organizations, opportunities, notes, and webhooks in Affinity's relationship-intelligence CRM.

stable Customer Relationship Management

About

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.

App id
io.w6w.affinity
Version
0.1.0
Author
w6w
Licence
MIT
Categories
Customer Relationship Management

Overview

Affinity 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.

Build with Affinity

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.

Create Field Value

field-values-create

Set a value in one cell (field) for a person, organization, or opportunity.

Delete Field Value

field-values-delete

Clear a single cell (field value).

List Field Values

field-values-list

Get the field values (cells) for exactly one person, organization, opportunity, or list entry. Does not include Smart Field values.

Update Field Value

field-values-update

Change the value of an existing field value. Use the field_value_id, not the field_id.

List Fields

fields-list

Get global and/or list-specific fields, optionally filtered by list or type.

Add Entry To List

list-entries-create

Add an existing person or organization to a List as a new entry.

Remove Entry From List

list-entries-delete

Delete a List Entry. If the list holds Opportunities, this deletes the opportunity too.

Get List Entry

list-entries-get

Fetch one entry (row) on a List.

List List Entries

list-entries-list

Get the entries (rows) on a List, paginated.

Create List

lists-create

Create a new List of people, organizations, or opportunities.

Get List

lists-get

Fetch one List's details, including the list-specific fields defined on it.

List Lists

lists-list

Get every List visible to this API key.

Create Note

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.

Delete Note

notes-delete

Delete a note.

Get Note

notes-get

Fetch one note.

List Notes

notes-list

Get notes, optionally filtered by person, organization, opportunity, or creator.

Update Note

notes-update

Update a note's content. Cannot update a note with @ mentions, one created from an email, or a note's type.

Create Opportunity

opportunities-create

Create a new opportunity on an Opportunity-type list.

Delete Opportunity

opportunities-delete

Delete an opportunity and its field values.

Get Opportunity

opportunities-get

Fetch one opportunity.

Search Opportunities

opportunities-search

Search opportunities by name.

Update Opportunity

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.

Create Organization

organizations-create

Create a new organization.

Delete Organization

organizations-delete

Delete an organization and its field values. Cannot delete a global organization.

List Global Organization Fields

organizations-fields-list

Get every global field defined on organizations (not list-specific ones).

Get Organization

organizations-get

Fetch one organization, including its list entries.

Search Organizations

organizations-search

Search organizations by name or domain. Also searches Affinity's global organization database, not just records your team created.

Update Organization

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.

Create Person

persons-create

Create a new person.

Delete Person

persons-delete

Delete a person and their field values.

List Global Person Fields

persons-fields-list

Get every global field defined on people (not list-specific ones).

Get Person

persons-get

Fetch one person, including their list entries.

Search Persons

persons-search

Search people by email, first name, or last name.

Update Person

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.

Create Webhook Subscription

webhooks-create

Subscribe a URL to Affinity events. Leave subscriptions empty to receive every event type. Limit of 3 subscriptions per Affinity instance.

Delete Webhook Subscription

webhooks-delete

Delete a webhook subscription. Only its creator or an admin can delete it.

Get Webhook Subscription

webhooks-get

Fetch one webhook subscription.

List Webhook Subscriptions

webhooks-list

Get every webhook subscription on this Affinity instance. Limit of 3 per instance.

Update Webhook Subscription

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>"
      }
    }
  ]
}

Here are some of the things you can do

  • Create Field Value

    perform
    field-values-create
  • List Field Values

    read
    field-values-list
  • Update Field Value

    perform
    field-values-update
  • List Fields

    read
    fields-list
  • Add Entry To List

    perform
    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.

Install
npm install @w6w/sdk
yarn add @w6w/sdk
pnpm add @w6w/sdk
deno add npm:@w6w/sdk
Code
import { 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);
Install the CLI
npm install -g @w6w/cli
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.

What the agent gets

Credentials it can't read

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.

A tool surface scoped to the caller

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.

A durable workflow in one call

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.

Health-aware discovery

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).

Request MCP access

Health checks

Affinity declares its own checks, so its health is a property of the app rather than something the host guesses at.

service

Affinity platform status

Component status from status.affinity.co: CRM, External API v1/v2, API Documentation, email/calendar processing, data enrichment, and the mobile/extension clients.

quota

Rate limit headroom

Per-minute (user) and per-month (org) API call budgets, read from GET /rate-limit — itself exempt from the monthly limit it reports.