> ## Documentation Index
> Fetch the complete documentation index at: https://lava.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Affinity

> Relationship-intelligence CRM API for reading and updating lists, organizations, persons, and opportunities that a team tracks in Affinity.

Relationship-intelligence CRM API for reading and updating lists, organizations, persons, and opportunities that a team tracks in Affinity. Use when an agent needs to pull deal pipelines, account data, field values, or interaction history from a team's Affinity workspace. Unlike enrichment APIs (Apollo, People Data Labs), Affinity returns data the customer has already curated — their own pipeline state, not public records.

12 example endpoints available through Lava's AI Gateway. See the [Affinity API docs](https://api-docs.affinity.co/) for full documentation.

<Warning>This provider requires your own credentials — connect your API key or OAuth account before use.</Warning>

<Info>This is a **catch-all provider** — any valid URL under `https://api.affinity.co` is supported. Any Affinity v1 API endpoint. Construct URL as [https://api.affinity.co/\&#123;path\&#125](https://api.affinity.co/\&#123;path\&#125);. Common roots: lists, list-entries, persons, organizations, opportunities, fields, field-values, field-value-changes, notes, interactions. See [https://api-docs.affinity.co/](https://api-docs.affinity.co/) for full reference. The endpoints below are curated examples.</Info>

## Endpoints

### List all lists in the Affinity workspace

**GET** `https://api.affinity.co/lists` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/lists', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Flists" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Get entries in a specific list (paginated)

**GET** `https://api.affinity.co/lists/{list_id}/list-entries` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/lists/{list_id}/list-entries', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Flists%2F%7Blist_id%7D%2Flist-entries" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Search organizations by name or domain

**GET** `https://api.affinity.co/organizations?term=acme` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/organizations?term=acme', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Forganizations%3Fterm%3Dacme" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Retrieve a single organization by id

**GET** `https://api.affinity.co/organizations/{organization_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/organizations/{organization_id}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Forganizations%2F%7Borganization_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Search persons by name or email

**GET** `https://api.affinity.co/persons?term=jane` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/persons?term=jane', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Fpersons%3Fterm%3Djane" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Retrieve a single person by id

**GET** `https://api.affinity.co/persons/{person_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/persons/{person_id}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Fpersons%2F%7Bperson_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Search opportunities (deals)

**GET** `https://api.affinity.co/opportunities?term=series+a` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/opportunities?term=series+a', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Fopportunities%3Fterm%3Dseries%2Ba" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### List fields, optionally scoped to a list

**GET** `https://api.affinity.co/fields?list_id={list_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/fields?list_id={list_id}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Ffields%3Flist_id%3D%7Blist_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Get field values for a person, organization, opportunity, or list entry

**GET** `https://api.affinity.co/field-values?person_id={person_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/field-values?person_id={person_id}', { method: 'GET' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Ffield-values%3Fperson_id%3D%7Bperson_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY"
    ```
  </Tab>
</Tabs>

### Create a note attached to persons, organizations, or opportunities

**POST** `https://api.affinity.co/notes` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/notes', {
      body: {
    "person_ids": [
      12345
    ],
    "content": "Kicked off intro call — follow up next week."
    },
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X POST "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Fnotes" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"person_ids":[12345],"content":"Kicked off intro call — follow up next week."}'
    ```
  </Tab>
</Tabs>

### Update an existing field value by id

**PUT** `https://api.affinity.co/field-values/{field_value_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/field-values/{field_value_id}', { method: 'PUT', body: {"value":"Series A"} });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X PUT "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Ffield-values%2F%7Bfield_value_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json" \
      -d '{"value":"Series A"}'
    ```
  </Tab>
</Tabs>

### Delete a note by id

**DELETE** `https://api.affinity.co/notes/{note_id}` — Free

<Tabs>
  <Tab title="SDK">
    ```typescript theme={null}
    const data = await lava.gateway('https://api.affinity.co/notes/{note_id}', { method: 'DELETE' });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://api.lava.so/v1/forward?u=https%3A%2F%2Fapi.affinity.co%2Fnotes%2F%7Bnote_id%7D" \
      -H "Authorization: Bearer $LAVA_SECRET_KEY" \
      -H "Content-Type: application/json"
    ```
  </Tab>
</Tabs>

## Next Steps

<CardGroup cols={2}>
  <Card title="All Providers" icon="grid" href="/gateway/supported-providers">
    Browse all supported AI providers
  </Card>

  <Card title="Forward Proxy" icon="route" href="/gateway/forward-proxy">
    Learn how to construct proxy URLs and authenticate requests
  </Card>
</CardGroup>
