@planet-a/affinity-node
Version:
API wrapper for the affinity.co API
669 lines (668 loc) • 342 kB
JSON
{
"openapi": "3.1.0",
"info": {
"version": "2024-01-01",
"contact": {
"email": "support@affinity.co",
"name": "Affinity Support",
"url": "https://support.affinity.co"
},
"description": "# Introduction\n\nWelcome to Affinity API v2! This API provides a RESTful interface for building internal apps,\nautomated workflows, and other integrations on top of the core data models in Affinity, and for\nconnecting Affinity to the rest of your tech and data stack.\n\nPlease note that this new version of the API is not at feature parity with\n[Affinity API v1](https://api-docs.affinity.co/). We will add to this new version to cover more of\nv1's functionality over time. **This API version is also only available on select Affinity license\ntypes.** See\n[this Help Center article](https://support.affinity.co/hc/en-us/articles/5563700459533-Getting-started-with-the-Affinity-API-FAQs)\nor contact your Customer Success Manager for more information.\n\n# Getting Started\n\nAll Affinity API endpoints use the base URL `https://api.affinity.co`. All v2 endpoint paths start\nwith `/v2`. Requests must be sent over HTTPS.\n\n## Using These Docs\n\nThe first few sections of these docs cover general information on the API. Each subsequent section\ncovers a set of API endpoints.\n\nEach endpoint is documented with its accepted request parameters, expected response shapes, and a\nsample request and response. Please note that the shape of a given response can vary depending on\nwhat \"type\" of object or data is being returned. When this is the case, the response documentation\nwill include a dropdown that can be used to select the \"type\" for which to display the response\nshape.\n\n## Authentication\n\nAffinity API v2 uses API keys and **bearer authentication** (this is an important difference from\nAffinity API v1's use of basic authentication).\n\nTo generate an API key, navigate to the Settings page in the Affinity web app. You will need the\n\"Generate an API key\" role-based permission controlled by your Affinity admin to be able to do this.\nSee\n[this Help Center article](https://support.affinity.co/hc/en-us/articles/360032633992-How-to-obtain-your-API-Key)\nfor full instructions on API key generation, and\n[this article](https://support.affinity.co/hc/en-us/articles/360015976732-Account-Level-Permissions)\nfor more information on role-based permissions in Affinity.\n\nCurrently, we support one API key per user in your Affinity account. Your API key is able to read\ndata and perform actions in Affinity on your behalf, so keep it safe as you would a password.\n\nProvide your API key as your bearer authentication token to start making calls to Affinity API v2.\n\n## Permissions\n\n### Overall requirements\n\nYou must have the \"Generate an API key\" permission to be able to work with the Affinity API. Most\nusers in most Affinity accounts with API access have this by default — Contact your Affinity admin\nif you are not able to generate an API key, and see\n[this article](https://support.affinity.co/hc/en-us/articles/360015976732-Account-Level-Permissions)\nfor more information on role-based permissions in Affinity.\n\n### Resource-level permissions\n\nThe Affinity API respects sharing permissions that are set in-product. For example, if a given user\ndoes not have access to a list, note, or interaction in-product, they will not be able to see or\nmodify it via API.\n\n### Endpoint-level permissions\n\nMany API endpoints also require endpoint-specific permissions that map to permissions in-product.\nThese permissions, along with the \"Generate an API key\" permission, are managed by your Affinity\nadmin in the Settings page:\n\n| API v2 Endpoint | Required Permission |\n| ---------------------------------------------------------- | ------------------------------------ |\n| GET `/v2/companies` | \"Export All Organizations directory\" |\n| GET `/v2/companies/{id}` | \"Export All Organizations directory\" |\n| GET `/v2/companies/{id}/list-entries` | \"Export data from Lists\" |\n| GET `/v2/persons` | \"Export All People directory\" |\n| GET `/v2/persons/{id}` | \"Export All People directory\" |\n| GET `/v2/persons/{id}/list-entries` | \"Export data from Lists\" |\n| GET `/v2/opportunities` | \"Export data from Lists\" |\n| GET `/v2/opportunities/{id}` | \"Export data from Lists\" |\n| GET `/v2/lists/{listId}/list-entries` | \"Export data from Lists\" |\n| GET `/v2/lists/{listId}/saved-views/{viewId}/list-entries` | \"Export data from Lists\" |\n\n## Rate Limits\n\nThe Affinity API sets a limit on the number of calls that a user can make per minute, and that all\nthe users on an account can make per month. It also sets a reasonable limit on the number of\nconcurrent requests it will support from an account at one time.\n\nRequests to **both** Affinity API versions will count toward the one pool of requests allowed for a\nuser or account. Once a per-minute, monthly, or concurrent rate limit is hit, subsequent requests\nwill return an error code of 429. **We highly recommend designing your application to handle 429\nerrors.**\n\n### Per-Minute Limits (User-Level)\n\nTo help protect our systems, API requests will be halted at **900 per user, per minute.** We may\nalso lower this limit on a temporary basis to manage API availability.\n\n### Concurrent Request Limits (Account-Level)\n\nTo protect our systems and manage availability across customers, we set a reasonable limit on\nconcurrent requests at the account level. Customers should not expect to hit this limit unless they\nare hitting the API with heavy operations from many concurrent threads at once.\n\n### Monthly Plan Tier Limits (Account-Level)\n\nThe overall number of requests you can make per month will depend on your account's plan tier.\n**This monthly account-level limit resets at the end of each calendar month.** Current rate limits\nby plan tier are:\n\n| Plan Tier | Calls Per Month |\n| ---------- | --------------- |\n| Essentials | None |\n| Scale | 100k |\n| Advanced | 100k |\n| Enterprise | Unlimited\\* |\n\n\\*Per-Minute and Concurrent Request Limits still apply.\n\n### Rate Limit Headers\n\nAll API calls will return the following response headers with information about per-minute and\nmonthly limits:\n\n| Header | Description |\n| -------------------------------- | ------------------------------------------------------- |\n| X-Ratelimit-Limit-User | Number of requests allowed per minute for the user |\n| X-Ratelimit-Limit-User-Remaining | Number of requests remaining for the user |\n| X-Ratelimit-Limit-User-Reset | Time in seconds before the limit resets for the user |\n| X-Ratelimit-Limit-Org | Number of requests allowed per month for the account |\n| X-Ratelimit-Limit-Org-Remaining | Number of requests remaining for the account |\n| X-Ratelimit-Limit-Org-Reset | Time in seconds before the limit resets for the account |\n\n## Pagination\n\nWhen an endpoint is expected to return multiple results, we break the results up into pages to make\nthem easier to handle. To cycle forward through multiple pages of data, look for the `nextUrl`\nproperty in the `pagination` portion of an API response, and use it for your next request. See\nendpoint documentation for more information.\n\n## Error Codes\n\nHere is a list of the error codes this API will generally return if something goes wrong (see\nendpoint documentation for endpoint-specific error information):\n\n| Error Code | Meaning |\n| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 400 | Bad Request — See endpoint documentation for more information. |\n| 401 | Unauthorized — Your API key is invalid. |\n| 403 | Forbidden — Insufficient rights to a resource. |\n| 404 | Not Found — Requested resource does not exist. See endpoint documentation for more information. |\n| 405 | Method Not Allowed — The method being used is not supported for this resource. |\n| 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. |\n| 429 | Too Many Requests — You have exceeded the rate limit. |\n| 500 | Internal Server Error — We had a problem with our server. Try again later. |\n| 503 | Service Unavailable — This shouldn't generally happen. Contact us if you encounter this error. |\n\n# Data Model\n\n## The Basics\n\n- The three top-level objects in Affinity are **Persons, Companies, and Opportunities**. (Please\n note: Companies are called Organizations in the Affinity web app.) These have profiles in the\n Affinity web app and can be added to Lists.\n- A lot of the work of Affinity happens within Lists. A **List** is a spreadsheet-like collection of\n rows tied to Persons, Companies, or Opportunities.\n- Each row on a List is a **List Entry**. A List Entry contains data and metadata about a given\n Person, Company, or Opportunity in the context of a List. This includes list-specific field\ndata,\n and information about who added the row to the List and when.\n - Do note that a given entity can be added to a List more than once, i.e., it can have\nmultiple\n List Entries on the same List. These List Entries can have different list-specific field\ndata\n and List Entry-level metadata.\n- Each column on a List maps to a **Field**. Fields and field data also show up within Affinity\n profile pages, extensions, and integrations.\n - Some Fields are scoped to a single List — These are **list-specific fields**, and in the\nAPI,\n their data can only be accessed through the List Entry resource. \"Global\" data from other\nFields\n can be accessed both through the Person/Company/Opportunity resource and the List Entry\n resource.\n\n## Working with Field Data\n\n### Field Types and IDs\n\nThere are a few types of Fields in Affinity, differentiated by the scope and source of their data:\n\n| Field Type | Description | Example Fields | Field ID Pattern |\n| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |\n| `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`. |\n| `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` |\n| `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` |\n| `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` |\n\n### Field Value Types\n\nField data can take a variety of shapes. These value types are described in the Affinity Help Center\n[here](https://support.affinity.co/hc/en-us/articles/115001608232-How-to-create-a-new-column-in-a-list).\nHere is a list of the same value types, as represented in this API. Notice how array types end with\n`-multi`:\n\n| Single Type | Array Type |\n| ------------------- | ------------------------- |\n| `text` | Not supported in Affinity |\n| `number` | `number-multi` |\n| `datetime` | Not supported in Affinity |\n| `location` | `location-multi` |\n| `dropdown` | `dropdown-multi` |\n| `ranked-dropdown` | Not supported in Affinity |\n| `person` | `person-multi` |\n| `company` | `company-multi` |\n| `filterable-text`\\* | `filterable-text-multi`\\* |\n\n\\*Please note that `filterable-text` and `filterable-text-multi` are special types that operate\nsimilarly to `dropdown` and `dropdown-multi`. They are reserved for Affinity-populated Fields, and\nusers cannot create Fields with these types.\n\nWhen an array-typed value has no data in it, the API will return `null` (rather than an empty\narray).\n\n### Retrieving Field Data\n\nTo retrieve field data on companies, persons, or opportunities, call GET `/v2/companies`, GET\n`/v2/persons`, or one of our GET `*/list-entries` endpoints. (Note that Opportunities only have\nlist-specific Fields, so all their field data will live on the `*/list-entries` endpoints.) For most\nof these endpoints, you will need to specify the Fields for which you want data returned via the\n`fieldIds` or `fieldTypes` parameter — Otherwise, entities will be returned without any field data\nattached.\n\nThe GET `/v2/companies` and `/v2/persons` endpoints can return entities with enriched, global, and\nrelationship intelligence field data attached, but do not support list-specific field data. **To get\ncomprehensive field data including list-specific field data on Companies and Persons, use the GET\n`*/list-entries` endpoints.**\n\n### Specifying Desired Fields (Field Selection)\n\nAs mentioned above, you will need to specify the Fields (either by ID or by Type) for which you want\ndata returned when using the following endpoints:\n\n- GET `/v2/companies`\n- GET `/v2/companies/{id}`\n- GET `/v2/persons`\n- GET `/v2/persons/{id}`\n- GET `/v2/lists/{listId}/list-entries`\n\nEach of these endpoints has a `fieldIds` parameter that accepts an array of Field IDs, and a\n`fieldTypes` parameter that accepts an array of Field Types. Use the GET `*/fields` endpoints to get\nField IDs, Field Types, and other Field-level metadata:\n\n- Call GET `/v2/companies/fields` and `/v2/persons/fields` to get a list of the enriched, global,\n and relationship intelligence (AKA non-list-specific) Fields that exist on Companies and\nPersons,\n respectively. These are the Fields whose values are available to pull via GET `/v2/companies`,\nGET\n `/v2/companies/{id}`, GET `/v2/persons`, and `/v2/persons/{id}`.\n\n- Call GET `/v2/lists/{listId}/fields` to get a list of the enriched, global, relationship\n intelligence, **and list-specific** Fields for a given List. These are the Fields whose values\nare\n available to pull via GET `/v2/lists/{listId}/list-entries`.\n\nThe following endpoints don't require field selection:\n\n- GET `/v2/lists/{listId}/saved-views/{viewId}/list-entries` — See below. This endpoint returns just\n the field data that has been pulled into the given Saved View via UI.\n- GET `/v2/companies/{id}/list-entries` and GET `/v2/persons/{id}/list-entries` — These endpoints\n return comprehensive field data for the given person or company in the context of each List\nEntry.\n### Saved Views\n\nA Saved View allows a user to configure the Fields they want to see in the UI for a given List, and\nset filters and sorts on the rows on that List. A List can have multiple Saved Views. In the context\nof this API, Saved Views can be useful for specifying the exact Fields for which data is needed. The\n`*/saved-views/{viewId}/list-entries` endpoint also respects the filters that have been set on the\ngiven Saved View in the Affinity web app. (It does not, however, respect sorts just yet.)\n\n### Partner Data Restrictions\n\nThis API supports pulling data from\n[Affinity Data](https://support.affinity.co/hc/en-us/articles/360058255052-Affinity-Data) fields and\nselect\n[Dealroom fields](https://support.affinity.co/hc/en-us/articles/6106558518797-Dealroom-co-data-in-Affinity#h_01G2N22SVH7TJR3DJV3NQDE9HQ).\nDue the agreements we have with some of our data partners, the API does not expose data from the\nfollowing sources:\n\n- Crunchbase, including Crunchbase UUID\n- Pitchbook\n- [Dealroom \"exclusive\" fields](https://support.affinity.co/hc/en-us/articles/6106558518797-Dealroom-co-data-in-Affinity#h_01G2N22YEAZJ5TC1X9ENKZFWF5)\n\n## A Note on Nested Associations\n\nSome GET endpoints return \"association\" data under `fields`. For example, the Persons GET endpoints\nreturn data about which Companies a Person is associated with in Affinity. The Opportunities GET\nendpoints return similar data about associated Companies and Persons. The List Entries GET endpoints\nalso return this data for Person and Opportunity List Entries.\n\nThe API truncates these nested arrays of Persons or Companies **at 100 entries**. For example, if an\nOpportunity is associated with 200 Persons in Affinity, only 100 of those Persons will be returned\nby the GET `/opportunities` or `/opportunities/{id}` endpoint.\n\n# User Guides\n\n## A Tour of Our GET Endpoints\n\n| Desired Data | Relevant Endpoints | Notes |\n| ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |\n| 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 |\n| 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 |\n| Full rolodex of Companies or Persons in Affinity | GET `/v2/companies`, GET `/v2/persons` | Data from list-specific Fields will not be returned |\n| All the rows for a given Company or Person across all Lists | GET `/v2/companies/{id}/list-entries`, GET `/v2/persons/{id}/list-entries` | |\n| 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` |\n| Metadata on Lists or Saved Views | GET `/v2/lists`, GET `/v2/lists/{listId}/saved-views` | |\n| 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 | |\n\nTip: The ID for a List, Saved View, Person, Company, or Opportunity can always be found in its\nAffinity web app URL.\n\n# Changelog\n## February 28th, 2024\n- Added the following endpoints in BETA:\n|Method|URL|Summary|\n|--|--|--|\n|GET|`/v2/lists/{listId}/list-entries/{listEntryId}`|Get a single List Entry on a List|\n|GET|`/v2/lists/{listId}/list-entries/{listEntryId}/fields`|Get field values on a single List Entry|\n|PATCH|`/v2/lists/{listId}/list-entries/{listEntryId}/fields`|Perform batch operations on a list entry's fields|\n|GET|`/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}`|Get a single field value|\n|POST|`/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}`|Update a single field value on a List Entry|\n\n## January 17th, 2024\n- Document `X-Ratelimit` headers in the schema for all endpoints.\n## January 15th, 2024\n- Add default responses to all endpoints to document all possible error codes that can be returned by the API.\n- Updated 400 error responses to correctly include the `bad-request` error code as a possible error.\n## December 3rd, 2024\n- Properly document `listId` property on `CompanyListEntry`, `PersonListEntry`, and\n `OpportunityListEntry` schemas.\n\n## September 25th, 2024\n- Upgrade schema to Openapi 3.1\n## August 5, 2024\n- Correct `opp` to `opportunity` to match documentation for the `List` `type` property.\n## July 24, 2024\n- More accurate documentation for response properties that are enums — Enums with `null` as a\n possible value will have it listed as one.\n\n## March 25, 2024\n- Added the ability to retrieve the date and other details of your firm's \"First Email\", \"Last\n Email\", \"First Event\", \"Last Event\", \"Next Event\", \"First Chat Message\", \"Last Chat Message\",\nand\n \"Last Contact\" with a given entity. Use these timestamps to add relationship context to your\n applications, and to identify founders and companies that need investors' attention.\n- Endpoints that previously required a `fieldIds` parameter to return field data, now accept either\n `fieldIds` or `fieldTypes`, and will return field data accordingly. See the\n [Specifying Desired Fields (Field Selection)](#section/Data-Model/Working-with-Field-Data)\nsection\n of these docs for more information. The new `fieldTypes` parameter should make field data\n retrieval easier for users looking to pull data from many similar Fields at a time.\n\n## January 4, 2023\n- Most endpoints that return field data now require the user to use the `fieldIds` parameter to\n specify which Fields they want data for. Without `fieldIds` specified, these endpoints will\nreturn\n basic entity data but not field data.\n\n## December 12, 2023\n- Added the ability to retrieve metadata (e.g. ID, name, type, enrichment source, and data type) on\n Fields. See the [Retrieving Field Metadata](#section/Data-Model/Working-with-Field-Data)\nsection\n of these docs for more information.\n",
"license": {
"name": "Proprietary",
"url": "https://www.affinity.co/legal/terms-of-use"
},
"termsOfService": "https://www.affinity.co/legal/terms-of-use",
"title": "Affinity API v2",
"x-logo": {
"url": "https://s3.us-west-2.amazonaws.com/assets.affinity.co/img/logos/full-color-svg.svg",
"altText": "Affinity logo"
}
},
"servers": [
{
"url": "https://api.affinity.co"
}
],
"security": [
{
"bearerAuth": []
}
],
"tags": [
{
"description": "Operations about auths",
"name": "auth"
},
{
"description": "Operations about companies",
"name": "companies"
},
{
"description": "Operations about lists",
"name": "lists"
},
{
"description": "Operations about opportunities",
"name": "opportunities"
},
{
"description": "Operations about persons",
"name": "persons"
}
],
"paths": {
"/v2/auth/whoami": {
"get": {
"description": "Returns metadata about the current user.",
"summary": "Get current user",
"operationId": "getV2AuthWhoami",
"tags": [
"auth"
],
"responses": {
"200": {
"description": "Get current user",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WhoAmI"
}
}
},
"headers": {
"X-Ratelimit-Limit-User": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User"
},
"X-Ratelimit-Limit-User-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Remaining"
},
"X-Ratelimit-Limit-User-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Reset"
},
"X-Ratelimit-Limit-Org": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org"
},
"X-Ratelimit-Limit-Org-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Remaining"
},
"X-Ratelimit-Limit-Org-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Reset"
}
}
},
"404": {
"$ref": "#/components/responses/404"
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/v2/companies": {
"get": {
"description": "Paginate through Companies in Affinity.\nReturns basic information and non-list-specific field data on each Company.\n\nTo retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter\nto specify the Fields for which you want data returned.\nThese Field IDs and Types can be found using the GET `/v2/companies/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, Companies will be returned without any field data attached.\nTo supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this:\n`?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`.\n\nRequires the \"Export All Organizations directory\" [permission](#section/Getting-Started/Permissions).",
"summary": "Get all Companies",
"operationId": "getV2Companies",
"tags": [
"companies"
],
"parameters": [
{
"name": "cursor",
"description": "Cursor for the next or previous page",
"in": "query",
"schema": {
"type": "string",
"examples": [
"ICAgICAgYmVmb3JlOjo6Nw"
]
}
},
{
"name": "limit",
"description": "Number of items to include in the page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 100,
"default": 100,
"examples": [
100
]
}
},
{
"name": "ids",
"description": "Company IDs",
"in": "query",
"style": "form",
"explode": true,
"schema": {
"type": "array",
"items": {
"type": "integer",
"format": "int64",
"minimum": 1,
"maximum": 9223372036854776000
},
"examples": [
[
1
],
[
1,
2
]
]
}
},
{
"name": "fieldIds",
"description": "Field IDs for which to return field data",
"in": "query",
"style": "form",
"explode": true,
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "string"
},
"examples": [
[
"field-1"
],
[
"field-1",
"field-2"
]
]
}
},
{
"name": "fieldTypes",
"description": "Field Types for which to return field data",
"in": "query",
"style": "form",
"explode": true,
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "string",
"enum": [
"enriched",
"global",
"relationship-intelligence"
]
},
"examples": [
[
"enriched"
],
[
"enriched",
"global"
]
]
}
}
],
"responses": {
"200": {
"description": "Get all Companies",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CompanyPaged"
}
}
},
"headers": {
"X-Ratelimit-Limit-User": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User"
},
"X-Ratelimit-Limit-User-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Remaining"
},
"X-Ratelimit-Limit-User-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Reset"
},
"X-Ratelimit-Limit-Org": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org"
},
"X-Ratelimit-Limit-Org-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Remaining"
},
"X-Ratelimit-Limit-Org-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Reset"
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"403": {
"$ref": "#/components/responses/403"
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/v2/companies/{id}": {
"get": {
"description": "Returns basic information and non-list-specific field data on the requested Company.\n\nTo retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter\nto specify the Fields for which you want data returned.\nThese Field IDs and Types can be found using the GET `/v2/companies/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, Companies will be returned without any field data attached.\nTo supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this:\n`?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`.\n\nRequires the \"Export All Organizations directory\" [permission](#section/Getting-Started/Permissions).",
"summary": "Get a single Company",
"operationId": "getV2CompaniesId",
"tags": [
"companies"
],
"parameters": [
{
"name": "id",
"description": "Company ID",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64",
"minimum": 1,
"maximum": 9223372036854776000
}
},
{
"name": "fieldIds",
"description": "Field IDs for which to return field data",
"in": "query",
"style": "form",
"explode": true,
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "string"
}
}
},
{
"name": "fieldTypes",
"description": "Field Types for which to return field data",
"in": "query",
"style": "form",
"explode": true,
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "string",
"enum": [
"enriched",
"global",
"relationship-intelligence"
]
}
}
}
],
"responses": {
"200": {
"description": "Get a single Company",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Company"
}
}
},
"headers": {
"X-Ratelimit-Limit-User": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User"
},
"X-Ratelimit-Limit-User-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Remaining"
},
"X-Ratelimit-Limit-User-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Reset"
},
"X-Ratelimit-Limit-Org": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org"
},
"X-Ratelimit-Limit-Org-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Remaining"
},
"X-Ratelimit-Limit-Org-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Reset"
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"403": {
"$ref": "#/components/responses/403"
},
"404": {
"$ref": "#/components/responses/404"
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/v2/companies/fields": {
"get": {
"description": "Returns metadata on non-list-specific Company Fields.\n\nUse the returned Field IDs to request field data from the GET `/v2/companies` and GET `/v2/companies/{id}` endpoints.",
"summary": "Get metadata on Company Fields",
"operationId": "getV2CompaniesFields",
"tags": [
"companies"
],
"parameters": [
{
"name": "cursor",
"description": "Cursor for the next or previous page",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"description": "Number of items to include in the page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 100,
"default": 100
}
}
],
"responses": {
"200": {
"description": "Get metadata on Company Fields",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FieldMetadataPaged"
}
}
},
"headers": {
"X-Ratelimit-Limit-User": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User"
},
"X-Ratelimit-Limit-User-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Remaining"
},
"X-Ratelimit-Limit-User-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Reset"
},
"X-Ratelimit-Limit-Org": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org"
},
"X-Ratelimit-Limit-Org-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Remaining"
},
"X-Ratelimit-Limit-Org-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Reset"
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/v2/companies/{id}/lists": {
"get": {
"description": "Returns metadata for all the Lists on which the given Company appears.",
"summary": "Get a Company's Lists",
"operationId": "getV2CompaniesIdLists",
"tags": [
"companies"
],
"parameters": [
{
"name": "id",
"description": "Company ID",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64",
"minimum": 1,
"maximum": 9223372036854776000
}
},
{
"name": "cursor",
"description": "Cursor for the next or previous page",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"description": "Number of items to include in the page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 100,
"default": 100
}
}
],
"responses": {
"200": {
"description": "Get a Company's Lists",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListPaged"
}
}
},
"headers": {
"X-Ratelimit-Limit-User": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User"
},
"X-Ratelimit-Limit-User-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Remaining"
},
"X-Ratelimit-Limit-User-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Reset"
},
"X-Ratelimit-Limit-Org": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org"
},
"X-Ratelimit-Limit-Org-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Remaining"
},
"X-Ratelimit-Limit-Org-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Reset"
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"404": {
"$ref": "#/components/responses/404"
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/v2/companies/{id}/list-entries": {
"get": {
"description": "Paginate through the List Entries (AKA rows) for the given Company across all Lists.\nEach List Entry includes field data for the Company, including list-specific field data.\nEach List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).",
"summary": "Get a Company's List Entries",
"operationId": "getV2CompaniesIdListEntries",
"tags": [
"companies"
],
"parameters": [
{
"name": "id",
"description": "Company ID",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64",
"minimum": 1,
"maximum": 9223372036854776000
}
},
{
"name": "cursor",
"description": "Cursor for the next or previous page",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"description": "Number of items to include in the page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 100,
"default": 100
}
}
],
"responses": {
"200": {
"description": "Get a Company's List Entries",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListEntryPaged"
}
}
},
"headers": {
"X-Ratelimit-Limit-User": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User"
},
"X-Ratelimit-Limit-User-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Remaining"
},
"X-Ratelimit-Limit-User-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Reset"
},
"X-Ratelimit-Limit-Org": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org"
},
"X-Ratelimit-Limit-Org-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Remaining"
},
"X-Ratelimit-Limit-Org-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Reset"
}
}
},
"400": {
"$ref": "#/components/responses/400"
},
"403": {
"$ref": "#/components/responses/403"
},
"404": {
"$ref": "#/components/responses/404"
},
"default": {
"$ref": "#/components/responses/default"
}
}
}
},
"/v2/lists": {
"get": {
"description": "Returns metadata on Lists.",
"summary": "Get metadata on all Lists",
"operationId": "v2_lists__GET",
"tags": [
"lists"
],
"parameters": [
{
"name": "cursor",
"description": "Cursor for the next or previous page",
"in": "query",
"schema": {
"type": "string"
}
},
{
"name": "limit",
"description": "Number of items to include in the page",
"in": "query",
"schema": {
"type": "integer",
"format": "int32",
"minimum": 1,
"maximum": 100,
"default": 100
}
}
],
"responses": {
"200": {
"description": "Get metadata on all Lists",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ListWithTypePaged"
},
"examples": {
"success": {
"$ref": "#/components/examples/success"
}
}
}
},
"headers": {
"X-Ratelimit-Limit-User": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User"
},
"X-Ratelimit-Limit-User-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Remaining"
},
"X-Ratelimit-Limit-User-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-User-Reset"
},
"X-Ratelimit-Limit-Org": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org"
},
"X-Ratelimit-Limit-Org-Remaining": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Remaining"
},
"X-Ratelimit-Limit-Org-Reset": {
"$ref": "#/components/headers/X-Ratelimit-Limit-Org-Reset"
}
}
},
"400": {