Affinity API v2 (2.0.0)

Download OpenAPI specification:Download

Introduction

Welcome to Affinity API v2! This API provides a RESTful interface for building internal apps, automated workflows, and other integrations on top of the core data models in Affinity, and for connecting Affinity to the rest of your tech and data stack.

Please note that this new version of the API is not at feature parity with Affinity API v1. We will add to this new version to cover more of v1's functionality over time. This API version is also only available on select Affinity license types. See this Help Center article or contact your Customer Success Manager for more information.

Getting Started

All Affinity API endpoints use the base URL https://api.affinity.co. All v2 endpoint paths start with /v2. Requests must be sent over HTTPS.

Using These Docs

The first few sections of these docs cover general information on the API. Each subsequent section covers a set of API endpoints.

Each endpoint is documented with its accepted request parameters, expected response shapes, and a sample request and response. Please note that the shape of a given response can vary depending on what "type" of object or data is being returned. When this is the case, the response documentation will include a dropdown that can be used to select the "type" for which to display the response shape.

Authentication

Affinity API v2 uses API keys and bearer authentication (this is an important difference from Affinity API v1's use of basic authentication).

To generate an API key, navigate to the Settings page in the Affinity web app. You will need the "Generate an API key" role-based permission controlled by your Affinity admin to be able to do this. See this Help Center article for full instructions on API key generation, and this article for more information on role-based permissions in Affinity.

Currently, we support one API key per user in your Affinity account. Your API key is able to read data and perform actions in Affinity on your behalf, so keep it safe as you would a password.

Provide your API key as your bearer authentication token to start making calls to Affinity API v2.

Permissions

Overall requirements

You must have the "Generate an API key" permission to be able to work with the Affinity API. Most users in most Affinity accounts with API access have this by default — Contact your Affinity admin if you are not able to generate an API key, and see this article for more information on role-based permissions in Affinity.

Resource-level permissions

The Affinity API respects sharing permissions that are set in-product. For example, if a given user does not have access to a list, note, or interaction in-product, they will not be able to see or modify it via API.

Endpoint-level permissions

Many API endpoints also require endpoint-specific permissions that map to permissions in-product. These permissions, along with the "Generate an API key" permission, are managed by your Affinity admin in the Settings page:

API v2 Endpoint Required Permission
GET /v2/companies "Export All Organizations directory"
GET /v2/companies/{id} "Export All Organizations directory"
GET /v2/companies/{id}/list-entries "Export data from Lists"
GET /v2/persons "Export All People directory"
GET /v2/persons/{id} "Export All People directory"
GET /v2/persons/{id}/list-entries "Export data from Lists"
GET /v2/opportunities "Export data from Lists"
GET /v2/opportunities/{id} "Export data from Lists"
GET /v2/lists/{listId}/list-entries "Export data from Lists"
GET /v2/lists/{listId}/saved-views/{viewId}/list-entries "Export data from Lists"

Rate Limits

The Affinity API sets a limit on the number of calls that a user can make per minute, and that all the users on an account can make per month. It also sets a reasonable limit on the number of concurrent requests it will support from an account at one time.

Requests to both Affinity API versions will count toward the one pool of requests allowed for a user or account. Once a per-minute, monthly, or concurrent rate limit is hit, subsequent requests will return an error code of 429. We highly recommend designing your application to handle 429 errors.

Per-Minute Limits (User-Level)

To help protect our systems, API requests will be halted at 900 per user, per minute. We may also lower this limit on a temporary basis to manage API availability.

Concurrent Request Limits (Account-Level)

To protect our systems and manage availability across customers, we set a reasonable limit on concurrent requests at the account level. Customers should not expect to hit this limit unless they are hitting the API with heavy operations from many concurrent threads at once.

Monthly Plan Tier Limits (Account-Level)

The overall number of requests you can make per month will depend on your account's plan tier. This monthly account-level limit resets at the end of each calendar month. Current rate limits by plan tier are:

Plan Tier Calls Per Month
Essentials None
Scale 100k
Advanced 100k
Enterprise Unlimited*

*Per-Minute and Concurrent Request Limits still apply.

Rate Limit Headers

All API calls will return the following response headers with information about per-minute and monthly limits:

Header Description
X-Ratelimit-Limit-User Number of requests allowed per minute for the user
X-Ratelimit-Limit-User-Remaining Number of requests remaining for the user
X-Ratelimit-Limit-User-Reset Time in seconds before the limit resets for the user
X-Ratelimit-Limit-Org Number of requests allowed per month for the account
X-Ratelimit-Limit-Org-Remaining Number of requests remaining for the account
X-Ratelimit-Limit-Org-Reset Time in seconds before the limit resets for the account

Pagination

When an endpoint is expected to return multiple results, we break the results up into pages to make them easier to handle. To cycle forward through multiple pages of data, look for the nextUrl property in the pagination portion of an API response, and use it for your next request. See endpoint documentation for more information.

Error Codes

Here is a list of the error codes this API will generally return if something goes wrong (see endpoint documentation for endpoint-specific error information):

Error Code Meaning
400 Bad Request — See endpoint documentation for more information.
401 Unauthorized — Your API key is invalid.
403 Forbidden — Insufficient rights to a resource.
404 Not Found — Requested resource does not exist. See endpoint documentation for more information.
405 Method Not Allowed — The method being used is not supported for this resource.
422 Unprocessable Entity — Malformed parameters supplied. This can also happen in cases the parameters supplied logically cannot complete the request. In this case, an appropriate error message is delivered.
429 Too Many Requests — You have exceeded the rate limit.
500 Internal Server Error — We had a problem with our server. Try again later.
503 Service Unavailable — This shouldn't generally happen. Contact us if you encounter this error.

Data Model

The Basics

  • The three top-level objects in Affinity are Persons, Companies, and Opportunities. (Please note: Companies are called Organizations in the Affinity web app.) These have profiles in the Affinity web app and can be added to Lists.
  • A lot of the work of Affinity happens within Lists. A List is a spreadsheet-like collection of rows tied to Persons, Companies, or Opportunities.
  • Each row on a List is a List Entry. A List Entry contains data and metadata about a given Person, Company, or Opportunity in the context of a List. This includes list-specific field data, and information about who added the row to the List and when.
    • Do note that a given entity can be added to a List more than once, i.e., it can have multiple List Entries on the same List. These List Entries can have different list-specific field data and List Entry-level metadata.
  • Each column on a List maps to a Field. Fields and field data also show up within Affinity profile pages, extensions, and integrations.
    • Some Fields are scoped to a single List — These are list-specific fields, and in the API, their data can only be accessed through the List Entry resource. "Global" data from other Fields can be accessed both through the Person/Company/Opportunity resource and the List Entry resource.

Working with Field Data

Field Types and IDs

There are a few types of Fields in Affinity, differentiated by the scope and source of their data:

Field Type Description Example Fields Field ID Pattern
enriched Firmographic, funding, and people Fields populated by Affinity. These can be "Affinity Data" Fields or come from distinct data partners. "Affinity Data: Description", "Dealroom: Number of Employees" A string representing the enrichment source, followed by the field name, e.g. affinity-data-description or dealroom-number-of-employees.
list Fields that are specific to the context of a given list. These can only be accessed through */list-entries endpoints in this version of the API. Default "Status" and "Amount" columns, custom columns that pertain to a given List of deals or founders field-, followed by a unique integer, e.g. field-1234
global Fields that persist across an Affinity account and are not list-specific. "My Firm's Founder Scoring Column" field-, followed by a unique integer, e.g. field-1234
relationship-intelligence Fields populated by Affinity from users' email and calendar data that provide insight into your firm's relationship with a given Person/Company/Opportunity. "Source of Introduction", "First Email", "Last Email", "First Event", "Last Event", "Next Event", "First Chat Message", "Last Chat Message", "Last Contact" A string similar to the field's name in-product, e.g. source-of-introduction

Field Value Types

Field data can take a variety of shapes. These value types are described in the Affinity Help Center here. Here is a list of the same value types, as represented in this API. Notice how array types end with -multi:

Single Type Array Type
text Not supported in Affinity
number number-multi
datetime Not supported in Affinity
location location-multi
dropdown dropdown-multi
ranked-dropdown Not supported in Affinity
person person-multi
company company-multi
filterable-text* filterable-text-multi*

*Please note that filterable-text and filterable-text-multi are special types that operate similarly to dropdown and dropdown-multi. They are reserved for Affinity-populated Fields, and users cannot create Fields with these types.

When an array-typed value has no data in it, the API will return null (rather than an empty array).

Retrieving Field Data

To retrieve field data on companies, persons, or opportunities, call GET /v2/companies, GET /v2/persons, or one of our GET */list-entries endpoints. (Note that Opportunities only have list-specific Fields, so all their field data will live on the */list-entries endpoints.) For most of these endpoints, you will need to specify the Fields for which you want data returned via the fieldIds or fieldTypes parameter — Otherwise, entities will be returned without any field data attached.

The GET /v2/companies and /v2/persons endpoints can return entities with enriched, global, and relationship intelligence field data attached, but do not support list-specific field data. To get comprehensive field data including list-specific field data on Companies and Persons, use the GET */list-entries endpoints.

Specifying Desired Fields (Field Selection)

As mentioned above, you will need to specify the Fields (either by ID or by Type) for which you want data returned when using the following endpoints:

  • GET /v2/companies
  • GET /v2/companies/{id}
  • GET /v2/persons
  • GET /v2/persons/{id}
  • GET /v2/lists/{listId}/list-entries

Each of these endpoints has a fieldIds parameter that accepts an array of Field IDs, and a fieldTypes parameter that accepts an array of Field Types. Use the GET */fields endpoints to get Field IDs, Field Types, and other Field-level metadata:

  • Call GET /v2/companies/fields and /v2/persons/fields to get a list of the enriched, global, and relationship intelligence (AKA non-list-specific) Fields that exist on Companies and Persons, respectively. These are the Fields whose values are available to pull via GET /v2/companies, GET /v2/companies/{id}, GET /v2/persons, and /v2/persons/{id}.

  • Call GET /v2/lists/{listId}/fields to get a list of the enriched, global, relationship intelligence, and list-specific Fields for a given List. These are the Fields whose values are available to pull via GET /v2/lists/{listId}/list-entries.

The following endpoints don't require field selection:

  • GET /v2/lists/{listId}/saved-views/{viewId}/list-entries — See below. This endpoint returns just the field data that has been pulled into the given Saved View via UI.
  • GET /v2/companies/{id}/list-entries and GET /v2/persons/{id}/list-entries — These endpoints return comprehensive field data for the given person or company in the context of each List Entry.

Saved Views

A Saved View allows a user to configure the Fields they want to see in the UI for a given List, and set filters and sorts on the rows on that List. A List can have multiple Saved Views. In the context of this API, Saved Views can be useful for specifying the exact Fields for which data is needed. The */saved-views/{viewId}/list-entries endpoint also respects the filters that have been set on the given Saved View in the Affinity web app. (It does not, however, respect sorts just yet.)

Partner Data Restrictions

This API supports pulling data from Affinity Data fields and select Dealroom fields. Due the agreements we have with some of our data partners, the API does not expose data from the following sources:

A Note on Nested Associations

Some GET endpoints return "association" data under fields. For example, the Persons GET endpoints return data about which Companies a Person is associated with in Affinity. The Opportunities GET endpoints return similar data about associated Companies and Persons. The List Entries GET endpoints also return this data for Person and Opportunity List Entries.

The API truncates these nested arrays of Persons or Companies at 100 entries. For example, if an Opportunity is associated with 200 Persons in Affinity, only 100 of those Persons will be returned by the GET /opportunities or /opportunities/{id} endpoint.

User Guides

A Tour of Our GET Endpoints

Desired Data Relevant Endpoints Notes
Company/Person/Opportunity rows from a List Grab the List’s ID from its URL in the Affinity web app, then hit GET /v2/lists/{listId}/list-entries Data returned will be restricted to the rows on the requested List
Company/Person/Opportunity rows from a Saved View In the Affinity web app, navigate to a List and create a Saved View with the desired field data and filters on it. Grab the List and Saved View IDs from the web app URL, then hit GET /v2/lists/{listId}/saved-views/{viewId}/list-entries Data returned will be restricted to the rows and columns on the requested Saved View
Full rolodex of Companies or Persons in Affinity GET /v2/companies, GET /v2/persons Data from list-specific Fields will not be returned
All the rows for a given Company or Person across all Lists GET /v2/companies/{id}/list-entries, GET /v2/persons/{id}/list-entries
Metadata on Fields, including Field IDs GET /v2/companies/fields, GET /v2/persons/fields, GET /v2/lists/{listId}/fields Metadata on list-specific Fields will only be returned by GET /v2/lists/{listId}/fields
Metadata on Lists or Saved Views GET /v2/lists, GET /v2/lists/{listId}/saved-views
Opportunity data GET /v2/opportunities will only return Opportunity names and List IDs. For comprehensive Opportunity data, hit GET /v2/lists/{listId}/list-entries for an Opportunity List

Tip: The ID for a List, Saved View, Person, Company, or Opportunity can always be found in its Affinity web app URL.

Changelog

March 25, 2024

  • Added the ability to retrieve the date and other details of your firm's "First Email", "Last Email", "First Event", "Last Event", "Next Event", "First Chat Message", "Last Chat Message", and "Last Contact" with a given entity. Use these timestamps to add relationship context to your applications, and to identify founders and companies that need investors' attention.
  • Endpoints that previously required a fieldIds parameter to return field data, now accept either fieldIds or fieldTypes, and will return field data accordingly. See the Specifying Desired Fields (Field Selection) section of these docs for more information. The new fieldTypes parameter should make field data retrieval easier for users looking to pull data from many similar Fields at a time.

January 4, 2023

  • Most endpoints that return field data now require the user to use the fieldIds parameter to specify which Fields they want data for. Without fieldIds specified, these endpoints will return basic entity data but not field data.

December 12, 2023

  • Added the ability to retrieve metadata (e.g. ID, name, type, enrichment source, and data type) on Fields. See the Retrieving Field Metadata section of these docs for more information.

auth

Operations about auths

Get current user

Returns metadata about the current user.

SecuritybearerAuth
Responses
200

Get current user

Response Schema: application/json
object (Tenant)
id
integer or null <int64>

The tenant's unique identifier

name
string or null

The name of the tenant

subdomain
string or null <hostname>

The tenant's subdomain under affinity.co

object (User)
id
integer or null <int64>

The user's unique identifier

firstName
string or null

The user's first name

lastName
string or null

The user's last name

emailAddress
string or null <email>

The user's email address

object (Grant)
type
string or null

The type of grant used to authenticate

Value: "api-key"
scopes
Array of strings or null

The scopes available to the current grant

createdAt
string or null <date-time>

When the grant was created

get/v2/auth/whoami
Request samples
Response samples
application/json
{
  • "grant": {
    },
  • "user": {
    },
  • "tenant": {
    }
}

companies

Operations about companies

Get all Companies

Paginate through Companies in Affinity. Returns basic information and non-list-specific field data on each Company.

To retrieve field data, you must use either the fieldIds or the fieldTypes parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET /v2/companies/fields endpoint. When no fieldIds or fieldTypes are provided, Companies will be returned without any field data attached. To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this: ?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global.

Requires the "Export All Organizations directory" permission.

SecuritybearerAuth
Request
query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

ids
Array of integers <int64>

Company IDs

fieldIds
Array of strings <string>

Field IDs for which to return field data

fieldTypes
Array of strings <string>

Field Types for which to return field data

Items Enum: "enriched" "global" "relationship-intelligence"
Responses
200

Get all Companies

Response Schema: application/json
required
Array of objects (Company)

A page of Company results

Array
id
integer or null <int64>

The company's unique identifier

name
string or null

The company's name

domain
string or null <hostname>

The company's primary domain

domains
Array of strings or null <hostname>

All of the company's domains

isGlobal
boolean or null

Whether or not the company is org specific

Array of objects (Field)

The fields associated with the company

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/companies
Request samples
Response samples
application/json
{
  • "data": [
    ]
}

Get a single Company

Returns basic information and non-list-specific field data on the requested Company.

To retrieve field data, you must use either the fieldIds or the fieldTypes parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET /v2/companies/fields endpoint. When no fieldIds or fieldTypes are provided, Companies will be returned without any field data attached. To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this: ?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global.

Requires the "Export All Organizations directory" permission.

SecuritybearerAuth
Request
path Parameters
id
required
integer <int64> [ 1 .. 9223372036854776000 ]

Company ID

query Parameters
fieldIds
Array of strings <string>

Field IDs for which to return field data

fieldTypes
Array of strings <string>

Field Types for which to return field data

Items Enum: "enriched" "global" "relationship-intelligence"
Responses
200

Get a single Company

Response Schema: application/json
id
integer or null <int64>

The company's unique identifier

name
string or null

The company's name

domain
string or null <hostname>

The company's primary domain

domains
Array of strings or null <hostname>

All of the company's domains

isGlobal
boolean or null

Whether or not the company is org specific

Array of objects (Field)

The fields associated with the company

Array
id
string or null

The field's unique identifier

name
string or null

The field's name

type
string or null

The field's type

Enum: "enriched" "global" "list" "relationship-intelligence"
enrichmentSource
string or null

The source of the data in this Field (if it is enriched)

Enum: "affinity-data" "dealroom"
object (FieldValue)
400

Bad Request

404

Not Found

get/v2/companies/{id}
Request samples
Response samples
application/json
{
  • "domain": "acme.co",
  • "name": "Acme",
  • "isGlobal": true,
  • "domains": [
    ],
  • "id": 1,
  • "fields": [
    ]
}

Get metadata on Company Fields

Returns metadata on non-list-specific Company Fields.

Use the returned Field IDs to request field data from the GET /v2/companies and GET /v2/companies/{id} endpoints.

SecuritybearerAuth
Request
query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get metadata on Company Fields

Response Schema: application/json
required
Array of objects (FieldMetadata)

A page of FieldMetadata results

Array
id
string or null

The field's unique identifier

name
string or null

The field's name

type
string or null

The field's type

Enum: "enriched" "global" "list" "relationship-intelligence"
enrichmentSource
string or null

The source of the data in this Field (if it is enriched)

Enum: "affinity-data" "dealroom"
valueType
string or null

The type of the data in this Field

Enum: "person" "person-multi" "company" "company-multi" "filterable-text" "filterable-text-multi" "number" "number-multi" "datetime" "location" "location-multi" "text" "ranked-dropdown" "dropdown" "dropdown-multi" "formula-number" "interaction"
required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/companies/fields
Request samples
Response samples
application/json
{}

Get a Company's Lists

Returns metadata for all the Lists on which the given Company appears.

SecuritybearerAuth
Request
path Parameters
id
required
integer <int64> [ 1 .. 9223372036854776000 ]

Company ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get a Company's Lists

Response Schema: application/json
required
Array of objects (List)

A page of List results

Array
id
integer or null <int64>

The unique identifier for the list

name
string or null

The name of the list

creatorId
integer or null <int64>

The ID of the user that created this list

ownerId
integer or null <int64>

The ID of the user that owns this list

isPublic
boolean or null

Whether or not the list is public

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

404

Not Found

get/v2/companies/{id}/lists
Request samples
Response samples
application/json
{}

Get a Company's List Entries

Paginate through the List Entries (AKA rows) for the given Company across all Lists. Each List Entry includes field data for the Company, including list-specific field data. Each List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom.

Requires the "Export data from Lists" permission.

SecuritybearerAuth
Request
path Parameters
id
required
integer <int64> [ 1 .. 9223372036854776000 ]

Company ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get a Company's List Entries

Response Schema: application/json
required
Array of objects (ListEntry)

A page of ListEntry results

Array
id
integer or null <int64>

The list entry's unique identifier

listId
integer or null <int64>

The ID of the list that this list entry belongs to

createdAt
string or null <date-time>

The date that the list entry was created

creatorId
integer or null <int64>

The ID of the user that created this list entry

Array of objects or null (Field)

The fields associated with the list entry

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/companies/{id}/list-entries
Request samples
Response samples
application/json
{
  • "data": [
    ]
}

lists

Operations about lists

Get metadata on all Lists

Returns metadata on Lists.

SecuritybearerAuth
Request
query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get metadata on all Lists

Response Schema: application/json
required
Array of objects (ListWithType)

A page of ListWithType results

Array
id
integer or null <int64>

The unique identifier for the list

name
string or null

The name of the list

creatorId
integer or null <int64>

The ID of the user that created this list

ownerId
integer or null <int64>

The ID of the user that owns this list

isPublic
boolean or null

Whether or not the list is public

type
string or null

The entity type for this list

Enum: "company" "opportunity" "person"
required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/lists
Request samples
Response samples
application/json
{}

Get metadata on a single List

Returns metadata on a single List.

SecuritybearerAuth
Request
path Parameters
listId
required
integer <int64> [ 1 .. 9223372036854776000 ]

List ID

Responses
200

Get metadata on a single List

Response Schema: application/json
id
integer or null <int64>

The unique identifier for the list

name
string or null

The name of the list

creatorId
integer or null <int64>

The ID of the user that created this list

ownerId
integer or null <int64>

The ID of the user that owns this list

isPublic
boolean or null

Whether or not the list is public

type
string or null

The entity type for this list

Enum: "company" "opportunity" "person"
400

Bad Request

404

Not Found

get/v2/lists/{listId}
Request samples
Response samples
application/json
{
  • "name": "All companies",
  • "creatorId": 1,
  • "isPublic": false,
  • "id": 1,
  • "ownerId": 1,
  • "type": "company"
}

Get all List Entries on a List

Paginate through the List Entries (AKA rows) on a given List. Returns basic information and field data, including list-specific field data, on each Company, Person, or Opportunity on the List. List Entries also include metadata about their creation, i.e., when they were added to the List and by whom.

To retrieve field data, you must use either the fieldIds or the fieldTypes parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET /v2/lists/{listId}/fields endpoint. When no fieldIds or fieldTypes are provided, List Entries will be returned without any field data attached. To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this: ?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global.

Requires the "Export data from Lists" permission.

SecuritybearerAuth
Request
path Parameters
listId
required
integer <int64> [ 1 .. 9223372036854776000 ]

List ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

fieldIds
Array of strings <string>

Field IDs for which to return field data

fieldTypes
Array of strings <string>

Field Types for which to return field data

Items Enum: "enriched" "global" "list" "relationship-intelligence"
Responses
200

Get all List Entries on a List

Response Schema: application/json
required
Array of objects or null (ListEntryWithEntity)

A page of ListEntryWithEntity results

Array
id
integer or null <int64>

The list entry's unique identifier

createdAt
string or null <date-time>

The date that the list entry was created

creatorId
integer or null <int64>

The ID of the user that created this list entry

type
string or null

The entity type for this list entry

object (Company)

Company model

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

404

Not Found

get/v2/lists/{listId}/list-entries
Request samples
Response samples
application/json
{
  • "data": [
    ]
}

Get metadata on a single List's Fields

Returns metadata on the Fields available on a single List.

Use the returned Field IDs to request field data from the GET /v2/lists/{listId}/list-entries endpoint.

SecuritybearerAuth
Request
path Parameters
listId
required
integer <int64> [ 1 .. 9223372036854776000 ]

List ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get metadata on a single List's Fields

Response Schema: application/json
required
Array of objects (FieldMetadata)

A page of FieldMetadata results

Array
id
string or null

The field's unique identifier

name
string or null

The field's name

type
string or null

The field's type

Enum: "enriched" "global" "list" "relationship-intelligence"
enrichmentSource
string or null

The source of the data in this Field (if it is enriched)

Enum: "affinity-data" "dealroom"
valueType
string or null

The type of the data in this Field

Enum: "person" "person-multi" "company" "company-multi" "filterable-text" "filterable-text-multi" "number" "number-multi" "datetime" "location" "location-multi" "text" "ranked-dropdown" "dropdown" "dropdown-multi" "formula-number" "interaction"
required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

404

Not Found

get/v2/lists/{listId}/fields
Request samples
Response samples
application/json
{}

Get metadata on Saved Views

Returns metadata on the Saved Views on a List.

SecuritybearerAuth
Request
path Parameters
listId
required
integer <int64> [ 1 .. 9223372036854776000 ]

List ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get metadata on Saved Views

Response Schema: application/json
required
Array of objects (SavedView)

A page of SavedView results

Array
id
integer or null <int64>

The saved view's unique identifier

name
string or null

The saved view's name

type
string or null

The type for this saved view

Enum: "sheet" "board" "dashboard"
createdAt
string or null <date-time>

The date that the saved view was created

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

404

Not Found

get/v2/lists/{listId}/saved-views
Request samples
Response samples
application/json
{}

Get metadata on a single Saved View

Returns metadata on a single Saved View.

SecuritybearerAuth
Request
path Parameters
listId
required
integer <int64> [ 1 .. 9223372036854776000 ]

List ID

viewId
required
integer <int64> [ 1 .. 9223372036854776000 ]

Saved view ID

Responses
200

Get metadata on a single Saved View

Response Schema: application/json
id
integer or null <int64>

The saved view's unique identifier

name
string or null

The saved view's name

type
string or null

The type for this saved view

Enum: "sheet" "board" "dashboard"
createdAt
string or null <date-time>

The date that the saved view was created

400

Bad Request

404

Not Found

get/v2/lists/{listId}/saved-views/{viewId}
Request samples
Response samples
application/json
{
  • "createdAt": "2023-01-01 00:00:00.000000000 Z",
  • "name": "my interesting companies",
  • "id": 28,
  • "type": "sheet"
}

Get all List Entries on a Saved View

Paginate through the List Entries (AKA rows) on a given Saved View. Use this endpoint when you need to filter entities or only want some field data to be returned: This endpoint respects the filters set on a Saved View via web app, and only returns field data corresponding to the columns that have been pulled into the Saved View via web app.

Though this endpoint respects the Saved View's filters and column/Field selection, it does not yet preserve sort order. This endpoint also only supports sheet-type Saved Views, and not board- or dashboard-type Saved Views.

See the Data Model section for more information about Saved Views.

Requires the "Export data from Lists" permission.

SecuritybearerAuth
Request
path Parameters
listId
required
integer <int64> [ 1 .. 9223372036854776000 ]

List ID

viewId
required
integer <int64> [ 1 .. 9223372036854776000 ]

Saved view ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get all List Entries on a Saved View

Response Schema: application/json
required
Array of objects or null (ListEntryWithEntity)

A page of ListEntryWithEntity results

Array
id
integer or null <int64>

The list entry's unique identifier

createdAt
string or null <date-time>

The date that the list entry was created

creatorId
integer or null <int64>

The ID of the user that created this list entry

type
string or null

The entity type for this list entry

object (Company)

Company model

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

404

Not Found

get/v2/lists/{listId}/saved-views/{viewId}/list-entries
Request samples
Response samples
application/json
{
  • "data": [
    ]
}

opportunities

Operations about opportunities

Get all Opportunities

Paginate through Opportunities in Affinity. Returns basic information but not field data on each Opportunity.

To access field data on Opportunities, use the /lists/{list_id}/list-entries or the /v2/lists/{list_id}/saved-views/{view_id}/list-entries GET endpoint.

Requires the "Export data from Lists" permission.

SecuritybearerAuth
Request
query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

ids
Array of integers <int64>

Opportunity IDs

Responses
200

Get all Opportunities

Response Schema: application/json
required
Array of objects (Opportunity)

A page of Opportunity results

Array
id
integer or null <int64>

The unique identifier for the opportunity

name
string or null

The name of the opportunity

listId
integer or null <int64>

The ID of the list that the opportunity belongs to

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/opportunities
Request samples
Response samples
application/json
{}

Get a single Opportunity

Returns basic information but not field data on the requested Opportunity.

To access field data on Opportunities, use the /lists/{list_id}/list-entries or the /v2/lists/{list_id}/saved-views/{view_id}/list-entries GET endpoint.

Requires the "Export data from Lists" permission.

SecuritybearerAuth
Request
path Parameters
id
required
integer <int64> [ 1 .. 9223372036854776000 ]

Opportunity ID

Responses
200

Get a single Opportunity

Response Schema: application/json
id
integer or null <int64>

The unique identifier for the opportunity

name
string or null

The name of the opportunity

listId
integer or null <int64>

The ID of the list that the opportunity belongs to

400

Bad Request

404

Not Found

get/v2/opportunities/{id}
Request samples
Response samples
application/json
{
  • "listId": 1,
  • "name": "Acme Upsell $10k",
  • "id": 1
}

persons

Operations about persons

Get all Persons

Paginate through Persons in Affinity. Returns basic information and non-list-specific field data on each Person.

To retrieve field data, you must use either the fieldIds or the fieldTypes parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET /v2/persons/fields endpoint. When no fieldIds or fieldTypes are provided, Persons will be returned without any field data attached. To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this: ?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global.

Requires the "Export All People directory" permission.

SecuritybearerAuth
Request
query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

ids
Array of integers <int64>

People IDs

fieldIds
Array of strings <string>

Field IDs for which to return field data

fieldTypes
Array of strings <string>

Field Types for which to return field data

Items Enum: "enriched" "global" "relationship-intelligence"
Responses
200

Get all Persons

Response Schema: application/json
required
Array of objects (Person)

A page of Person results

Array
id
integer or null <int64>

The persons's unique identifier

firstName
string or null

The person's first name

lastName
string or null

The person's last name

primaryEmailAddress
string or null <email>

The person's primary email address

emailAddresses
Array of strings or null <email>

All of the person's email addresses

type
string or null

The person's type

Enum: "internal" "external"
Array of objects (Field)

The fields associated with the person

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/persons
Request samples
Response samples
application/json
{
  • "data": [
    ]
}

Get a single Person

Returns basic information and non-list-specific field data on the requested Person.

To retrieve field data, you must use either the fieldIds or the fieldTypes parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET /v2/persons/fields endpoint. When no fieldIds or fieldTypes are provided, Persons will be returned without any field data attached. To supply multiple fieldIds or fieldTypes parameters, generate a query string that looks like this: ?fieldIds=field-1234&fieldIds=affinity-data-location or ?fieldTypes=enriched&fieldTypes=global.

Requires the "Export All People directory" permission.

SecuritybearerAuth
Request
path Parameters
id
required
integer <int64> [ 1 .. 9223372036854776000 ]

Person ID

query Parameters
fieldIds
Array of strings <string>

Field IDs for which to return field data

fieldTypes
Array of strings <string>

Field Types for which to return field data

Items Enum: "enriched" "global" "relationship-intelligence"
Responses
200

Get a single Person

Response Schema: application/json
id
integer or null <int64>

The persons's unique identifier

firstName
string or null

The person's first name

lastName
string or null

The person's last name

primaryEmailAddress
string or null <email>

The person's primary email address

emailAddresses
Array of strings or null <email>

All of the person's email addresses

type
string or null

The person's type

Enum: "internal" "external"
Array of objects (Field)

The fields associated with the person

Array
id
string or null

The field's unique identifier

name
string or null

The field's name

type
string or null

The field's type

Enum: "enriched" "global" "list" "relationship-intelligence"
enrichmentSource
string or null

The source of the data in this Field (if it is enriched)

Enum: "affinity-data" "dealroom"
object (FieldValue)
400

Bad Request

404

Not Found

get/v2/persons/{id}
Request samples
Response samples
application/json
{
  • "firstName": "Jane",
  • "lastName": "Doe",
  • "emailAddresses": [
    ],
  • "id": 1,
  • "type": "internal",
  • "fields": [
    ],
  • "primaryEmailAddress": "jane.doe@acme.co"
}

Get metadata on Person Fields

Returns metadata on non-list-specific Person Fields.

Use the returned Field IDs to request field data from the GET /v2/persons and GET /v2/persons/{id} endpoints.

SecuritybearerAuth
Request
query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get metadata on Person Fields

Response Schema: application/json
required
Array of objects (FieldMetadata)

A page of FieldMetadata results

Array
id
string or null

The field's unique identifier

name
string or null

The field's name

type
string or null

The field's type

Enum: "enriched" "global" "list" "relationship-intelligence"
enrichmentSource
string or null

The source of the data in this Field (if it is enriched)

Enum: "affinity-data" "dealroom"
valueType
string or null

The type of the data in this Field

Enum: "person" "person-multi" "company" "company-multi" "filterable-text" "filterable-text-multi" "number" "number-multi" "datetime" "location" "location-multi" "text" "ranked-dropdown" "dropdown" "dropdown-multi" "formula-number" "interaction"
required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/persons/fields
Request samples
Response samples
application/json
{}

Get a Person's Lists

Returns metadata for all the Lists on which the given Person appears.

SecuritybearerAuth
Request
path Parameters
id
required
integer <int64> [ 1 .. 9223372036854776000 ]

Persons ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get a Person's Lists

Response Schema: application/json
required
Array of objects (List)

A page of List results

Array
id
integer or null <int64>

The unique identifier for the list

name
string or null

The name of the list

creatorId
integer or null <int64>

The ID of the user that created this list

ownerId
integer or null <int64>

The ID of the user that owns this list

isPublic
boolean or null

Whether or not the list is public

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

404

Not Found

get/v2/persons/{id}/lists
Request samples
Response samples
application/json
{}

Get a Person's List Entries

Paginate through the List Entries (AKA rows) for the given Person across all Lists. Each List Entry includes field data for the Person, including list-specific field data. Each List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom.

Requires the "Export data from Lists" permission.

SecuritybearerAuth
Request
path Parameters
id
required
integer <int64> [ 1 .. 9223372036854776000 ]

Persons ID

query Parameters
cursor
string

Cursor for the next or previous page

limit
integer <int32> [ 1 .. 100 ]
Default: 100

Number of items to include in the page

Responses
200

Get a Person's List Entries

Response Schema: application/json
required
Array of objects (ListEntry)

A page of ListEntry results

Array
id
integer or null <int64>

The list entry's unique identifier

listId
integer or null <int64>

The ID of the list that this list entry belongs to

createdAt
string or null <date-time>

The date that the list entry was created

creatorId
integer or null <int64>

The ID of the user that created this list entry

Array of objects or null (Field)

The fields associated with the list entry

required
object (Pagination)
prevUrl
string or null <url>

URL for the previous page

nextUrl
string or null <url>

URL for the next page

400

Bad Request

get/v2/persons/{id}/list-entries
Request samples
Response samples
application/json
{
  • "data": [
    ]
}