# Affinity API v2 Documentation (Auto-synced)
> **β οΈ IMPORTANT DISCLAIMER**
>
> **This is an UNOFFICIAL markdown copy of the Affinity API v2 documentation.** The official and authoritative documentation is maintained by Affinity at:
>
> **π Official Documentation:** [https://developer.affinity.co/api-reference/openapi.json](https://developer.affinity.co/api-reference/openapi.json)
>
> **Always refer to the official Affinity documentation for the most up-to-date and accurate information.**
---
## About This Document
This markdown version of the Affinity API v2 documentation was generated automatically to provide:
- **Better compatibility with AI coding assistants**
- **Offline access**
- **Text-based search**
- **Version control**
- **Direct raw access**
**Source:** Extracted from the live Affinity API documentation at https://developer.affinity.co/api-reference/openapi.json
> **Note:** The live site renders dynamic multi-language request/response samples in-browser. Because those snippets are generated at runtime and are not embedded in the OpenAPI payload, they cannot be mirrored here. Refer to https://developer.affinity.co/ for the full interactive samples.
**Documentation Version:** This copy is based on the official documentation as it appeared on **October 07, 2025 at 22:05:01 UTC** (Last updated: 10/07/2025 22:05:01 UTC).
**Snapshot:** Captured HTML `openapi.json` (archived with the sync artifacts for QA).
> **β οΈ Use at Your Own Risk**
>
> While every effort is made to ensure accuracy, this is an unofficial copy and may contain errors or outdated information.
## Contact & Support
- **Affinity Support:** [support@affinity.co](mailto:support@affinity.co)
- **Official v2 Documentation:** [https://developer.affinity.co/api-reference/openapi.json](https://developer.affinity.co/api-reference/openapi.json)
- **Official v1 Documentation:** [https://api-docs.affinity.co/](https://api-docs.affinity.co/)
---
## Table of Contents
- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [Authentication](#authentication)
- [Permissions](#permissions)
- [Overall Requirements](#overall-requirements)
- [Resource-Level Permissions](#resource-level-permissions)
- [Endpoint-Level Permissions](#endpoint-level-permissions)
- [Rate Limits](#rate-limits)
- [Per-Minute Limits (User-Level)](#per-minute-limits-user-level)
- [Concurrent Request Limits (Account-Level)](#concurrent-request-limits-account-level)
- [Monthly Plan Tier Limits (Account-Level)](#monthly-plan-tier-limits-account-level)
- [Rate Limit Headers](#rate-limit-headers)
- [Pagination](#pagination)
- [Filtering](#filtering)
- [Rules](#rules)
- [Grammar](#grammar)
- [Simple Types](#simple-types)
- [Collections (all types)](#collections-all-types)
- [Error Codes](#error-codes)
- [Beta Endpoints](#beta-endpoints)
- [Data Model](#data-model)
- [The Basics](#the-basics)
- [Working with Field Data](#working-with-field-data)
- [Field Types and IDs](#field-types-and-ids)
- [Field Value Types](#field-value-types)
- [Retrieving Field Data](#retrieving-field-data)
- [Specifying Desired Fields (Field Selection)](#specifying-desired-fields-field-selection)
- [Saved Views](#saved-views)
- [Partner Data Restrictions](#partner-data-restrictions)
- [Nested Associations](#nested-associations)
- [User Guides](#user-guides)
- [A Tour of Our GET Endpoints](#a-tour-of-our-get-endpoints)
- [Changelog](#changelog)
- [May 14th, 2025](#may-14th-2025)
- [April 9th, 2025](#april-9th-2025)
- [March 31st, 2025](#march-31st-2025)
- [February 28th, 2025](#february-28th-2025)
- [January 17th, 2025](#january-17th-2025)
- [January 15th, 2025](#january-15th-2025)
- [December 3rd, 2024](#december-3rd-2024)
- [September 25th, 2024](#september-25th-2024)
- [August 5, 2024](#august-5-2024)
- [July 24, 2024](#july-24-2024)
- [March 25, 2024](#march-25-2024)
- [January 4, 2023](#january-4-2023)
- [December 12, 2023](#december-12-2023)
- [auth](#auth)
- [Get current user](#get-current-user)
- [Example Request](#example-request)
- [Responses](#responses)
- [companies](#companies)
- [Get all Companies](#get-all-companies)
- [Query Parameters](#query-parameters)
- [Example Request](#example-request-1)
- [Responses](#responses-1)
- [Get metadata on Company Fields](#get-metadata-on-company-fields)
- [Query Parameters](#query-parameters-1)
- [Example Request](#example-request-2)
- [Responses](#responses-2)
- [Get a single Company](#get-a-single-company)
- [Path Parameters](#path-parameters)
- [Query Parameters](#query-parameters-2)
- [Example Request](#example-request-3)
- [Responses](#responses-3)
- [Get a Company's List Entries](#get-a-companys-list-entries)
- [Path Parameters](#path-parameters-1)
- [Query Parameters](#query-parameters-3)
- [Example Request](#example-request-4)
- [Responses](#responses-4)
- [Get a Company's Lists](#get-a-companys-lists)
- [Path Parameters](#path-parameters-2)
- [Query Parameters](#query-parameters-4)
- [Example Request](#example-request-5)
- [Responses](#responses-5)
- [Get Notes for a Company](#get-notes-for-a-company)
- [Path Parameters](#path-parameters-3)
- [Query Parameters](#query-parameters-5)
- [Example Request](#example-request-6)
- [Responses](#responses-6)
- [companyMerges](#companymerges)
- [Get All Company Merges](#get-all-company-merges)
- [Query Parameters](#query-parameters-6)
- [Example Request](#example-request-7)
- [Responses](#responses-7)
- [Initiate Company Merge](#initiate-company-merge)
- [Request Body](#request-body)
- [Example Request](#example-request-8)
- [Responses](#responses-8)
- [Get Company Merge](#get-company-merge)
- [Path Parameters](#path-parameters-4)
- [Example Request](#example-request-9)
- [Responses](#responses-9)
- [Get All Company Merge Tasks](#get-all-company-merge-tasks)
- [Query Parameters](#query-parameters-7)
- [Example Request](#example-request-10)
- [Responses](#responses-10)
- [Get Company Merge Task](#get-company-merge-task)
- [Path Parameters](#path-parameters-5)
- [Example Request](#example-request-11)
- [Responses](#responses-11)
- [emails](#emails)
- [Get metadata on all Emails](#get-metadata-on-all-emails)
- [Query Parameters](#query-parameters-8)
- [Example Request](#example-request-12)
- [Responses](#responses-12)
- [lists](#lists)
- [Get metadata on all Lists](#get-metadata-on-all-lists)
- [Query Parameters](#query-parameters-9)
- [Example Request](#example-request-13)
- [Responses](#responses-13)
- [Get metadata on a single List](#get-metadata-on-a-single-list)
- [Path Parameters](#path-parameters-6)
- [Example Request](#example-request-14)
- [Responses](#responses-14)
- [Get metadata on a single List's Fields](#get-metadata-on-a-single-lists-fields)
- [Path Parameters](#path-parameters-7)
- [Query Parameters](#query-parameters-10)
- [Example Request](#example-request-15)
- [Responses](#responses-15)
- [Get all List Entries on a List](#get-all-list-entries-on-a-list)
- [Path Parameters](#path-parameters-8)
- [Query Parameters](#query-parameters-11)
- [Example Request](#example-request-16)
- [Responses](#responses-16)
- [Get a single List Entry on a List](#get-a-single-list-entry-on-a-list)
- [Path Parameters](#path-parameters-9)
- [Query Parameters](#query-parameters-12)
- [Example Request](#example-request-17)
- [Responses](#responses-17)
- [Get field values on a single List Entry](#get-field-values-on-a-single-list-entry)
- [Path Parameters](#path-parameters-10)
- [Query Parameters](#query-parameters-13)
- [Example Request](#example-request-18)
- [Responses](#responses-18)
- [Perform batch operations on a list entry's fields](#perform-batch-operations-on-a-list-entrys-fields)
- [Path Parameters](#path-parameters-11)
- [Request Body](#request-body-1)
- [Example Request](#example-request-19)
- [Responses](#responses-19)
- [Get a single field value](#get-a-single-field-value)
- [Path Parameters](#path-parameters-12)
- [Example Request](#example-request-20)
- [Responses](#responses-20)
- [Update a single field value on a List Entry](#update-a-single-field-value-on-a-list-entry)
- [Path Parameters](#path-parameters-13)
- [Request Body](#request-body-2)
- [Example Request](#example-request-21)
- [Responses](#responses-21)
- [Get metadata on Saved Views](#get-metadata-on-saved-views)
- [Path Parameters](#path-parameters-14)
- [Query Parameters](#query-parameters-14)
- [Example Request](#example-request-22)
- [Responses](#responses-22)
- [Get metadata on a single Saved View](#get-metadata-on-a-single-saved-view)
- [Path Parameters](#path-parameters-15)
- [Example Request](#example-request-23)
- [Responses](#responses-23)
- [Get all List Entries on a Saved View](#get-all-list-entries-on-a-saved-view)
- [Path Parameters](#path-parameters-16)
- [Query Parameters](#query-parameters-15)
- [Example Request](#example-request-24)
- [Responses](#responses-24)
- [meetings](#meetings)
- [Get metadata on all Meetings [COMING SOON]](#get-metadata-on-all-meetings-coming-soon)
- [Query Parameters](#query-parameters-16)
- [Example Request](#example-request-25)
- [Responses](#responses-25)
- [notes](#notes)
- [Get all Notes](#get-all-notes)
- [Query Parameters](#query-parameters-17)
- [Example Request](#example-request-26)
- [Responses](#responses-26)
- [Get a single Note](#get-a-single-note)
- [Path Parameters](#path-parameters-17)
- [Query Parameters](#query-parameters-18)
- [Example Request](#example-request-27)
- [Responses](#responses-27)
- [Get Companies attached to a Note](#get-companies-attached-to-a-note)
- [Path Parameters](#path-parameters-18)
- [Query Parameters](#query-parameters-19)
- [Example Request](#example-request-28)
- [Responses](#responses-28)
- [Get Opportunities attached to a Note](#get-opportunities-attached-to-a-note)
- [Path Parameters](#path-parameters-19)
- [Query Parameters](#query-parameters-20)
- [Example Request](#example-request-29)
- [Responses](#responses-29)
- [Get Persons attached to a Note](#get-persons-attached-to-a-note)
- [Path Parameters](#path-parameters-20)
- [Query Parameters](#query-parameters-21)
- [Example Request](#example-request-30)
- [Responses](#responses-30)
- [Get replies for a Note](#get-replies-for-a-note)
- [Path Parameters](#path-parameters-21)
- [Query Parameters](#query-parameters-22)
- [Example Request](#example-request-31)
- [Responses](#responses-31)
- [opportunities](#opportunities)
- [Get all Opportunities](#get-all-opportunities)
- [Query Parameters](#query-parameters-23)
- [Example Request](#example-request-32)
- [Responses](#responses-32)
- [Get a single Opportunity](#get-a-single-opportunity)
- [Path Parameters](#path-parameters-22)
- [Example Request](#example-request-33)
- [Responses](#responses-33)
- [Get Notes for an Opportunity](#get-notes-for-an-opportunity)
- [Path Parameters](#path-parameters-23)
- [Query Parameters](#query-parameters-24)
- [Example Request](#example-request-34)
- [Responses](#responses-34)
- [personMerges](#personmerges)
- [Get All Person Merges](#get-all-person-merges)
- [Query Parameters](#query-parameters-25)
- [Example Request](#example-request-35)
- [Responses](#responses-35)
- [Initiate Person Merge](#initiate-person-merge)
- [Request Body](#request-body-3)
- [Example Request](#example-request-36)
- [Responses](#responses-36)
- [Get Person Merge](#get-person-merge)
- [Path Parameters](#path-parameters-24)
- [Example Request](#example-request-37)
- [Responses](#responses-37)
- [Get All Person Merge Tasks](#get-all-person-merge-tasks)
- [Query Parameters](#query-parameters-26)
- [Example Request](#example-request-38)
- [Responses](#responses-38)
- [Get Person Merge Task](#get-person-merge-task)
- [Path Parameters](#path-parameters-25)
- [Example Request](#example-request-39)
- [Responses](#responses-39)
- [persons](#persons)
- [Get all Persons](#get-all-persons)
- [Query Parameters](#query-parameters-27)
- [Example Request](#example-request-40)
- [Responses](#responses-40)
- [Get metadata on Person Fields](#get-metadata-on-person-fields)
- [Query Parameters](#query-parameters-28)
- [Example Request](#example-request-41)
- [Responses](#responses-41)
- [Get a single Person](#get-a-single-person)
- [Path Parameters](#path-parameters-26)
- [Query Parameters](#query-parameters-29)
- [Example Request](#example-request-42)
- [Responses](#responses-42)
- [Get a Person's List Entries](#get-a-persons-list-entries)
- [Path Parameters](#path-parameters-27)
- [Query Parameters](#query-parameters-30)
- [Example Request](#example-request-43)
- [Responses](#responses-43)
- [Get a Person's Lists](#get-a-persons-lists)
- [Path Parameters](#path-parameters-28)
- [Query Parameters](#query-parameters-31)
- [Example Request](#example-request-44)
- [Responses](#responses-44)
- [Get Notes for a Person](#get-notes-for-a-person)
- [Path Parameters](#path-parameters-29)
- [Query Parameters](#query-parameters-32)
- [Example Request](#example-request-45)
- [Responses](#responses-45)
- [Schema Reference](#schema-reference)
- [Attendee](#attendee)
- [AttendeesPreview](#attendeespreview)
- [AuthenticationError](#authenticationerror)
- [AuthorizationError](#authorizationerror)
- [AuthorizationErrors](#authorizationerrors)
- [BadRequestError](#badrequesterror)
- [ChatMessage](#chatmessage)
- [CompaniesValue](#companiesvalue)
- [CompaniesValueUpdate](#companiesvalueupdate)
- [Company](#company)
- [CompanyData](#companydata)
- [CompanyDataPaged](#companydatapaged)
- [CompanyListEntry](#companylistentry)
- [CompanyMergeRequest](#companymergerequest)
- [CompanyMergeResponse](#companymergeresponse)
- [CompanyMergeState](#companymergestate)
- [CompanyMergeStatePaged](#companymergestatepaged)
- [CompanyMergeTask](#companymergetask)
- [CompanyMergeTaskPaged](#companymergetaskpaged)
- [CompanyPaged](#companypaged)
- [CompanyReference](#companyreference)
- [CompanyValue](#companyvalue)
- [CompanyValueUpdate](#companyvalueupdate)
- [ConflictError](#conflicterror)
- [DateValue](#datevalue)
- [Dropdown](#dropdown)
- [DropdownReference](#dropdownreference)
- [DropdownValue](#dropdownvalue)
- [DropdownValueUpdate](#dropdownvalueupdate)
- [DropdownsValue](#dropdownsvalue)
- [DropdownsValueUpdate](#dropdownsvalueupdate)
- [Email](#email)
- [Error](#error)
- [Errors](#errors)
- [Field](#field)
- [FieldMetadata](#fieldmetadata)
- [FieldMetadataPaged](#fieldmetadatapaged)
- [FieldPaged](#fieldpaged)
- [FieldUpdate](#fieldupdate)
- [FieldValue](#fieldvalue)
- [FieldValueUpdate](#fieldvalueupdate)
- [FloatValue](#floatvalue)
- [FloatsValue](#floatsvalue)
- [FormulaNumber](#formulanumber)
- [FormulaValue](#formulavalue)
- [Grant](#grant)
- [Interaction](#interaction)
- [InteractionValue](#interactionvalue)
- [List](#list)
- [ListEntry](#listentry)
- [ListEntryBatchOperationRequest](#listentrybatchoperationrequest)
- [ListEntryBatchOperationResponse](#listentrybatchoperationresponse)
- [ListEntryBatchOperationUpdateFields](#listentrybatchoperationupdatefields)
- [ListEntryBatchOperations](#listentrybatchoperations)
- [ListEntryPaged](#listentrypaged)
- [ListEntryWithEntity](#listentrywithentity)
- [ListEntryWithEntityPaged](#listentrywithentitypaged)
- [ListPaged](#listpaged)
- [ListWithType](#listwithtype)
- [ListWithTypePaged](#listwithtypepaged)
- [Location](#location)
- [LocationValue](#locationvalue)
- [LocationsValue](#locationsvalue)
- [Meeting](#meeting)
- [MethodNotAllowedError](#methodnotallowederror)
- [NotAcceptableError](#notacceptableerror)
- [NotFoundError](#notfounderror)
- [NotFoundErrors](#notfounderrors)
- [NotImplementedError](#notimplementederror)
- [Opportunity](#opportunity)
- [OpportunityListEntry](#opportunitylistentry)
- [OpportunityPaged](#opportunitypaged)
- [OpportunityWithFields](#opportunitywithfields)
- [Pagination](#pagination-1)
- [PaginationWithTotalCount](#paginationwithtotalcount)
- [Person](#person)
- [PersonData](#persondata)
- [PersonDataPaged](#persondatapaged)
- [PersonListEntry](#personlistentry)
- [PersonMergeRequest](#personmergerequest)
- [PersonMergeResponse](#personmergeresponse)
- [PersonMergeState](#personmergestate)
- [PersonMergeStatePaged](#personmergestatepaged)
- [PersonMergeTask](#personmergetask)
- [PersonMergeTaskPaged](#personmergetaskpaged)
- [PersonPaged](#personpaged)
- [PersonReference](#personreference)
- [PersonValue](#personvalue)
- [PersonValueUpdate](#personvalueupdate)
- [PersonsValue](#personsvalue)
- [PersonsValueUpdate](#personsvalueupdate)
- [PhoneCall](#phonecall)
- [RankedDropdown](#rankeddropdown)
- [RankedDropdownReference](#rankeddropdownreference)
- [RankedDropdownValue](#rankeddropdownvalue)
- [RankedDropdownValueUpdate](#rankeddropdownvalueupdate)
- [RateLimitError](#ratelimiterror)
- [SavedView](#savedview)
- [SavedViewPaged](#savedviewpaged)
- [ServerError](#servererror)
- [Tenant](#tenant)
- [TextValue](#textvalue)
- [TextsValue](#textsvalue)
- [UnprocessableEntityError](#unprocessableentityerror)
- [UnsupportedMediaTypeError](#unsupportedmediatypeerror)
- [User](#user)
- [ValidationError](#validationerror)
- [WhoAmI](#whoami)
- [interactions.Email](#email)
- [interactions.EmailPaged](#interactionsemailpaged)
- [interactions.Meeting](#meeting)
- [interactions.MeetingPaged](#interactionsmeetingpaged)
- [notes.AiNotetakerReplyNote](#notesainotetakerreplynote)
- [notes.AiNotetakerRootNote](#notesainotetakerrootnote)
- [notes.BaseNote](#notesbasenote)
- [notes.BaseReply](#notesbasereply)
- [notes.BaseRootNote](#notesbaserootnote)
- [notes.CallInteraction](#notescallinteraction)
- [notes.ChatMessageInteraction](#noteschatmessageinteraction)
- [notes.CompaniesPreview](#notescompaniespreview)
- [notes.Content](#notescontent)
- [notes.EmailInteraction](#notesemailinteraction)
- [notes.EntitiesNote](#notesentitiesnote)
- [notes.Interaction](#notesinteraction)
- [notes.InteractionNote](#notesinteractionnote)
- [notes.MeetingInteraction](#notesmeetinginteraction)
- [notes.Mention](#notesmention)
- [notes.Note](#notesnote)
- [notes.NotesPaged](#notesnotespaged)
- [notes.OpportunitiesPreview](#notesopportunitiespreview)
- [notes.PermissionSettings](#notespermissionsettings)
- [notes.PersonMention](#notespersonmention)
- [notes.PersonsPreview](#notespersonspreview)
- [notes.RepliesPaged](#notesrepliespaged)
- [notes.Reply](#notesreply)
- [notes.UserReplyNote](#notesuserreplynote)
- [Error Reference](#error-reference)
# Introduction
Welcome to Affinity API v2! This API provides a RESTful interface for building internal apps,
automated workflows, 3rd party integrations, and for connecting Affinity to the rest of your tech
stack.
The legacy Affinity v1 API can be found [here](https://api-docs.affinity.co/). The v2 API is not at
feature parity with v1 - we are continuing to develop new v2 APIs to support all v1 functionality
over time.
**The Affinity APIs are only available on select license types.** See
[this Help Center article](https://support.affinity.co/hc/en-us/articles/5563700459533-Getting-started-with-the-Affinity-API-FAQs)
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.
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. 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. See
[this Help Center article](https://support.affinity.co/s/article/How-to-Create-and-Manage-API-Keys)
for full instructions on API key generation, and
[this article](https://support.affinity.co/hc/en-us/articles/360015976732-Account-Level-Permissions)
for more information on role-based permissions in Affinity.
Provide your API key as your bearer authentication token to start making calls to Affinity API v2.
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.
## Permissions
### Overall Requirements
You must have the "Generate an API key" permission to be able to work with the Affinity API. Most
users in Affinity have this by default β Contact your Affinity admin if you are not able to generate
an API key, and see
[this article](https://support.affinity.co/hc/en-us/articles/360015976732-Account-Level-Permissions)
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 require endpoint-specific permissions in-product. These permissions, along with
the "Generate an API key" permission, are managed by your Affinity admin in the Settings page. In
the description of each endpoint you will see the required permissions needed.
## 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 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.
## Filtering
Some endpoints support a filtering language for flexible and powerful queries. This allows for the
creation of complex filter expressions using different operators and boolean logic in a single
filter string. The description of each endpoint will contain information on which filter properties
and operators are supported.
### Rules
- Spaces are insignificant by default. For example, `field = hello` and `field=hello` are both
valid.
- If spaces are significant, they need to be inside double quotes, for example,
`field = "hello world"`
- Special characters need to be escaped with a backslash: `field="hello\" world"` Full list of
special characters: `\ * ~ ! & = > < $ ^ | " ' ( ) ] [ /`
- Use `&` and `|` for boolean operations: `foo = 1 | baz = 2 & bar = 3`. Boolean Algebra Logic is
assumed: `&` takes precedence over `|`. When evaluating the condition above, `baz = 2 & bar = 3`
will be computed first, and then the result will be `or`'ed with `foo=1`
- Parentheses can be used to specify the order of operations. In the example above, to make sure
that `foo = 1 | baz = 2` is evaluated first, parentheses must be placed
`(foo = 1 | baz = 2) & bar = 3`
### Grammar
#### Simple Types
| Definition | Property Type | Operator | Example |
| ------------------------ | ---------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------- |
| exact match | all | = | content = βhello worldβ content=hello |
| starts with | text | =^ | content =^ he |
| ends with | text | =$ | content =$ llo |
| contains | text | =~ | content =~ lo |
| greater than | int32, int64, float, double, decimal, date, datetime | \> | count > 1 |
| greater than or equal to | int32, int64, float, double, decimal, date, datetime | \>= | content >= 1 |
| less than | int32, int64, float, double, decimal, date, datetime | \< | count < 1 |
| less than or equal to | int32, int64, float, double, decimal, date, datetime | \<= | content <= 1 |
| is NULL | all | != \* | content != \* |
| is not NULL | all | =\* | content = \* |
| is empty | text | ="" | content = "" |
| negation | all | ! | content != βhello worldβ !(content = βhello worldβ) !(content =^ βhello worldβ) |
#### Collections (all types)
| Definition | Operator | Example |
| ------------------------- | -------- | ------------------------------------ |
| exact match with ordering | = | industries = [Healthcare,Fintech] |
| contains all | =~ | industries =~ [Healthcare,Fintech] |
| empty | =[] | industries =[] |
| negation | ! | !(industries = [Healthcare,Fintech]) |
## Error Codes
Here is a list of the error codes the API will return if something goes wrong (see endpoint
documentation for endpoint-specific errors):
| 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. |
## Beta Endpoints
Youβll notice in our documentation that some endpoints will be marked as BETA. These endpoints are
newly released and will eventually progress to General Availability (GA). While an endpoint is in
BETA there are some important things to consider:
- The development of this endpoint may still be in progress. This means new capabilities, request
parameters, response data, and performance improvements may be adjusted over time. Because of
this, breaking changes may occur to the endpoint WITHOUT notice or versioning.
- As this is an early release, bug fixes may still be ongoing as well, and we encourage you to
report bugs to [support@affinity.co](mailto:support@affinity.co).
- In addition, your feedback around the capabilities of the endpoint are highly valuable, please
reach out to your CSM to provide feedback to our product team.
# Data Model
## The Basics
The three top-level objects in Affinity are **Persons, Companies, and Opportunities**. (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 **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.
- A given entity can be added to a List more than once. 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 show up within Affinity profile pages, extensions,
and integrations. There are two categories of fields:
- **List-specific fields** are scoped to a single List. In the API, their data can only be accessed
through the List Entry resource.
- **Global fields** belong to entities directly. These can include default fields, fields created by
you, enrichment fields, or relationship intelligence fields. They can be accessed through the
Person/Company/Opportunity resources and the List Entry resource.
## Working with Field Data
### Field Types and IDs
Here is a deeper look at the 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](https://support.affinity.co/hc/en-us/articles/115001608232-How-to-create-a-new-column-in-a-list).
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`\* |
\*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](https://support.affinity.co/hc/en-us/articles/360058255052-Affinity-Data) fields and
select
[Dealroom fields](https://support.affinity.co/hc/en-us/articles/6106558518797-Dealroom-co-data-in-Affinity#h_01G2N22SVH7TJR3DJV3NQDE9HQ).
Due the agreements we have with some of our data partners, the API does not expose data from the
following sources:
- Crunchbase, including Crunchbase UUID
- Pitchbook
- [Dealroom "exclusive" fields](https://support.affinity.co/hc/en-us/articles/6106558518797-Dealroom-co-data-in-Affinity#h_01G2N22YEAZJ5TC1X9ENKZFWF5)
## 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](https://support.affinity.co/hc/en-us/articles/115001508572-How-to-leverage-saved-views-within-a-list) 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
## May 14th, 2025
- Renamed all path parameters named simply "id" to a more descriptive name (eg. "personId"). This
will not have any effect on the API at runtime, but may impact code relying on the OpenAPI spec
doing type generation.
## April 9th, 2025
- The following endpoints are no longer in BETA:
| Method | URL | Summary |
| ------ | ---------------------------------------------------------------- | ------------------------------------------------- |
| GET | `/v2/lists/{listId}/list-entries/{listEntryId}` | Get a single List Entry on a List |
| GET | `/v2/lists/{listId}/list-entries/{listEntryId}/fields` | Get field values on a single List Entry |
| PATCH | `/v2/lists/{listId}/list-entries/{listEntryId}/fields` | Perform batch operations on a list entry's fields |
| GET | `/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}` | Get a single field value |
| POST | `/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}` | Update a single field value on a List Entry |
## March 31st, 2025
- The following beta endpoints now support updating association fields.
| Method | URL | Summary |
| ------ | ---------------------------------------------------------------- | ------------------------------------------------- |
| PATCH | `/v2/lists/{listId}/list-entries/{listEntryId}/fields` | Perform batch operations on a list entry's fields |
| POST | `/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}` | Update a single field value on a List Entry |
## February 28th, 2025
- Added the following endpoints in BETA:
| Method | URL | Summary |
| ------ | ---------------------------------------------------------------- | ------------------------------------------------- |
| GET | `/v2/lists/{listId}/list-entries/{listEntryId}` | Get a single List Entry on a List |
| GET | `/v2/lists/{listId}/list-entries/{listEntryId}/fields` | Get field values on a single List Entry |
| PATCH | `/v2/lists/{listId}/list-entries/{listEntryId}/fields` | Perform batch operations on a list entry's fields |
| GET | `/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}` | Get a single field value |
| POST | `/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}` | Update a single field value on a List Entry |
## January 17th, 2025
- Document `X-Ratelimit` headers in the schema for all endpoints.
## January 15th, 2025
- Add default responses to all endpoints to document all possible error codes that can be returned
by the API.
- Updated 400 error responses to correctly include the `bad-request` error code as a possible error.
## December 3rd, 2024
- Properly document `listId` property on `CompanyListEntry`, `PersonListEntry`, and
`OpportunityListEntry` schemas.
## September 25th, 2024
- Upgrade schema to OpenAPI 3.1
## August 5, 2024
- Correct `opp` to `opportunity` to match documentation for the `List` `type` property.
## July 24, 2024
- More accurate documentation for response properties that are enums β Enums with `null` as a
possible value will have it listed as one.
## 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)](#working-with-field-data) 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](#working-with-field-data) section
of these docs for more information.
## auth
Operations about auths
### Get current user
`GET /v2/auth/whoami`
- **Tag:** auth Β· **OperationId:** v2_auth_whoami__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
Returns information about the authenticated user, their current organization, and API key permissions.
Use this endpoint to verify your authentication and understand your available API access levels.
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/auth/whoami' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: WhoAmI
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `tenant` | `object` | Yes | |
| `user` | `object` | Yes | |
| `grant` | `object` | Yes | |
**`tenant` details** β See [Tenant](#tenant)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The tenant's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The name of the tenant |
| `subdomain` | `string` | Yes | The tenant's subdomain under affinity.co |
**`user` details** β See [User](#user)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The user's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string` | Yes | The user's first name |
| `lastName` | `string/null` | Yes | The user's last name |
| `emailAddress` | `string` | Yes | The user's email address |
**`grant` details** β See [Grant](#grant)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string (enum: `api-key`, `access-token`)` | Yes | The type of grant used to authenticate |
| `scopes` | `array` | Yes | The scopes available to the current grant |
| `createdAt` | `string` | Yes | When the grant was created |
**`scopes` details** β The scopes available to the current grant
**Items**
Example
```json
{
"grant": {
"createdAt": "2023-01-01T00:00:00Z",
"scopes": [
"api"
],
"type": "api-key"
},
"tenant": {
"id": 1,
"name": "Contoso Ltd.",
"subdomain": "contoso"
},
"user": {
"emailAddress": "john.smith@contoso.com",
"firstName": "John",
"id": 1,
"lastName": "Smith"
}
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
## companies
Operations about companies
### Get all Companies
`GET /v2/companies`
- **Tag:** companies Β· **OperationId:** v2_companies__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
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](#permissions).
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
| `ids` | `array>` | No | Company IDs |
| `fieldIds` | `array` | No | Field IDs for which to return field data |
| `fieldTypes` | `array` | No | Field Types for which to return field data |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/companies' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: CompanyPaged
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A page of Company results |
| `pagination` | `object` | Yes | |
**`data` details** β Company model See [Company](#company)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The company's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The company's name |
| `domain` | `string/null` | Yes | The company's primary domain |
| `domains` | `array>` | Yes | All of the company's domains |
| `isGlobal` | `boolean` | Yes | Whether or not the company is tenant specific |
| `fields` | `array` | No | The fields associated with the company |
**`domains` details** β All of the company's domains
**Items**
**`fields` details** β See [Field](#field)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The field's unique identifier |
| `name` | `string` | Yes | The field's name |
| `type` | `string (enum: `enriched`, `global`, `list`, `relationship-intelligence`)` | Yes | The field's type |
| `enrichmentSource` | `string/null (enum: `affinity-data`, `dealroom`, `None`)` | Yes | The source of the data in this Field (if it is enriched) |
| `value` | `oneOf` | Yes | |
**`pagination` details** β See [Pagination](#pagination)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
Example
```json
{
"data": [
{
"domain": "acme.co",
"domains": [
"acme.co"
],
"fields": [
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"continent": "North America",
"country": "United States",
"state": "California",
"streetAddress": "1 Main Street"
},
"type": "location"
}
},
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-description",
"name": "Description",
"type": "enriched",
"value": {
"data": "A leading provider of innovative solutions",
"type": "text"
}
}
],
"id": 1,
"isGlobal": true,
"name": "Acme"
},
{
"domain": "umbrella.co",
"domains": [
"umbrella.co"
],
"fields": [
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "Raccoon City",
"continent": "North America",
"country": "United States",
"state": "Ohio",
"streetAddress": "200 Corporate Blvd"
},
"type": "location"
}
},
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-description",
"name": "Description",
"type": "enriched",
"value": {
"data": "Pharmaceutical and biotechnology company",
"type": "text"
}
}
],
"id": 2,
"isGlobal": true,
"name": "Umbrella Corporation"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get metadata on Company Fields
`GET /v2/companies/fields`
- **Tag:** companies Β· **OperationId:** v2_companies_fields__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
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.
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/companies/fields' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: FieldMetadataPaged
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A page of FieldMetadata results |
| `pagination` | `object` | Yes | |
**`data` details** β See [FieldMetadata](#fieldmetadata)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The field's unique identifier |
| `name` | `string` | Yes | The field's name |
| `type` | `string (enum: `enriched`, `global`, `list`, `relationship-intelligence`)` | Yes | The field's type |
| `enrichmentSource` | `string/null (enum: `affinity-data`, `dealroom`, `None`)` | Yes | The source of the data in this Field (if it is enriched) |
| `valueType` | `string (enum: `person`, `person-multi`, `company`, `company-multi`, `filterable-text`, β¦)` | Yes | The type of the data in this Field |
**`pagination` details** β See [Pagination](#pagination)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get a single Company
`GET /v2/companies/{companyId}`
- **Tag:** companies Β· **OperationId:** v2_companies_companyId__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
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](#permissions).
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `companyId` | `integer` | Yes | Company ID |
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `fieldIds` | `array` | No | Field IDs for which to return field data |
| `fieldTypes` | `array` | No | Field Types for which to return field data |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/companies/{companyId}' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: Company
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The company's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The company's name |
| `domain` | `string/null` | Yes | The company's primary domain |
| `domains` | `array>` | Yes | All of the company's domains |
| `isGlobal` | `boolean` | Yes | Whether or not the company is tenant specific |
| `fields` | `array` | No | The fields associated with the company |
**`domains` details** β All of the company's domains
**Items**
**`fields` details** β See [Field](#field)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The field's unique identifier |
| `name` | `string` | Yes | The field's name |
| `type` | `string (enum: `enriched`, `global`, `list`, `relationship-intelligence`)` | Yes | The field's type |
| `enrichmentSource` | `string/null (enum: `affinity-data`, `dealroom`, `None`)` | Yes | The source of the data in this Field (if it is enriched) |
| `value` | `oneOf` | Yes | |
Example
```json
{
"domain": "acme.co",
"domains": [
"acme.co"
],
"fields": [
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"continent": "North America",
"country": "United States",
"state": "California",
"streetAddress": "1 Main Street"
},
"type": "location"
}
},
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-description",
"name": "Description",
"type": "enriched",
"value": {
"data": "A leading provider of innovative solutions",
"type": "text"
}
}
],
"id": 1,
"isGlobal": true,
"name": "Acme"
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get a Company's List Entries
`GET /v2/companies/{companyId}/list-entries`
- **Tag:** companies Β· **OperationId:** v2_companies_companyId_list-entries__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
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](#permissions).
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `companyId` | `integer` | Yes | Company ID |
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/companies/{companyId}/list-entries' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: ListEntryPaged
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A page of ListEntry results |
| `pagination` | `object` | Yes | |
**`data` details** β See [ListEntry](#listentry)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The list entry's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `listId` | `integer` | Yes | The ID of the list that this list entry belongs to (Constraints: β₯ 1; β€ 9007199254740991) |
| `createdAt` | `string` | Yes | The date that the list entry was created |
| `creatorId` | `integer/null` | Yes | The ID of the user that created this list entry (Constraints: β₯ 1; β€ 9007199254740991) |
| `fields` | `array` | Yes | The fields associated with the list entry |
**`fields` details** β See [Field](#field)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The field's unique identifier |
| `name` | `string` | Yes | The field's name |
| `type` | `string (enum: `enriched`, `global`, `list`, `relationship-intelligence`)` | Yes | The field's type |
| `enrichmentSource` | `string/null (enum: `affinity-data`, `dealroom`, `None`)` | Yes | The source of the data in this Field (if it is enriched) |
| `value` | `oneOf` | Yes | |
**`pagination` details** β See [Pagination](#pagination)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
Example
```json
{
"data": [
{
"createdAt": "2023-01-01T00:00:00Z",
"creatorId": 1,
"fields": [
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"continent": "North America",
"country": "United States",
"state": "California",
"streetAddress": "1 Main Street"
},
"type": "location"
}
},
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"continent": "North America",
"country": "United States",
"state": "California",
"streetAddress": "1 Main Street"
},
"type": "location"
}
}
],
"id": 1,
"listId": 1
},
{
"createdAt": "2023-01-01T00:00:00Z",
"creatorId": 1,
"fields": [
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"continent": "North America",
"country": "United States",
"state": "California",
"streetAddress": "1 Main Street"
},
"type": "location"
}
},
{
"enrichmentSource": "affinity-data",
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"continent": "North America",
"country": "United States",
"state": "California",
"streetAddress": "1 Main Street"
},
"type": "location"
}
}
],
"id": 1,
"listId": 1
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get a Company's Lists
`GET /v2/companies/{companyId}/lists`
- **Tag:** companies Β· **OperationId:** v2_companies_companyId_lists__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
Paginate through all Lists where the given Company appears as an entry and that you have access to view.
Returns basic List information for each List that contains this Company.
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `companyId` | `integer` | Yes | Company ID |
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/companies/{companyId}/lists' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: ListPaged
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A page of List results |
| `pagination` | `object` | Yes | |
**`data` details** β See [List](#list)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the list (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The name of the list |
| `creatorId` | `integer` | Yes | The ID of the user that created this list (Constraints: β₯ 1; β€ 9007199254740991) |
| `ownerId` | `integer` | Yes | The ID of the user that owns this list (Constraints: β₯ 1; β€ 9007199254740991) |
| `isPublic` | `boolean` | Yes | Whether or not the list is public |
**`pagination` details** β See [Pagination](#pagination)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
Example
```json
{
"data": [
{
"creatorId": 1,
"id": 1,
"isPublic": false,
"name": "All companies",
"ownerId": 1
},
{
"creatorId": 1,
"id": 1,
"isPublic": false,
"name": "All companies",
"ownerId": 1
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get Notes for a Company
`GET /v2/companies/{companyId}/notes`
- **Tag:** companies Β· **OperationId:** v2_companies_companyId_notes__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
> **β οΈ This endpoint is currently in BETA**
Returns relevant notes for a given company which includes directly attached notes and notes attached to persons on this company.
You can filter notes using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties.
| **Property Name** | **Description** | **Type** | **Allowed Operators** | **Examples** |
|-----------------------------|-----------------------------------------------------------------|------------|--------------------------------------|---------------------------------|
| `creator.id` | Filter notes by the creator of the note | `int32` | `=` | `creator.id=1` |
| `createdAt` | Filter notes by when it was created | `datetime` | `>`, `<`, `>=`, `<=` | `createdAt<2025-02-04T10:48:24Z` |
| `updatedAt` | Filter notes by when it was updated | `datetime` | `>`, `<`, `>=`, `<=` | `updatedAt>=2025-02-03T10:48:24Z`|
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `companyId` | `integer` | Yes | Company's ID |
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `filter` | `string` | No | Filter options |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
| `totalCount` | `boolean` | No | Include total count of the collection in the pagination response |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/companies/{companyId}/notes' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: notes.NotesPaged
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A page of Note objects |
| `pagination` | `object` | Yes | |
**`data` details** β Note model See [notes.Note](#notesnote)
**Items**
**Variant:** notes.EntitiesNote
A Note object attached to an entity (Person, Company, Opportunity)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string` | Yes | The type of the note |
| `repliesCount` | `integer` | No | The number of replies to this note. This is only included if the `repliesCount` parameter is passed in the `includes` in the request and the note is not a reply itself. (Constraints: β₯ 0; β€ 2147483647) |
| `permissions` | `object` | No | The permission settings of a note (Constraints: stability `beta`) |
| `opportunitiesPreview` | `object` | No | A preview for attached Opportunities on a Note (Constraints: stability `beta`) |
| `personsPreview` | `object` | No | A preview for attached Persons on a Note (Constraints: stability `beta`) |
| `companiesPreview` | `object` | No | A preview for attached Companies on a Note (Constraints: stability `beta`) |
| `id` | `integer` | Yes | The id of the note (Constraints: β₯ 1; β€ 2147483647) |
| `content` | `object` | Yes | A note content (Constraints: stability `beta`) |
| `creator` | `object` | Yes | |
| `mentions` | `array (β€ 100 items)` | Yes | The mentions in the note |
| `createdAt` | `string` | Yes | The date and time the note was created |
| `updatedAt` | `string/null` | Yes | The date and time the note was last updated |
**`permissions` details** β See [notes.PermissionSettings](#notespermissionsettings)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sharingType` | `string (enum: `private`, `public`, `custom`)` | Yes | The sharing type of the note |
| `owner` | `object` | Yes | |
**`owner` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`opportunitiesPreview` details** β See [notes.OpportunitiesPreview](#notesopportunitiespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Opportunities for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β Opportunity model See [Opportunity](#opportunity)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the opportunity (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The name of the opportunity |
| `listId` | `integer` | Yes | The ID of the list that the opportunity belongs to (Constraints: β₯ 1; β€ 9007199254740991) |
**`personsPreview` details** β See [notes.PersonsPreview](#notespersonspreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Persons for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [PersonData](#persondata)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`companiesPreview` details** β See [notes.CompaniesPreview](#notescompaniespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Companies for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [CompanyData](#companydata)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The company's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The company's name |
| `domain` | `string/null` | Yes | The company's primary domain |
**`content` details** β See [notes.Content](#notescontent)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `html` | `string/null` | Yes | The HTML content of the note |
**`creator` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`mentions` details** β A mention in a note. See [notes.Mention](#notesmention)
**Items**
**Variant:** notes.PersonMention
A person mentioned in a note.
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the mention (Constraints: β₯ 1; β€ 2147483647) |
| `type` | `string` | Yes | The type of mention |
| `person` | `object` | Yes | |
**`person` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**Variant:** notes.InteractionNote
A Note object attached to an interaction (Email, Meeting, Call, ChatMessage)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string` | Yes | The type of the note |
| `interaction` | `oneOf` | Yes | An interaction attached to a Note. It can be a Meeting, a Call or an ChatMessage. (Constraints: stability `beta`) |
| `repliesCount` | `integer` | No | The number of replies to this note. This is only included if the `repliesCount` parameter is passed in the `includes` in the request and the note is not a reply itself. (Constraints: β₯ 0; β€ 2147483647) |
| `permissions` | `object` | No | The permission settings of a note (Constraints: stability `beta`) |
| `opportunitiesPreview` | `object` | No | A preview for attached Opportunities on a Note (Constraints: stability `beta`) |
| `personsPreview` | `object` | No | A preview for attached Persons on a Note (Constraints: stability `beta`) |
| `companiesPreview` | `object` | No | A preview for attached Companies on a Note (Constraints: stability `beta`) |
| `id` | `integer` | Yes | The id of the note (Constraints: β₯ 1; β€ 2147483647) |
| `content` | `object` | Yes | A note content (Constraints: stability `beta`) |
| `creator` | `object` | Yes | |
| `mentions` | `array (β€ 100 items)` | Yes | The mentions in the note |
| `createdAt` | `string` | Yes | The date and time the note was created |
| `updatedAt` | `string/null` | Yes | The date and time the note was last updated |
**`permissions` details** β See [notes.PermissionSettings](#notespermissionsettings)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sharingType` | `string (enum: `private`, `public`, `custom`)` | Yes | The sharing type of the note |
| `owner` | `object` | Yes | |
**`owner` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`opportunitiesPreview` details** β See [notes.OpportunitiesPreview](#notesopportunitiespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Opportunities for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β Opportunity model See [Opportunity](#opportunity)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the opportunity (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The name of the opportunity |
| `listId` | `integer` | Yes | The ID of the list that the opportunity belongs to (Constraints: β₯ 1; β€ 9007199254740991) |
**`personsPreview` details** β See [notes.PersonsPreview](#notespersonspreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Persons for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [PersonData](#persondata)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`companiesPreview` details** β See [notes.CompaniesPreview](#notescompaniespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Companies for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [CompanyData](#companydata)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The company's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The company's name |
| `domain` | `string/null` | Yes | The company's primary domain |
**`content` details** β See [notes.Content](#notescontent)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `html` | `string/null` | Yes | The HTML content of the note |
**`creator` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`mentions` details** β A mention in a note. See [notes.Mention](#notesmention)
**Items**
**Variant:** notes.PersonMention
A person mentioned in a note.
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the mention (Constraints: β₯ 1; β€ 2147483647) |
| `type` | `string` | Yes | The type of mention |
| `person` | `object` | Yes | |
**`person` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**Variant:** notes.AiNotetakerRootNote
A Root Note object created by the AI Notetaker
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string` | Yes | The type of the note |
| `interaction` | `object` | No | The meeting this AI Notetaker was invited to. (Constraints: stability `beta`) |
| `repliesCount` | `integer` | No | The number of replies to this note. This is only included if the `repliesCount` parameter is passed in the `includes` in the request and the note is not a reply itself. (Constraints: β₯ 0; β€ 2147483647) |
| `permissions` | `object` | No | The permission settings of a note (Constraints: stability `beta`) |
| `opportunitiesPreview` | `object` | No | A preview for attached Opportunities on a Note (Constraints: stability `beta`) |
| `personsPreview` | `object` | No | A preview for attached Persons on a Note (Constraints: stability `beta`) |
| `companiesPreview` | `object` | No | A preview for attached Companies on a Note (Constraints: stability `beta`) |
| `id` | `integer` | Yes | The id of the note (Constraints: β₯ 1; β€ 2147483647) |
| `content` | `object` | Yes | A note content (Constraints: stability `beta`) |
| `creator` | `object` | Yes | |
| `mentions` | `array (β€ 100 items)` | Yes | The mentions in the note |
| `createdAt` | `string` | Yes | The date and time the note was created |
| `updatedAt` | `string/null` | Yes | The date and time the note was last updated |
**`interaction` details** β See [notes.MeetingInteraction](#notesmeetinginteraction)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the Meeting (Event) (Constraints: β₯ 1; β€ 9007199254740991) |
| `type` | `string` | Yes | The type of the Interaction |
**`permissions` details** β See [notes.PermissionSettings](#notespermissionsettings)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sharingType` | `string (enum: `private`, `public`, `custom`)` | Yes | The sharing type of the note |
| `owner` | `object` | Yes | |
**`owner` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`opportunitiesPreview` details** β See [notes.OpportunitiesPreview](#notesopportunitiespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Opportunities for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β Opportunity model See [Opportunity](#opportunity)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the opportunity (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The name of the opportunity |
| `listId` | `integer` | Yes | The ID of the list that the opportunity belongs to (Constraints: β₯ 1; β€ 9007199254740991) |
**`personsPreview` details** β See [notes.PersonsPreview](#notespersonspreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Persons for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [PersonData](#persondata)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`companiesPreview` details** β See [notes.CompaniesPreview](#notescompaniespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | No | Preview of attached Companies for a Note |
| `totalCount` | `integer` | No | The total count of the collection parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [CompanyData](#companydata)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The company's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The company's name |
| `domain` | `string/null` | Yes | The company's primary domain |
**`content` details** β See [notes.Content](#notescontent)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `html` | `string/null` | Yes | The HTML content of the note |
**`creator` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`mentions` details** β A mention in a note. See [notes.Mention](#notesmention)
**Items**
**Variant:** notes.PersonMention
A person mentioned in a note.
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the mention (Constraints: β₯ 1; β€ 2147483647) |
| `type` | `string` | Yes | The type of mention |
| `person` | `object` | Yes | |
**`person` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**Variant:** notes.UserReplyNote
A reply to a note created by a user
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string` | Yes | The type of the note |
| `parent` | `object` | Yes | |
| `id` | `integer` | Yes | The id of the note (Constraints: β₯ 1; β€ 2147483647) |
| `content` | `object` | Yes | A note content (Constraints: stability `beta`) |
| `creator` | `object` | Yes | |
| `mentions` | `array (β€ 100 items)` | Yes | The mentions in the note |
| `createdAt` | `string` | Yes | The date and time the note was created |
| `updatedAt` | `string/null` | Yes | The date and time the note was last updated |
**`parent` details**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the parent note (Constraints: β₯ 1; β€ 2147483647) |
**`content` details** β See [notes.Content](#notescontent)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `html` | `string/null` | Yes | The HTML content of the note |
**`creator` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`mentions` details** β A mention in a note. See [notes.Mention](#notesmention)
**Items**
**Variant:** notes.PersonMention
A person mentioned in a note.
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the mention (Constraints: β₯ 1; β€ 2147483647) |
| `type` | `string` | Yes | The type of mention |
| `person` | `object` | Yes | |
**`person` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**Variant:** notes.AiNotetakerReplyNote
A reply to a Note, created by an AI Notetaker
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | `string` | Yes | The type of the note |
| `interaction` | `object` | No | The meeting this AI Notetaker was invited to. (Constraints: stability `beta`) |
| `parent` | `object` | Yes | |
| `id` | `integer` | Yes | The id of the note (Constraints: β₯ 1; β€ 2147483647) |
| `content` | `object` | Yes | A note content (Constraints: stability `beta`) |
| `creator` | `object` | Yes | |
| `mentions` | `array (β€ 100 items)` | Yes | The mentions in the note |
| `createdAt` | `string` | Yes | The date and time the note was created |
| `updatedAt` | `string/null` | Yes | The date and time the note was last updated |
**`interaction` details** β See [notes.MeetingInteraction](#notesmeetinginteraction)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the Meeting (Event) (Constraints: β₯ 1; β€ 9007199254740991) |
| `type` | `string` | Yes | The type of the Interaction |
**`parent` details**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the parent note (Constraints: β₯ 1; β€ 2147483647) |
**`content` details** β See [notes.Content](#notescontent)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `html` | `string/null` | Yes | The HTML content of the note |
**`creator` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`mentions` details** β A mention in a note. See [notes.Mention](#notesmention)
**Items**
**Variant:** notes.PersonMention
A person mentioned in a note.
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The id of the mention (Constraints: β₯ 1; β€ 2147483647) |
| `type` | `string` | Yes | The type of mention |
| `person` | `object` | Yes | |
**`person` details** β See [PersonData](#persondata)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The persons's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `firstName` | `string/null` | Yes | The person's first name |
| `lastName` | `string/null` | Yes | The person's last name |
| `primaryEmailAddress` | `string/null` | Yes | The person's primary email address |
| `type` | `string (enum: `internal`, `external`, `collaborator`)` | Yes | The person's type |
**`pagination` details** β See [PaginationWithTotalCount](#paginationwithtotalcount)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `totalCount` | `integer` | No | The total count of the collection. Only included if requested via the totalCount query string parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
## companyMerges
Operations about company merges
### Get All Company Merges
`GET /v2/company-merges`
- **Tag:** companyMerges Β· **OperationId:** v2_company-merges__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
> **β οΈ This endpoint is currently in BETA**
Retrieve paginated company merges for the organization.
Returns all company merges initiated by users in your organization, including their current
status, the companies involved, and merge details. You can filter company merges using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties:
| Property | Type | Operators | Values | Examples |
|----------|------|-----------|--------|----------|
| `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` |
| `taskId` | `string` | `=` | | `taskId=789e0123-e45b-67c8-d901-234567890123` |
Company merges are returned in reverse chronological order (most recent first).
Requires the "Manage duplicates" [permission](#permissions) and
organization admin role.
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
| `filter` | `string` | No | Filter company merges using Affinity Filtering Language |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/company-merges' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: CompanyMergeStatePaged
*Type:* object
Paginated list of company merge states
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | Array of company merge states |
| `pagination` | `object` | Yes | |
**`data` details** β Entity representing the state of an individual company merge See [CompanyMergeState](#companymergestate)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the merge (Constraints: β₯ 1; β€ 9007199254740991) |
| `status` | `string (enum: `in-progress`, `success`, `failed`)` | Yes | Current status of the merge |
| `taskId` | `string` | Yes | Identifier for the task this merge belongs to |
| `startedAt` | `string` | Yes | Timestamp when the merge started |
| `primaryCompanyId` | `integer` | Yes | ID of the primary company that other profiles were merged into (Constraints: β₯ 1; β€ 9007199254740991) |
| `duplicateCompanyId` | `integer` | Yes | ID of the duplicate company that was merged into the primary company (Constraints: β₯ 1; β€ 9007199254740991) |
| `completedAt` | `string/null` | Yes | Timestamp when the merge completed (success or failure) |
| `errorMessage` | `string/null` | Yes | Error message if the merge failed |
**`pagination` details** β See [Pagination](#pagination)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
Example: merges-list
```json
{
"data": [
{
"completedAt": "2025-06-03T10:32:15Z",
"duplicateCompanyId": 67890,
"errorMessage": null,
"id": 12,
"primaryCompanyId": 12345,
"startedAt": "2025-06-03T10:30:00Z",
"status": "success",
"taskId": "789e0123-e45b-67c8-d901-234567890123"
},
{
"completedAt": "2025-06-03T09:16:30Z",
"duplicateCompanyId": 98765,
"errorMessage": "Primary company not found",
"id": 13,
"primaryCompanyId": 54321,
"startedAt": "2025-06-03T09:15:00Z",
"status": "failed",
"taskId": "456e7890-1234-5678-9012-345678901234"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/companies/merge?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==",
"prevUrl": null
}
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Initiate Company Merge
`POST /v2/company-merges`
- **Tag:** companyMerges Β· **OperationId:** v2_company-merges__POST Β· **Stability:** `beta` Β· **Auth:** bearerAuth
> **β οΈ This endpoint is currently in BETA**
Initiate a company merge to combine a duplicate company profile into a primary company profile.
This is an asynchronous process that will merge all data from the duplicate company into the primary company. Once the merge is initiated, you can track its progress using the returned [task URL](#get-company-merge-task).
Requires the "Manage duplicates" [permission](#permissions) and organization admin role.
#### Request Body
**Media type:** `application/json`
Request body for initiating a company merge
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `primaryCompanyId` | `integer` | Yes | The ID of the company profile that will be kept after the merge. All data from the duplicate company will be merged into this company. (Constraints: β₯ 1; β€ 9007199254740991) |
| `duplicateCompanyId` | `integer` | Yes | The ID of the company profile that will be merged and then deleted. All data from this company will be transferred to the primary company. (Constraints: β₯ 1; β€ 9007199254740991) |
Example: merge-companies
```json
{
"duplicateCompanyId": 67890,
"primaryCompanyId": 12345
}
```
#### Example Request
```bash
curl --request POST 'https://api.affinity.co/v2/company-merges' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"primaryCompanyId":12345,"duplicateCompanyId":67890}'
```
#### Responses
##### 202 β application/json
Accepted
**Response schema (`application/json`):**
###### Schema: CompanyMergeResponse
*Type:* object
Response body for initiating a company merge
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `taskUrl` | `string` | Yes | URL to check the status of the merge task |
Example: merge-initiated
```json
{
"taskUrl": "https://api.affinity.co/v2/tasks/company-merges/123e4567-e89b-12d3-a456-426614174000"
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get Company Merge
`GET /v2/company-merges/{mergeId}`
- **Tag:** companyMerges Β· **OperationId:** v2_company-merges_mergeId__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
> **β οΈ This endpoint is currently in BETA**
Retrieve the status and details of a specific company merge.
Returns information about the company merge including its current status, the companies involved, timestamps, and any error information if the merge failed.
The `mergeId` can be obtained from the response of the [Get All Company Merges](#get-all-company-merges) endpoint, or by filtering company merges by task ID using `/v2/company-merges?filter=taskId={taskId}` after initiating a merge.
Requires the "Manage duplicates" [permission](#permissions) and organization admin role.
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `mergeId` | `integer` | Yes | Company merge ID |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/company-merges/{mergeId}' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: CompanyMergeState
*Type:* object
Entity representing the state of an individual company merge
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the merge (Constraints: β₯ 1; β€ 9007199254740991) |
| `status` | `string (enum: `in-progress`, `success`, `failed`)` | Yes | Current status of the merge |
| `taskId` | `string` | Yes | Identifier for the task this merge belongs to |
| `startedAt` | `string` | Yes | Timestamp when the merge started |
| `primaryCompanyId` | `integer` | Yes | ID of the primary company that other profiles were merged into (Constraints: β₯ 1; β€ 9007199254740991) |
| `duplicateCompanyId` | `integer` | Yes | ID of the duplicate company that was merged into the primary company (Constraints: β₯ 1; β€ 9007199254740991) |
| `completedAt` | `string/null` | Yes | Timestamp when the merge completed (success or failure) |
| `errorMessage` | `string/null` | Yes | Error message if the merge failed |
Example: completed-merge
```json
{
"completedAt": "2025-06-03T10:32:15Z",
"duplicateCompanyId": 67890,
"errorMessage": null,
"id": 12345,
"primaryCompanyId": 12345,
"startedAt": "2025-06-03T10:30:00Z",
"status": "success",
"taskId": "1ac19acd-674c-49a0-819a-cd674cc9a042"
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get All Company Merge Tasks
`GET /v2/tasks/company-merges`
- **Tag:** companyMerges Β· **OperationId:** v2_tasks_company-merges__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
> **β οΈ This endpoint is currently in BETA**
Retrieve paginated company merge tasks for the organization.
Returns all merge tasks initiated by users in your organization, including their current status,
the companies involved, and task details.
You can filter tasks using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties:
| Property | Type | Operators | Values | Examples |
|----------|------|-----------|--------|----------|
| `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` |
Tasks are returned in reverse chronological order (most recent first).
Requires the "Manage duplicates" [permission](#permissions) and
organization admin role.
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
| `filter` | `string` | No | Filter tasks using Affinity Filtering Language |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/tasks/company-merges' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: CompanyMergeTaskPaged
*Type:* object
Paginated list of company merge tasks
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | Array of company merge tasks |
| `pagination` | `object` | Yes | |
**`data` details** β Company merge task details and status for batch operations See [CompanyMergeTask](#companymergetask)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The unique identifier for this merge task |
| `status` | `string (enum: `in-progress`, `success`, `failed`)` | Yes | The current status of the batch operation |
| `resultsSummary` | `object` | Yes | Summary of merges in this batch task |
**`resultsSummary` details** β Summary of merges in this batch task
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `total` | `integer` | Yes | Total number of merges in the batch (Constraints: β₯ 0; β€ 2147483647) |
| `inProgress` | `integer` | Yes | Number of merges currently in progress (Constraints: β₯ 0; β€ 2147483647) |
| `success` | `integer` | Yes | Number of successfully completed merges (Constraints: β₯ 0; β€ 2147483647) |
| `failed` | `integer` | Yes | Number of failed merges (Constraints: β₯ 0; β€ 2147483647) |
**`pagination` details** β See [Pagination](#pagination)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
Example: tasks-list
```json
{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"resultsSummary": {
"failed": 0,
"inProgress": 0,
"success": 1,
"total": 1
},
"status": "success"
},
{
"id": "456e7890-e12b-34c5-d678-901234567890",
"resultsSummary": {
"failed": 1,
"inProgress": 0,
"success": 0,
"total": 1
},
"status": "failed"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/tasks/company-merges?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==",
"prevUrl": null
}
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get Company Merge Task
`GET /v2/tasks/company-merges/{taskId}`
- **Tag:** companyMerges Β· **OperationId:** v2_tasks_company-merges_taskId__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
> **β οΈ This endpoint is currently in BETA**
Retrieve the status and details of a specific task for company merges.
Returns information about the company merges for a specific task including its overall status,
number of merges in-progress, completed, and failed.
Detailed information about individual merges for this task can be found by querying:
`/v2/company-merges?filter=taskId={taskId}` See [Company
Merges](#get-all-company-merges) for more details.
Task statuses:
- `in-progress`: The merge task is currently being processed.
- `success`: The merge task completed successfully.
- `failed`: The merge task failed.
Requires the "Manage duplicates" [permission](#permissions) and
organization admin role.
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `taskId` | `string` | Yes | Company merge task ID |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/tasks/company-merges/{taskId}' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: CompanyMergeTask
*Type:* object
Company merge task details and status for batch operations
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | The unique identifier for this merge task |
| `status` | `string (enum: `in-progress`, `success`, `failed`)` | Yes | The current status of the batch operation |
| `resultsSummary` | `object` | Yes | Summary of merges in this batch task |
**`resultsSummary` details** β Summary of merges in this batch task
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `total` | `integer` | Yes | Total number of merges in the batch (Constraints: β₯ 0; β€ 2147483647) |
| `inProgress` | `integer` | Yes | Number of merges currently in progress (Constraints: β₯ 0; β€ 2147483647) |
| `success` | `integer` | Yes | Number of successfully completed merges (Constraints: β₯ 0; β€ 2147483647) |
| `failed` | `integer` | Yes | Number of failed merges (Constraints: β₯ 0; β€ 2147483647) |
Example: task-in-progress
```json
{
"id": "456e7890-e12b-34c5-d678-901234567890",
"resultsSummary": {
"failed": 0,
"inProgress": 1,
"success": 0,
"total": 1
},
"status": "in-progress"
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 403 β application/json
Forbidden
**Response schema (`application/json`):**
###### Schema: AuthorizationErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | AuthorizationError errors |
**`errors` details** β See [AuthorizationError](#authorizationerror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "authorization",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
## emails
Operations about emails
### Get metadata on all Emails
`GET /v2/emails`
- **Tag:** emails Β· **OperationId:** v2_emails__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
> **β οΈ This endpoint is currently in BETA**
Paginate through all emails in Affinity. Returns basic information about the email interaction
and its participants. Will only return emails or subject lines that the current authenticated
user has permission to see. This endpoint is currently in a Closed Beta; to get access reach
out to your Affinity CSM.
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
| `filter` | `string` | No | Filter options |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/emails' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: interactions.EmailPaged
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A page of Email results |
| `pagination` | `object` | Yes | |
**`data` details** β See [interactions.Email](#email)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The email's unique identifier (Constraints: β₯ 1; β€ 9007199254740991) |
| `sentAt` | `string` | Yes | The timestamp of when the email was sent |
| `loggingType` | `string` | Yes | Indicates how the interaction was added to Affinity: either manually by a user ('manual') or automatically through Affinity's capture process ('automated'). Currently, emails can only be logged as 'automated'. |
| `direction` | `string (enum: `sent`, `received`)` | Yes | The direction of the email: 'sent' if the email was sent by an internal user and 'received' if the email was sent to an internal user. |
| `subject` | `string/null` | Yes | The email's subject |
| `createdAt` | `string` | Yes | The timestamp of when the email was created |
| `updatedAt` | `string/null` | Yes | The timestamp of when the email was updated |
| `from` | `object` | Yes | The participant who sent the email |
| `toParticipantsPreview` | `object` | Yes | A preview of the participants in the 'To' field of the email (Constraints: stability `beta`) |
| `ccParticipantsPreview` | `object` | Yes | A preview of the participants who are cc'ed in the email (Constraints: stability `beta`) |
**`from` details** β See [Attendee](#attendee)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emailAddress` | `string/null` | Yes | The email addresses of the attendee |
| `person` | `oneOf` | Yes | |
**`toParticipantsPreview` details** β See [interactions.AttendeesPreview](#attendeespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A preview of Attendees |
| `totalCount` | `integer` | Yes | The total count of Attendees (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [Attendee](#attendee)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emailAddress` | `string/null` | Yes | The email addresses of the attendee |
| `person` | `oneOf` | Yes | |
**`ccParticipantsPreview` details** β See [interactions.AttendeesPreview](#attendeespreview)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A preview of Attendees |
| `totalCount` | `integer` | Yes | The total count of Attendees (Constraints: β₯ 0; β€ 9007199254740991) |
**`data` details** β See [Attendee](#attendee)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `emailAddress` | `string/null` | Yes | The email addresses of the attendee |
| `person` | `oneOf` | Yes | |
**`pagination` details** β See [PaginationWithTotalCount](#paginationwithtotalcount)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `totalCount` | `integer` | No | The total count of the collection. Only included if requested via the totalCount query string parameter. (Constraints: β₯ 0; β€ 9007199254740991) |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
## lists
Operations about lists
### Get metadata on all Lists
`GET /v2/lists`
- **Tag:** lists Β· **OperationId:** v2_lists__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
Paginate through all Lists in your organization that you have access to view.
Returns basic information about each List, including name, owner, and privacy settings.
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer` | No | Number of items to include in the page |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/lists' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: ListWithTypePaged
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | `array (β€ 100 items)` | Yes | A page of ListWithType results |
| `pagination` | `object` | Yes | |
**`data` details** β ListWithType model See [ListWithType](#listwithtype)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the list (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The name of the list |
| `creatorId` | `integer` | Yes | The ID of the user that created this list (Constraints: β₯ 1; β€ 9007199254740991) |
| `ownerId` | `integer` | Yes | The ID of the user that owns this list (Constraints: β₯ 1; β€ 9007199254740991) |
| `isPublic` | `boolean` | Yes | Whether or not the list is public |
| `type` | `string (enum: `company`, `opportunity`, `person`)` | Yes | The entity type for this list |
**`pagination` details** β See [Pagination](#pagination)
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `prevUrl` | `string/null` | No | URL for the previous page |
| `nextUrl` | `string/null` | No | URL for the next page |
Example: success
```json
{
"data": [
{
"creatorId": 1,
"id": 1,
"isPublic": false,
"name": "My Companies",
"ownerId": 1,
"type": "company"
},
{
"creatorId": 1,
"id": 2,
"isPublic": false,
"name": "My Persons",
"ownerId": 1,
"type": "person"
},
{
"creatorId": 1,
"id": 3,
"isPublic": false,
"name": "My Opportunities",
"ownerId": 1,
"type": "opportunity"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/lists?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/lists?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get metadata on a single List
`GET /v2/lists/{listId}`
- **Tag:** lists Β· **OperationId:** v2_lists_listId__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
Retrieve detailed information about a specific List you have access to view.
Returns List configuration including name, owner, privacy settings, and creation details.
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `listId` | `integer` | Yes | List ID |
#### Example Request
```bash
curl --request GET 'https://api.affinity.co/v2/lists/{listId}' \
--header 'Authorization: Bearer YOUR_API_KEY'
```
#### Responses
##### 200 β application/json
OK
**Response schema (`application/json`):**
###### Schema: ListWithType
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `integer` | Yes | The unique identifier for the list (Constraints: β₯ 1; β€ 9007199254740991) |
| `name` | `string` | Yes | The name of the list |
| `creatorId` | `integer` | Yes | The ID of the user that created this list (Constraints: β₯ 1; β€ 9007199254740991) |
| `ownerId` | `integer` | Yes | The ID of the user that owns this list (Constraints: β₯ 1; β€ 9007199254740991) |
| `isPublic` | `boolean` | Yes | Whether or not the list is public |
| `type` | `string (enum: `company`, `opportunity`, `person`)` | Yes | The entity type for this list |
Example: company-list
```json
{
"creatorId": 1,
"id": 1,
"isPublic": false,
"name": "My Companies",
"ownerId": 1,
"type": "company"
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 400 β application/json
Bad Request
**Response schema (`application/json`):**
###### Schema: responses.400
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | |
**`errors` details**
**Items**
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### 404 β application/json
Not Found
**Response schema (`application/json`):**
###### Schema: NotFoundErrors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | NotFoundError errors |
**`errors` details** β See [NotFoundError](#notfounderror)
**Items**
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
Example
```json
{
"errors": [
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
},
{
"code": "not-found",
"message": "π¨ Error! Sound the alarm! π¨"
}
]
}
```
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
##### DEFAULT β application/json
Errors
**Response schema (`application/json`):**
###### Schema: Errors
*Type:* object
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `errors` | `array` | Yes | Errors |
**`errors` details** β See [Error](#error)
**Items**
**Variant:** AuthenticationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** AuthorizationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** BadRequestError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ConflictError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** MethodNotAllowedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotAcceptableError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotFoundError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** NotImplementedError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** RateLimitError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ServerError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnprocessableEntityError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** UnsupportedMediaTypeError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
**Variant:** ValidationError
**Properties**
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Error code |
| `message` | `string` | Yes | Error message |
| `param` | `string` | Yes | Param the error refers to |
**Response Headers**
| Header | Type | Description |
| --- | --- | --- |
| `X-Ratelimit-Limit-User` | `integer` | Number of requests allowed per minute for the user |
| `X-Ratelimit-Limit-User-Remaining` | `integer` | Number of requests remaining for the user |
| `X-Ratelimit-Limit-User-Reset` | `integer` | Time in seconds before the limit resets for the user |
| `X-Ratelimit-Limit-Org` | `integer` | Number of requests allowed per month for the account |
| `X-Ratelimit-Limit-Org-Remaining` | `integer` | Number of requests remaining for the account |
| `X-Ratelimit-Limit-Org-Reset` | `integer` | Time in seconds before the limit resets for the account |
### Get metadata on a single List's Fields
`GET /v2/lists/{listId}/fields`
- **Tag:** lists Β· **OperationId:** v2_lists_listId_fields__GET Β· **Stability:** `beta` Β· **Auth:** bearerAuth
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.
#### Path Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `listId` | `integer` | Yes | List ID |
#### Query Parameters
| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `cursor` | `string` | No | Cursor for the next or previous page |
| `limit` | `integer