v1

latestOpenAPI 3.1.1Proprietary2026-07-2687313591.4 KB
Companies

Get Relationships for a Company

Returns the relationships for a given company, including the interaction score that measures the strength of each relationship based on communication patterns such as emails, meetings, and other interactions.

Each relationship includes two persons (person1 and person2) who have a connection related to this company.

Interaction score

The interactionScore is a value between 0.0 and 1.0 that reflects how frequently the two persons interact across email, calendar events, and chat messages. The more interactions, the higher the score. Recent interactions are weighted slightly higher than older ones. As rough guidance, scores at or above 0.7 typically indicate two persons that communicate regularly, scores between 0.4 and 0.7 indicate occasional communication, and scores below 0.4 indicate only sporadic communication.

LinkedIn connections

The collection also includes relationships based on a LinkedIn connection between an internal team member and a person related to this company. Whenever a LinkedIn connection exists between the two persons in a relationship, linkedIn is populated with the date the connection was made. linkedIn is null when no LinkedIn connection between the two persons is known by Affinity. Note that LinkedIn-based relationships which do not have any interaction data will have an interactionScore of 0.

Filters

You can filter relationships using the filter query parameter. The filter parameter is a string that you can specify conditions based on the following properties.

Property NameTypeDescriptionAllowed OperatorsExamples
interactionScoredoubleStrength of the relationship, between 0.0 and 1.0. Higher means stronger.>, <, >=, <=interactionScore>=0.5

Sorting

You can sort relationships using the orderBy query parameter. interactionScore is the only sortable property.

get/v2/companies/{companyId}/relationships

Path parameters

companyIdinteger required

Company ID

Query parameters

filterstring

Filter options

orderBystring[]

Properties to sort by. Defaults to -interactionScore. Prefix with - for descending order.

cursorstring

Cursor for the next or previous page

limitinteger

Number of items to include in the page

totalCountboolean

Include total count of the collection in the pagination response

Response

OK

Example response

{
  "data": [
    {
      "person1": {
        "id": 100,
        "firstName": "Jane",
        "lastName": "Smith",
        "primaryEmailAddress": "jane.smith@northpointvc.com"
      },
      "person2": {
        "id": 200,
        "firstName": "John",
        "lastName": "Doe",
        "primaryEmailAddress": "john.doe@acme.co"
      },
      "interactionScore": 0.72,
      "linkedIn": {
        "connectedOn": "2024-01-01"
      }
    }
  ],
  "pagination": {
    "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw",
    "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA"
  }
}