openapi: 3.0.3
info:
version: ''
x-affinity-api-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, 3rd party integrations, and for connecting Affinity to the rest of your tech\nstack.\n\nThe legacy Affinity v1 API can be found [here](https://api-docs.affinity.co/). The v2 API is not at\nfeature parity with v1 - we are continuing to develop new v2 APIs to support all v1 functionality\nover time.\n\n**The Affinity APIs are only available on select license types.** 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\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. The shape of a given response can vary depending on what \"type\" of\nobject or data is being returned. When this is the case, the response documentation will include a\ndropdown that can be used to select the \"type\" for which to display the response shape.\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. See\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\nProvide your API key as your bearer authentication token to start making calls to Affinity API v2.\n\nWe support one API key per user in your Affinity account. Your API key is able to read data and\nperform actions in Affinity on your behalf, so keep it safe as you would a password.\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 Affinity have this by default — Contact your Affinity admin if you are not able to generate\nan 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 require endpoint-specific permissions in-product. These permissions, along with\nthe \"Generate an API key\" permission, are managed by your Affinity admin in the Settings page. In\nthe description of each endpoint you will see the required permissions needed.\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 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## Filtering\n\nSome endpoints support a filtering language for flexible and powerful queries. This allows for the\ncreation of complex filter expressions using different operators and boolean logic in a single\nfilter string. The description of each endpoint will contain information on which filter properties\nand operators are supported.\n\n### Rules\n\n- Spaces are insignificant by default. For example, `field = hello` and `field=hello` are both\n valid.\n- If spaces are significant, they need to be inside double quotes, for example,\n `field = \"hello world\"`\n- Special characters need to be escaped with a backslash: `field=\"hello\\\" world\"`
Full list of\n special characters: `\\ * ~ ! & = > < $ ^ | \" ' ( ) ] [ /`\n- Use `&` and `|` for boolean operations: `foo = 1 | baz = 2 & bar = 3`. Boolean Algebra Logic is\n assumed: `&` takes precedence over `|`. When evaluating the condition above, `baz = 2 & bar = 3`\n will be computed first, and then the result will be `or`'ed with `foo=1`\n- Parentheses can be used to specify the order of operations. In the example above, to make sure\n that `foo = 1 | baz = 2` is evaluated first, parentheses must be placed\n `(foo = 1 | baz = 2) & bar = 3`\n\n### Grammar\n\n#### Simple Types\n\n| Definition | Property Type | Operator | Example |\n| ------------------------ | ---------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------- |\n| exact match | all | = | content = “hello world”
content=hello |\n| starts with | text | =^ | content =^ he |\n| ends with | text | =$ | content =$ llo |\n| contains | text | =~ | content =~ lo |\n| greater than | int32, int64, float, double, decimal, date, datetime | \\> | count > 1 |\n| greater than or equal to | int32, int64, float, double, decimal, date, datetime | \\>= | content >= 1 |\n| less than | int32, int64, float, double, decimal, date, datetime | \\< | count < 1 |\n| less than or equal to | int32, int64, float, double, decimal, date, datetime | \\<= | content <= 1 |\n| is NULL | all | != \\* | content != \\* |\n| is not NULL | all | =\\* | content = \\* |\n| is empty | text | =\"\" | content = \"\" |\n| negation | all | ! | content != ”hello world”
!(content = ”hello world”)
!(content =^ “hello world”) |\n\n#### Collections (all types)\n\n| Definition | Operator | Example |\n| ------------------------- | -------- | ------------------------------------ |\n| exact match with ordering | = | industries = [Healthcare,Fintech] |\n| contains all | =~ | industries =~ [Healthcare,Fintech] |\n| empty | =[] | industries =[] |\n| negation | ! | !(industries = [Healthcare,Fintech]) |\n\n## Error Codes\n\nHere is a list of the error codes the API will return if something goes wrong (see endpoint\ndocumentation for endpoint-specific errors):\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## Beta Endpoints\n\nYou’ll notice in our documentation that some endpoints will be marked as BETA. These endpoints are\nnewly released and will eventually progress to General Availability (GA). While an endpoint is in\nBETA there are some important things to consider:\n\n- The development of this endpoint may still be in progress. This means new capabilities, request\n parameters, response data, and performance improvements may be adjusted over time. Because of\n this, breaking changes may occur to the endpoint WITHOUT notice or versioning.\n- As this is an early release, bug fixes may still be ongoing as well, and we encourage you to\n report bugs to [support@affinity.co](mailto:support@affinity.co).\n- In addition, your feedback around the capabilities of the endpoint are highly valuable, please\n reach out to your CSM to provide feedback to our product team.\n\n# Data Model\n\n## The Basics\n\nThe three top-level objects in Affinity are **Persons, Companies, and Opportunities**. (Note:\nCompanies are called Organizations in the Affinity web app.) These have profiles in the Affinity web\napp and can be added to Lists.\n\nA **List** is a spreadsheet-like collection of rows tied to Persons, Companies, or Opportunities.\n\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 data,\n and information about who added the row to the List and when.\n- A given entity can be added to a List more than once. These List Entries can have different\n List-specific field data and List Entry-level metadata.\n\nEach column on a List maps to a **Field**. Fields show up within Affinity profile pages, extensions,\nand integrations. There are two categories of fields:\n\n- **List-specific fields** are scoped to a single List. In the API, their data can only be accessed\n through the List Entry resource.\n- **Global fields** belong to entities directly. These can include default fields, fields created by\n you, enrichment fields, or relationship intelligence fields. They can be accessed through the\n Person/Company/Opportunity resources and the List Entry resource.\n\n## Working with Field Data\n\n### Field Types and IDs\n\nHere is a deeper look at the types of Fields in Affinity, differentiated by the scope and source of\ntheir 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\\*Note that `filterable-text` and `filterable-text-multi` are special types that operate similarly\nto `dropdown` and `dropdown-multi`. They are reserved for Affinity-populated Fields, and users\ncannot 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 Persons,\n respectively. These are the Fields whose values are available to pull via GET `/v2/companies`, GET\n `/v2/companies/{id}`, GET `/v2/persons`, and `/v2/persons/{id}`.\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 are\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 Entry.\n\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## 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\n## May 14th, 2025\n\n- Renamed all path parameters named simply \"id\" to a more descriptive name (eg. \"personId\"). This\n will not have any effect on the API at runtime, but may impact code relying on the OpenAPI spec\n doing type generation.\n\n## April 9th, 2025\n\n- The following endpoints are no longer in BETA:\n\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## March 31st, 2025\n\n- The following beta endpoints now support updating association fields.\n\n| Method | URL | Summary |\n| ------ | ---------------------------------------------------------------- | ------------------------------------------------- |\n| PATCH | `/v2/lists/{listId}/list-entries/{listEntryId}/fields` | Perform batch operations on a list entry's fields |\n| POST | `/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}` | Update a single field value on a List Entry |\n\n## February 28th, 2025\n\n- Added the following endpoints in BETA:\n\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, 2025\n\n- Document `X-Ratelimit` headers in the schema for all endpoints.\n\n## January 15th, 2025\n\n- Add default responses to all endpoints to document all possible error codes that can be returned\n by the API.\n- Updated 400 error responses to correctly include the `bad-request` error code as a possible error.\n\n## December 3rd, 2024\n\n- Properly document `listId` property on `CompanyListEntry`, `PersonListEntry`, and\n `OpportunityListEntry` schemas.\n\n## September 25th, 2024\n\n- Upgrade schema to OpenAPI 3.1\n\n## August 5, 2024\n\n- Correct `opp` to `opportunity` to match documentation for the `List` `type` property.\n\n## July 24, 2024\n\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\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\", and\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) section\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\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 return\n basic entity data but not field data.\n\n## December 12, 2023\n\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) section\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 auth companyMerges API
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 company merges
name: companyMerges
x-stability-level: beta
paths:
/v2/company-merges:
get:
x-stability-level: beta
description: '| ⚠️ 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](#section/Getting-Started/Permissions) and
organization admin role.
'
summary: Get All Company Merges
operationId: v2_company-merges__GET
tags:
- companyMerges
parameters:
- name: cursor
description: Cursor for the next or previous page
in: query
schema:
type: string
example: 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
example: 100
- name: filter
description: Filter company merges using Affinity Filtering Language
in: query
schema:
type: string
example: status=failed | taskId=789e0123-e45b-67c8-d901-234567890123
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CompanyMergeStatePaged'
examples:
merges-list:
$ref: '#/components/examples/merges-list'
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'
post:
x-stability-level: beta
description: '| ⚠️ 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](#tag/companyMerges/operation/v2_tasks_company-merges_taskId__GET).
Requires the "Manage duplicates" [permission](#section/Getting-Started/Permissions) and organization admin role.'
summary: Initiate Company Merge
operationId: v2_company-merges__POST
tags:
- companyMerges
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CompanyMergeRequest'
examples:
merge-companies:
$ref: '#/components/examples/merge-companies'
responses:
'202':
description: Accepted
content:
application/json:
schema:
$ref: '#/components/schemas/CompanyMergeResponse'
examples:
merge-initiated:
$ref: '#/components/examples/merge-initiated'
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/company-merges/{mergeId}:
get:
x-stability-level: beta
description: '| ⚠️ 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](#tag/companyMerges/operation/v2_company-merges__GET) 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](#section/Getting-Started/Permissions) and organization admin role.'
summary: Get Company Merge
operationId: v2_company-merges_mergeId__GET
tags:
- companyMerges
parameters:
- name: mergeId
description: Company merge ID
in: path
required: true
schema:
type: integer
format: int64
minimum: 1
maximum: 9007199254740991
examples:
- 12345
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CompanyMergeState'
examples:
completed-merge:
$ref: '#/components/examples/succeeded-merge'
failed-merge:
$ref: '#/components/examples/failed-merge'
in-progress-merge:
$ref: '#/components/examples/in-progress-merge'
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/tasks/company-merges:
get:
x-stability-level: beta
description: '| ⚠️ 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](#section/Getting-Started/Permissions) and
organization admin role.
'
summary: Get All Company Merge Tasks
operationId: v2_tasks_company-merges__GET
tags:
- companyMerges
parameters:
- name: cursor
description: Cursor for the next or previous page
in: query
schema:
type: string
examples:
- ICAgICAgYmVmb3JlOjo6Nw
example: 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
example: 100
- name: filter
description: Filter tasks using Affinity Filtering Language
in: query
schema:
type: string
example: status=failed
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CompanyMergeTaskPaged'
examples:
tasks-list:
$ref: '#/components/examples/tasks-list-2'
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/tasks/company-merges/{taskId}:
get:
x-stability-level: beta
description: '| ⚠️ 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](#tag/companyMerges/operation/v2_company-merges__GET) 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](#section/Getting-Started/Permissions) and
organization admin role.
'
summary: Get Company Merge Task
operationId: v2_tasks_company-merges_taskId__GET
tags:
- companyMerges
parameters:
- name: taskId
description: Company merge task ID
in: path
required: true
schema:
type: string
format: uuid
examples:
- 123e4567-e89b-12d3-a456-426614174000
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CompanyMergeTask'
examples:
task-in-progress:
$ref: '#/components/examples/task-in-progress'
task-success:
$ref: '#/components/examples/task-success-2'
task-failed:
$ref: '#/components/examples/task-failed'
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'
components:
schemas:
BadRequestError:
title: BadRequestError
type: object
properties:
code:
description: Error code
type: string
enum:
- bad-request
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: bad-request
message: 🚨 Error! Sound the alarm! 🚨
RateLimitError:
title: RateLimitError
type: object
properties:
code:
description: Error code
type: string
enum:
- rate-limit
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: rate-limit
message: 🚨 Error! Sound the alarm! 🚨
ValidationError:
title: ValidationError
type: object
properties:
code:
description: Error code
type: string
enum:
- validation
message:
description: Error message
type: string
param:
description: Param the error refers to
type: string
required:
- code
- message
- param
additionalProperties: false
examples:
- code: validation
param: limit
message: 🚨 Error! Sound the alarm! 🚨
MethodNotAllowedError:
title: MethodNotAllowedError
type: object
properties:
code:
description: Error code
type: string
enum:
- method-not-allowed
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: method-not-allowed
message: 🚨 Error! Sound the alarm! 🚨
AuthorizationErrors:
title: AuthorizationErrors
description: AuthorizationErrors model
type: object
properties:
errors:
description: AuthorizationError errors
type: array
items:
$ref: '#/components/schemas/AuthorizationError'
required:
- errors
additionalProperties: false
examples:
- errors:
- code: authorization
message: 🚨 Error! Sound the alarm! 🚨
- code: authorization
message: 🚨 Error! Sound the alarm! 🚨
Errors:
title: Errors
type: object
properties:
errors:
description: Errors
type: array
items:
$ref: '#/components/schemas/Error'
required:
- errors
additionalProperties: false
UnsupportedMediaTypeError:
title: UnsupportedMediaTypeError
type: object
properties:
code:
description: Error code
type: string
enum:
- unsupported-media-type
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: unsupported-media-type
message: 🚨 Error! Sound the alarm! 🚨
Pagination:
title: Pagination
type: object
properties:
prevUrl:
description: URL for the previous page
type: string
format: uri
examples:
- https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw
nullable: true
nextUrl:
description: URL for the next page
type: string
format: uri
examples:
- https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA
nullable: true
examples:
- prevUrl: https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw
nextUrl: https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA
CompanyMergeStatePaged:
title: CompanyMergeStatePaged
description: Paginated list of company merge states
type: object
properties:
data:
description: Array of company merge states
type: array
maxItems: 100
items:
$ref: '#/components/schemas/CompanyMergeState'
pagination:
$ref: '#/components/schemas/Pagination'
required:
- data
- pagination
additionalProperties: false
NotAcceptableError:
title: NotAcceptableError
type: object
properties:
code:
description: Error code
type: string
enum:
- not-acceptable
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: not-acceptable
message: 🚨 Error! Sound the alarm! 🚨
NotFoundError:
title: NotFoundError
type: object
properties:
code:
description: Error code
type: string
enum:
- not-found
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: not-found
message: 🚨 Error! Sound the alarm! 🚨
AuthenticationError:
title: AuthenticationError
type: object
properties:
code:
description: Error code
type: string
enum:
- authentication
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: authentication
message: 🚨 Error! Sound the alarm! 🚨
NotImplementedError:
title: NotImplementedError
type: object
properties:
code:
description: Error code
type: string
enum:
- not-implemented
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: not-implemented
message: 🚨 Error! Sound the alarm! 🚨
ServerError:
title: ServerError
type: object
properties:
code:
description: Error code
type: string
enum:
- server
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: server
message: 🚨 Error! Sound the alarm! 🚨
AuthorizationError:
title: AuthorizationError
type: object
properties:
code:
description: Error code
type: string
enum:
- authorization
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: authorization
message: 🚨 Error! Sound the alarm! 🚨
CompanyMergeState:
title: CompanyMergeState
description: Entity representing the state of an individual company merge
type: object
properties:
id:
description: The unique identifier for the merge
type: integer
format: int64
minimum: 1
maximum: 9007199254740991
examples:
- 12345
status:
description: Current status of the merge
type: string
enum:
- in-progress
- success
- failed
examples:
- success
taskId:
description: Identifier for the task this merge belongs to
type: string
format: uuid
examples:
- 789e0123-e45b-67c8-d901-234567890123
startedAt:
description: Timestamp when the merge started
type: string
format: date-time
examples:
- '2025-06-03T10:30:00Z'
primaryCompanyId:
description: ID of the primary company that other profiles were merged into
type: integer
format: int64
minimum: 1
maximum: 9007199254740991
examples:
- 12345
duplicateCompanyId:
description: ID of the duplicate company that was merged into the primary company
type: integer
format: int64
minimum: 1
maximum: 9007199254740991
examples:
- 67890
completedAt:
description: Timestamp when the merge completed (success or failure)
type: string
format: date-time
examples:
- '2025-06-03T10:32:15Z'
- null
nullable: true
errorMessage:
description: Error message if the merge failed
type: string
examples:
- Primary company not found
- null
nullable: true
required:
- id
- status
- taskId
- startedAt
- primaryCompanyId
- duplicateCompanyId
- completedAt
- errorMessage
additionalProperties: false
CompanyMergeTaskPaged:
title: CompanyMergeTaskPaged
description: Paginated list of company merge tasks
type: object
properties:
data:
description: Array of company merge tasks
type: array
maxItems: 100
items:
$ref: '#/components/schemas/CompanyMergeTask'
examples:
- - id: 123e4567-e89b-12d3-a456-426614174000
status: success
resultsSummary:
total: 1
inProgress: 0
success: 1
failed: 0
- id: 456e7890-e12b-34c5-d678-901234567890
status: failed
resultsSummary:
total: 1
inProgress: 0
success: 0
failed: 1
pagination:
$ref: '#/components/schemas/Pagination'
required:
- data
- pagination
additionalProperties: false
NotFoundErrors:
title: NotFoundErrors
description: NotFoundErrors model
type: object
properties:
errors:
description: NotFoundError errors
type: array
items:
$ref: '#/components/schemas/NotFoundError'
required:
- errors
additionalProperties: false
examples:
- errors:
- code: not-found
message: 🚨 Error! Sound the alarm! 🚨
- code: not-found
message: 🚨 Error! Sound the alarm! 🚨
UnprocessableEntityError:
title: UnprocessableEntityError
type: object
properties:
code:
description: Error code
type: string
enum:
- unprocessable-entity
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: unprocessable-entity
message: 🚨 Error! Sound the alarm! 🚨
CompanyMergeResponse:
title: CompanyMergeResponse
description: Response body for initiating a company merge
type: object
properties:
taskUrl:
description: URL to check the status of the merge task
type: string
format: uri
examples:
- https://api.affinit.com/tasks/company-merges/123e4567-e89b-12d3-a456-426614174000
required:
- taskUrl
additionalProperties: false
CompanyMergeTask:
title: CompanyMergeTask
description: Company merge task details and status for batch operations
type: object
properties:
id:
description: The unique identifier for this merge task
type: string
format: uuid
examples:
- 123e4567-e89b-12d3-a456-426614174000
status:
description: The current status of the batch operation
type: string
enum:
- in-progress
- success
- failed
examples:
- in-progress
resultsSummary:
description: Summary of merges in this batch task
type: object
properties:
total:
description: Total number of merges in the batch
type: integer
format: int32
minimum: 0
maximum: 2147483647
examples:
- 5
inProgress:
description: Number of merges currently in progress
type: integer
format: int32
minimum: 0
maximum: 2147483647
examples:
- 2
success:
description: Number of successfully completed merges
type: integer
format: int32
minimum: 0
maximum: 2147483647
examples:
- 2
failed:
description: Number of failed merges
type: integer
format: int32
minimum: 0
maximum: 2147483647
examples:
- 1
required:
- total
- inProgress
- success
- failed
additionalProperties: false
required:
- id
- status
- resultsSummary
additionalProperties: false
Error:
title: Error
oneOf:
- $ref: '#/components/schemas/AuthenticationError'
- $ref: '#/components/schemas/AuthorizationError'
- $ref: '#/components/schemas/BadRequestError'
- $ref: '#/components/schemas/ConflictError'
- $ref: '#/components/schemas/MethodNotAllowedError'
- $ref: '#/components/schemas/NotAcceptableError'
- $ref: '#/components/schemas/NotFoundError'
- $ref: '#/components/schemas/NotImplementedError'
- $ref: '#/components/schemas/RateLimitError'
- $ref: '#/components/schemas/ServerError'
- $ref: '#/components/schemas/UnprocessableEntityError'
- $ref: '#/components/schemas/UnsupportedMediaTypeError'
- $ref: '#/components/schemas/ValidationError'
discriminator:
propertyName: code
mapping:
authentication: '#/components/schemas/AuthenticationError'
authorization: '#/components/schemas/AuthorizationError'
bad-request: '#/components/schemas/BadRequestError'
conflict: '#/components/schemas/ConflictError'
method-not-allowed: '#/components/schemas/MethodNotAllowedError'
not-acceptable: '#/components/schemas/NotAcceptableError'
not-found: '#/components/schemas/NotFoundError'
not-implemented: '#/components/schemas/NotImplementedError'
rate-limit: '#/components/schemas/RateLimitError'
server: '#/components/schemas/ServerError'
unprocessable-entity: '#/components/schemas/UnprocessableEntityError'
unsupported-media-type: '#/components/schemas/UnsupportedMediaTypeError'
validation: '#/components/schemas/ValidationError'
ConflictError:
title: ConflictError
type: object
properties:
code:
description: Error code
type: string
enum:
- conflict
message:
description: Error message
type: string
required:
- code
- message
additionalProperties: false
examples:
- code: conflict
message: 🚨 Error! Sound the alarm! 🚨
CompanyMergeRequest:
title: CompanyMergeRequest
description: Request body for initiating a company merge
type: object
properties:
primaryCompanyId:
description: 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.
type: integer
format: int64
minimum: 1
maximum: 9007199254740991
examples:
- 12345
duplicateCompanyId:
description: 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.
type: integer
format: int64
minimum: 1
maximum: 9007199254740991
examples:
- 67890
required:
- primaryCompanyId
- duplicateCompanyId
additionalProperties: false
examples:
merge-initiated:
x-stability-level: beta
summary: Merge task initiated
description: Response when a company merge task has been accepted for processing. The task ID can be used to track the progress of the merge task.
value:
taskUrl: https://api.affinity.co/v2/tasks/company-merges/123e4567-e89b-12d3-a456-426614174000
in-progress-merge:
x-stability-level: beta
summary: In-progress company merge
description: Example of a company merge currently being processed
value:
id: 98765
status: in-progress
taskId: 456e7890-e12b-34c5-d678-901234567890
startedAt: '2025-06-03T11:45:00Z'
primaryCompanyId: 24680
duplicateCompanyId: 13579
completedAt: null
errorMessage: null
merge-companies:
x-stability-level: beta
summary: Merge two company profiles
description: Example request to merge a duplicate company profile into a primary company profile. The primary company (ID 12345) will be kept and all data from the duplicate company (ID 67890) will be merged into it.
value:
primaryCompanyId: 12345
duplicateCompanyId: 67890
merges-list:
x-stability-level: beta
summary: List of company merges
description: Example response showing multiple company merges with different statuses
value:
data:
- id: 12
status: success
taskId: 789e0123-e45b-67c8-d901-234567890123
startedAt: '2025-06-03T10:30:00Z'
primaryCompanyId: 12345
duplicateCompanyId: 67890
completedAt: '2025-06-03T10:32:15Z'
errorMessage: null
- id: 13
status: failed
taskId: 456e7890-1234-5678-9012-345678901234
startedAt: '2025-06-03T09:15:00Z'
primaryCompanyId: 54321
duplicateCompanyId: 98765
completedAt: '2025-06-03T09:16:30Z'
errorMessage: Primary company not found
pagination:
nextUrl: https://api.affinity.co/v2/companies/merge?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==
prevUrl: null
task-success-2:
x-stability-level: beta
summary: Merge task succeeded
description: Example response showing a merge task that has been successfully completed.
value:
id: d8ff68ec-33d9-4d70-bf68-ec33d93d7092
status: success
resultsSummary:
total: 1
inProgress: 0
success: 1
failed: 0
tasks-list-2:
x-stability-level: beta
summary: List of company merge tasks
description: Example response showing multiple company merge tasks with different statuses
value:
data:
- id: 123e4567-e89b-12d3-a456-426614174000
status: success
resultsSummary:
total: 1
inProgress: 0
success: 1
failed: 0
- id: 456e7890-e12b-34c5-d678-901234567890
status: failed
resultsSummary:
total: 1
inProgress: 0
success: 0
failed: 1
pagination:
nextUrl: https://api.affinity.co/v2/tasks/company-merges?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==
prevUrl: null
task-in-progress:
x-stability-level: beta
summary: Merge task in progress
description: Example response showing a merge task that is currently being processed.
value:
id: 456e7890-e12b-34c5-d678-901234567890
status: in-progress
resultsSummary:
total: 1
inProgress: 1
success: 0
failed: 0
failed-merge:
x-stability-level: beta
summary: Failed company merge
description: Example of a failed company merge with error details
value:
id: 67890
status: failed
taskId: 789e0123-e45b-67c8-d901-234567890123
startedAt: '2025-06-03T09:15:00Z'
primaryCompanyId: 54321
duplicateCompanyId: 98765
completedAt: '2025-06-03T09:16:30Z'
errorMessage: Primary company not found
succeeded-merge:
x-stability-level: beta
summary: Succeeded company merge
description: Example of a successful company merge
value:
id: 12345
status: success
taskId: 1ac19acd-674c-49a0-819a-cd674cc9a042
startedAt: '2025-06-03T10:30:00Z'
primaryCompanyId: 12345
duplicateCompanyId: 67890
completedAt: '2025-06-03T10:32:15Z'
errorMessage: null
task-failed:
x-stability-level: beta
summary: Merge task failed
description: Example response showing a merge task that failed during processing.
value:
id: 012e3456-a78b-90c1-d234-567890123456
status: failed
resultsSummary:
total: 1
inProgress: 0
success: 0
failed: 1
headers:
X-Ratelimit-Limit-User-Remaining:
description: Number of requests remaining for the user
schema:
type: integer
X-Ratelimit-Limit-Org-Reset:
description: Time in seconds before the limit resets for the account
schema:
type: integer
X-Ratelimit-Limit-User:
description: Number of requests allowed per minute for the user
schema:
type: integer
X-Ratelimit-Limit-Org-Remaining:
description: Number of requests remaining for the account
schema:
type: integer
X-Ratelimit-Limit-User-Reset:
description: Time in seconds before the limit resets for the user
schema:
type: integer
X-Ratelimit-Limit-Org:
description: Number of requests allowed per month for the account
schema:
type: integer
responses:
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/NotFoundErrors'
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'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/AuthorizationErrors'
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':
description: Bad Request
content:
application/json:
schema:
title: responses.400
type: object
properties:
errors:
type: array
items:
oneOf:
- $ref: '#/components/schemas/BadRequestError'
- $ref: '#/components/schemas/ValidationError'
discriminator:
propertyName: code
mapping:
bad-request: '#/components/schemas/BadRequestError'
validation: '#/components/schemas/ValidationError'
required:
- errors
additionalProperties: false
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'
default:
description: Errors
content:
application/json:
schema:
$ref: '#/components/schemas/Errors'
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'
securitySchemes:
bearerAuth:
type: http
scheme: bearer