You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/v1/affinity_api_docs.md
+30-24Lines changed: 30 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ This markdown version of the Affinity API v1 documentation was generated automat
21
21
-**Direct raw access**
22
22
23
23
**Source:** Extracted from the live Affinity API documentation at https://api-docs.affinity.co/
24
-
**Documentation Version:** This copy is based on the official documentation as it appeared on **November 06, 2025 at 16:49:04 UTC** (Last updated: 11/06/2025 16:49:04 UTC).
24
+
**Documentation Version:** This copy is based on the official documentation as it appeared on **March 13, 2026 at 19:07:04 UTC** (Last updated: 03/13/2026 19:07:04 UTC).
@@ -38,7 +38,7 @@ This markdown version of the Affinity API v1 documentation was generated automat
38
38
39
39
## Table of Contents
40
40
41
-
-[Introduction](#introduction)
41
+
-[Introduction to API V1](#introduction-to-api-v1)
42
42
-[Getting Started](#getting-started)
43
43
-[Authentication](#authentication)
44
44
-[Requests & Responses](#requests--responses)
@@ -61,7 +61,6 @@ This markdown version of the Affinity API v1 documentation was generated automat
61
61
-[Getting Field Value Changes for Status Fields](#getting-field-value-changes-for-status-fields)
62
62
-[Getting the Strongest Relationship Strength Connection to an Organization on a List](#getting-the-strongest-relationship-strength-connection-to-an-organization-on-a-list)
63
63
-[Useful Resources](#useful-resources)
64
-
-[Partner With Us](#partner-with-us)
65
64
-[Lists](#lists)
66
65
-[The List Resource](#the-list-resource)
67
66
-[List Types](#list-types)
@@ -191,9 +190,9 @@ This markdown version of the Affinity API v1 documentation was generated automat
Welcome to the Affinity API! This API provides a RESTful interface for performing operations on the different objects that make up Affinity. If you are trying to accomplish an action through this API and are not sure on what endpoints to use, or if you have ideas on more endpoints we could create to make your workflow easier, please do not hesitate to contact us at [support@affinity.co](mailto:support@affinity.co).
195
+
Welcome to the Affinity V1 API! This API provides a RESTful interface for performing operations on the different objects that make up Affinity. The latest Affinity API (v2) can be found at https://developer.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.
To use the API, you will need to generate an API secret key. This can be done easily through the Settings Panel that is accessible through the left sidebar on the Affinity web app. For more support, visit the [How to obtain your API Key](https://support.affinity.co/hc/en-us/articles/360032633992-How-to-obtain-your-API-Key) article in our Help Center.
213
+
To use the API, you will need to generate an API secret key. This can be done easily through the Manage Apps Page in Affinity Settings. For more support, visit the [How to obtain your API Key](https://support.affinity.co/hc/en-us/articles/360032633992-How-to-obtain-your-API-Key) article in our Help Center.
215
214
216
215
Requests are authenticated using one of the following:
217
216
@@ -220,7 +219,9 @@ Requests are authenticated using one of the following:
220
219
|[HTTP Basic Auth](http://en.wikipedia.org/wiki/Basic_access_authentication)| Provide your API key as the basic auth password. You do not need to provide a username. |
221
220
|[HTTP Bearer Auth](https://swagger.io/docs/specification/v3_0/authentication/bearer-authentication/)| Provide your API key as the bearer token. |
222
221
223
-
Currently, we support one key per user on your team. Once you have generated a key, you will need to pass in the key with every API request for us to process it successfully. Otherwise, an error with a code of `401` will be returned.
222
+
Once you have generated a key, you will need to pass in the key with every API request for us to process it successfully. Otherwise, an error with a code of `401` will be returned.
223
+
224
+
To further secure an API key, you can define an IP Allowlist to limit which IP addresses or ranges can make API calls using that key.
224
225
225
226
#### Note
226
227
@@ -240,7 +241,7 @@ Here is a list of all the error codes the Affinity API returns in case something
240
241
| 403 | Forbidden -- Insufficient rights to a resource. |
241
242
| 404 | Not Found -- Requested resource does not exist. |
242
243
| 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. |
243
-
| 429 | Too Many Requests -- You have exceed the rate limit. |
244
+
| 429 | Too Many Requests -- You have exceeded the rate limit. |
244
245
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
245
246
| 503 | Service Unavailable -- This shouldn't generally happen. Either a deploy is in process, or Affinity services are down. |
246
247
@@ -276,7 +277,7 @@ Your account plan tier will limit the overall number of requests you can make pe
276
277
277
278
#### Note
278
279
279
-
> Professional tier customers who signed up for Affinity before July 5, 2023 are alotted 40,000 calls per month.
280
+
> Professional tier customers who signed up for Affinity before July 5, 2023 are allotted 40,000 calls per month.
280
281
281
282
This monthly account-level limit resets at the end of each calendar month.
282
283
@@ -377,7 +378,7 @@ Use the common use cases below to learn how Affinity API endpoints work.
377
378
378
379
#### Helpful Tips
379
380
380
-
> - To reduce API calls, create any initial backfills with the REST API then use [Webhooks](#webhooks) to keep data synced. You may want to schedule occasional syncs via the REST API to fixed any inconsistencies
381
+
> - To reduce API calls, create any initial backfills with the REST API then use [Webhooks](#webhooks) to keep data synced. You may want to schedule occasional syncs via the REST API to fix any inconsistencies
381
382
> - Your instance may contain multiple fields with the same name (e.g. Last Funding Date). To confirm the field ID, manually make an edit to the field in question and inspect the request payload for the bulk request. The field ID will be listed as `entityAttributeId`
382
383
> - The ID for a list, person, organization and opportunity can be found via the URL in the CRM. For a list `affinity.affinity.co/lists/[list_id]` and for a company profile `affinity.affinity.co/companies/[company_id]`
383
384
> - For large lists, use `page_size` and `page_token` parameters in the [`GET /lists/list_id}/list-entries`](#get-all-list-entries) endpoint to improve performance
@@ -701,10 +702,6 @@ GET /relationships-strengths Response:
If you're a developer interested in building an integration with Affinity's relationship intelligence platform for your customers, please [get in touch here](https://53mt2d9of77.typeform.com/to/LhEs2tzU).
707
-
708
705
# Lists
709
706
710
707
Lists are the primary data structure that you can interact with in Affinity. Each list manages a collection of either people, organizations or opportunities. We call people, organizations and opportunities "entities".
@@ -1836,27 +1833,30 @@ The action type specified below corresponds to the `action_type` of a field valu
1836
1833
1837
1834
`GET /field-value-changes`
1838
1835
1839
-
Returns all field values changes attached to a specific field. Field value changes can be filtered by `action_type`, `person`, `organization`, `opportunity` or `list_entry` by passing in the appropriate parameter.
1836
+
Returns all field values changes attached to a specific field. Field value changes can be filtered by `action_type`, `person`, `organization`, `opportunity`, `list_entry`, `changed_after` and `limit` by passing in the appropriate parameter.
1840
1837
1841
1838
### Query Parameters
1842
1839
1843
1840
| Parameter | Type | Required | Description |
1844
1841
| --- | --- | --- | --- |
1845
1842
| field_id | integer | true | A unique ID that represents a field object whose field values changes are to be retrieved. |
1846
1843
| action_type | integer | false | An integer that filters field value changes that were created with this specific action type (see above). |
1847
-
| person_id | integer | custom*| A unique ID that represents a person object whose field value changes are to be retrieved. |
1848
-
| organization_id | integer | custom*| A unique ID that represents an organization object whose field value changes are to be retrieved. |
1849
-
| opportunity_id | integer | custom*| A unique ID that represents an opportunity object whose field value changes are to be retrieved. |
1850
-
| list_entry_id | integer | custom*| A unique ID that represents a list entry object whose field value changes are to be retrieved. |
1844
+
| person_id | integer | false | A unique ID that represents a person object whose field value changes are to be retrieved. |
1845
+
| organization_id | integer | false | A unique ID that represents an organization object whose field value changes are to be retrieved. |
1846
+
| opportunity_id | integer | false | A unique ID that represents an opportunity object whose field value changes are to be retrieved. |
1847
+
| list_entry_id | integer | false | A unique ID that represents a list entry object whose field value changes are to be retrieved. |
1848
+
| changed_after | datetime | false | A timestamp that filters field value changes created at or after that time. |
1849
+
| limit | integer | false | An integer number that restricts the field value changes being returned. |
1851
1850
1852
1851
#### Returns
1853
1852
1854
1853
An array of all the field values changes associated with the supplied field and `person`, `organization`, `opportunity` or `list_entry` if specified.
1855
1854
1856
1855
#### Notes
1857
1856
1858
-
> - Exactly one of `person_id`, `organization_id`, `opportunity_id`, or `list_entry_id` must be specified to the endpoint.
1859
-
> - If a `person_id`, `organization_id`, or `opportunity_id` is specified, the endpoint returns all field value changes tied to these entities.
1857
+
> - The response is default-sorted by `changed_at` in descending order, ensuring that the most recent field value changes are returned first.
1858
+
> - The response may be filtered by providing at most one of the following parameters: `person_id`, `organization_id`, `opportunity_id`, or `list_entry_id`. If none are specified, the response encompasses all data for the given `field_id` across the organization. For fields with high volumes of data, organization-wide queries may be subject to timeouts; in these cases, the use of the `changed_after` and `limit` parameters is recommended.
1859
+
> - If a `person_id`, `organization_id`, or `opportunity_id` is specified, the endpoint returns all field value changes for the provided `field_id` tied to these entities.
1860
1860
> - If a `list_entry_id` is specified, the result is filtered by the `person_id`, `organization_id` or `opportunity_id` which is tied to the specified `list_entry_id`.
1861
1861
1862
1862
#### Example Request
@@ -1919,13 +1919,13 @@ Dates of the most recent and upcoming interactions with a person are available i
1919
1919
| first_name | string | The first name of the person. |
1920
1920
| last_name | string | The last name of the person. |
1921
1921
| emails | string[]| The email addresses of the person. |
1922
-
| primary_email | string | The email (automatically computed) that is most likely to the current active email address of the person. |
1922
+
| primary_email | string | The email (automatically computed) that is most likely to be the current active email address of the person. |
1923
1923
| organization_ids | integer[]| An array of unique identifiers of organizations that the person is associated with. |
1924
1924
| opportunity_ids | integer[]| An array of unique identifiers of opportunities that the person is associated with. Only returned when `with_opportunities=true`. |
1925
1925
| current_organization_ids | integer[]| An array of unique identifiers of organizations that the person is currently associated with according to the Affinity Data: Current Organization in-app column. Only returned when `with_current_organizations=true`. |
1926
1926
||||
1927
1927
| list_entries | ListEntry[]| An array of list entry resources associated with the person, only returned as part of the [Get a Specific Person](#get-a-specific-person) endpoint. |
1928
-
| interaction_dates | object | An object with seven string date fields representing the most recent and upcoming interactions with this person: `first_email_date`, `last_email_date`, `last_event_date`, `last_chat_message_date`, `last_interacton_date`, `first_event_date` and `next_event_date`. Only returned when passing `with_interaction_dates=true`. |
1928
+
| interaction_dates | object | An object with seven string date fields representing the most recent and upcoming interactions with this person: `first_email_date`, `last_email_date`, `last_event_date`, `last_chat_message_date`, `last_interaction_date`, `first_event_date` and `next_event_date`. Only returned when passing `with_interaction_dates=true`. |
1929
1929
| interactions | object | An object with seven fields nested underneath. Each field corresponds to one of the seven interactions, and includes nested fields for `date` and `person_ids` which indicates the internal people associated with that event. Only returned when passing `with_interaction_dates=true`. |
1930
1930
1931
1931
### Person types
@@ -2388,7 +2388,7 @@ Dates of the most recent and upcoming interactions with an organization are avai
2388
2388
| opportunity_ids | integer[]| An array of unique identifiers of opportunities that are associated with the organization |
2389
2389
| global | boolean | Returns whether this organization is a part of Affinity's global dataset of organizations. This is always false if the organization was created by you. |
2390
2390
| list_entries | ListEntry[]| An array of list entry resources associated with the organization, only returned as part of the [Get a specific organization](#get-a-specific-organization) endpoint. |
2391
-
| interaction_dates | object | An object with seven string date fields representing the most recent and upcoming interactions with this organization: `first_email_date`, `last_email_date`, `last_event_date`, `last_chat_message_date`, `last_interacton_date`, `first_event_date`, and `next_event_date`. Only returned when passing `with_interaction_dates=true`. |
2391
+
| interaction_dates | object | An object with seven string date fields representing the most recent and upcoming interactions with this organization: `first_email_date`, `last_email_date`, `last_event_date`, `last_chat_message_date`, `last_interaction_date`, `first_event_date`, and `next_event_date`. Only returned when passing `with_interaction_dates=true`. |
2392
2392
| interactions | object | An object with seven fields nested underneath. Each field corresponds to one of the seven interactions, and includes nested fields for `date` and `person_ids` which indicates the internal people associated with that event (people only returned if passing `with_interaction_persons=true`). Only returned when passing `with_interaction_dates=true`. |
0 commit comments