diff --git a/affinity_model/.gitattributes b/affinity_model/.gitattributes index 59c92d7..77d290d 100644 --- a/affinity_model/.gitattributes +++ b/affinity_model/.gitattributes @@ -1 +1 @@ -v2.py linguist-generated=true +v2/ linguist-generated=true diff --git a/affinity_model/__init__.py b/affinity_model/__init__.py index 9b86552..105814c 100644 --- a/affinity_model/__init__.py +++ b/affinity_model/__init__.py @@ -1,8 +1,3 @@ -from pydantic import BaseModel, model_serializer - - -class MyBaseModel(BaseModel): - pass - +from .base import MyBaseModel __all__ = ["MyBaseModel", "v1", "v2"] diff --git a/affinity_model/base.py b/affinity_model/base.py new file mode 100644 index 0000000..4fa91cd --- /dev/null +++ b/affinity_model/base.py @@ -0,0 +1,5 @@ +from pydantic import BaseModel + + +class MyBaseModel(BaseModel): + pass diff --git a/affinity_model/tests/test_v2.py b/affinity_model/tests/test_v2.py new file mode 100644 index 0000000..b4f5a2a --- /dev/null +++ b/affinity_model/tests/test_v2.py @@ -0,0 +1,41 @@ +import pytest + +# Test that we can import the V2 model symbols +from affinity_model.v2 import ( + AuthenticationError, + Company, + Email, + Person, + Meeting, + Attendee, +) + + +def test_v2_model_imports(): + # Instantiate a few representative classes with minimal required fields + auth_error = AuthenticationError(code="authentication", message="msg") + company = Company(id=1, name="Acme", domains=[], isGlobal=False) + person = Person(id=1, firstName="John", emailAddresses=[], type="internal") + attendee = Attendee(emailAddress="test@example.com") + email = Email( + type="email", + id=1, + sentAt="2023-01-01T00:00:00Z", + to=[attendee], + cc=[], + **{"from": attendee}, + ) + meeting = Meeting( + type="meeting", + id=1, + title="Test Meeting", + allDay=False, + startTime="2023-01-01T00:00:00Z", + attendees=[], + ) + + assert auth_error.code == "authentication" + assert company.name == "Acme" + assert person.firstName == "John" + assert email.id == 1 + assert meeting.title == "Test Meeting" diff --git a/affinity_model/v2.py b/affinity_model/v2.py index 60a1113..5ecc44e 100644 --- a/affinity_model/v2.py +++ b/affinity_model/v2.py @@ -1,1457 +1,2 @@ -# generated by datamodel-codegen: -# filename: v2_spec.json - -from __future__ import annotations - -from datetime import datetime -from enum import Enum -from typing import Annotated, List, Literal - -from pydantic import AnyUrl, ConfigDict, Field, RootModel, constr - -from . import MyBaseModel - - -class AuthenticationError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["authentication"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class AuthorizationError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["authorization"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class BadRequestError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["bad-request"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class ConflictError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["conflict"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class MethodNotAllowedError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["method-not-allowed"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class NotAcceptableError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["not-acceptable"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class NotFoundError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["not-found"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class NotImplementedError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["not-implemented"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class RateLimitError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["rate-limit"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class ServerError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["server"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class UnprocessableEntityError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["unprocessable-entity"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class UnsupportedMediaTypeError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["unsupported-media-type"] - """ - Error code - """ - message: str - """ - Error message - """ - - -class ValidationError(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - code: Literal["validation"] - """ - Error code - """ - message: str - """ - Error message - """ - param: str - """ - Param the error refers to - """ - - -class Error( - RootModel[ - AuthenticationError - | AuthorizationError - | BadRequestError - | ConflictError - | MethodNotAllowedError - | NotAcceptableError - | NotFoundError - | NotImplementedError - | RateLimitError - | ServerError - | UnprocessableEntityError - | UnsupportedMediaTypeError - | ValidationError - ] -): - root: Annotated[ - AuthenticationError - | AuthorizationError - | BadRequestError - | ConflictError - | MethodNotAllowedError - | NotAcceptableError - | NotFoundError - | NotImplementedError - | RateLimitError - | ServerError - | UnprocessableEntityError - | UnsupportedMediaTypeError - | ValidationError, - Field(discriminator="code", title="Error"), - ] - - -class Errors(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - errors: List[Error] - """ - Errors - """ - - -class Tenant(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The tenant's unique identifier - """ - name: Annotated[str, Field(examples=["Contoso Ltd."])] - """ - The name of the tenant - """ - subdomain: Annotated[ - constr( - pattern=r"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9])$" - ), - Field(examples=["contoso"]), - ] - """ - The tenant's subdomain under affinity.co - """ - - -class User(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The user's unique identifier - """ - firstName: Annotated[str, Field(examples=["John"])] - """ - The user's first name - """ - lastName: Annotated[str | None, Field(examples=["Smith"])] = None - """ - The user's last name - """ - emailAddress: Annotated[str, Field(examples=["john.smith@contoso.com"])] - """ - The user's email address - """ - - -class Grant(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Annotated[Literal["api-key"], Field(examples=["api-key"])] - """ - The type of grant used to authenticate - """ - scopes: Annotated[List[str], Field(examples=[["api"]])] - """ - The scopes available to the current grant - """ - createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - When the grant was created - """ - - -class WhoAmI(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - tenant: Tenant - user: User - grant: Grant - - -class NotFoundErrors(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - errors: List[NotFoundError] - """ - NotFoundError errors - """ - - -class CompanyData(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The company's unique identifier - """ - name: Annotated[str, Field(examples=["Acme"])] - """ - The company's name - """ - domain: Annotated[str | None, Field(examples=["acme.co"])] = None - """ - The company's primary domain - """ - - -class CompanyValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["company"] - """ - The type of value - """ - data: CompanyData | None = None - - -class CompaniesValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["company-multi"] - """ - The type of value - """ - data: Annotated[List[CompanyData] | None, Field(max_length=100)] - """ - The values for many companies - """ - - -class DateValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["datetime"] - """ - The type of value - """ - data: datetime | None = None - """ - The value for a date - """ - - -class Dropdown(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - dropdownOptionId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - Dropdown item's unique identifier - """ - text: Annotated[str, Field(examples=["first"])] - """ - Dropdown item text - """ - - -class DropdownValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["dropdown"] - """ - The type of value - """ - data: Dropdown | None = None - - -class DropdownsValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["dropdown-multi"] - """ - The type of value - """ - data: List[Dropdown] | None - """ - The value for many dropdown items - """ - - -class FloatValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["number"] - """ - The type of value - """ - data: float | None = None - """ - The value for a number - """ - - -class FloatsValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["number-multi"] - """ - The type of value - """ - data: List[float] | None - """ - The value for many numbers - """ - - -class Type(Enum): - FILTERABLE_TEXT = "filterable-text" - TEXT = "text" - - -class TextValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Annotated[ - Literal["filterable-text", "text"], Field(examples=["filterable-text"]) - ] - """ - The type of value - """ - data: str | None = None - """ - The value for a string - """ - - -class LinkedInEntry(MyBaseModel): - link: str | None = None - text: str | None = None - - -class TextsValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["filterable-text-multi"] - """ - The type of value - """ - data: List[LinkedInEntry] | List[str] | None = None - """ - The value for many strings - """ - - -class FormulaNumber(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - calculatedValue: float | None = None - """ - Calculated value - """ - - -class FormulaValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["formula-number"] - """ - The type of value - """ - data: FormulaNumber | None = None - - -class Type1(Enum): - INTERNAL = "internal" - EXTERNAL = "external" - COLLABORATOR = "collaborator" - - -class PersonData(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The persons's unique identifier - """ - firstName: Annotated[str | None, Field(examples=["Jane"])] = None - """ - The person's first name - """ - lastName: Annotated[str | None, Field(examples=["Doe"])] = None - """ - The person's last name - """ - primaryEmailAddress: Annotated[str | None, Field(examples=["jane.doe@acme.co"])] = ( - None - ) - """ - The person's primary email address - """ - type: Annotated[Type1, Field(examples=["internal"])] - """ - The person's type - """ - - -class Direction(Enum): - RECEIVED = "received" - SENT = "sent" - - -class ChatMessage(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Annotated[Literal["chat-message"], Field(examples=["chat-message"])] - """ - The type of interaction - """ - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The chat message's unique identifier - """ - direction: Annotated[Direction, Field(examples=["outbound"])] - """ - The direction of the chat message - """ - sentAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - The time the chat message was sent - """ - manualCreator: PersonData - participants: List[PersonData] - """ - The participants of the chat - """ - - -class Attendee(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - emailAddress: Annotated[str | None, Field(examples=["john.smith@contoso.com"])] = ( - None - ) - """ - The email addresses of the attendee - """ - person: PersonData | None = None - - -class Email(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Annotated[Literal["email"], Field(examples=["email"])] - """ - The type of interaction - """ - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The email's unique identifier - """ - subject: Annotated[str | None, Field(examples=["Acme Upsell $10k"])] = None - """ - The subject of the email - """ - sentAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - The time the email was sent - """ - from_: Annotated[Attendee, Field(alias="from")] - to: List[Attendee] - """ - The recipients of the email - """ - cc: List[Attendee] - """ - The cc recipients of the email - """ - - -class Meeting(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Annotated[Literal["meeting"], Field(examples=["meeting"])] - """ - The type of interaction - """ - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The meeting's unique identifier - """ - title: Annotated[str | None, Field(examples=["Acme Upsell $10k"])] = None - """ - The meeting's title - """ - allDay: Annotated[bool, Field(examples=[False])] - """ - Whether the meeting is an all-day event - """ - startTime: Annotated[datetime, Field(examples=["2023-02-03T04:00:00Z"])] - """ - The meeting start time - """ - endTime: Annotated[datetime | None, Field(examples=["2023-02-03T05:00:00Z"])] = None - """ - The meeting end time - """ - attendees: List[Attendee] - """ - People attending the meeting - """ - - -class PhoneCall(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Annotated[Literal["call"], Field(examples=["call"])] - """ - The type of interaction - """ - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The phon_call's unique identifier - """ - startTime: Annotated[datetime, Field(examples=["2023-02-03T04:00:00Z"])] - """ - The call start time - """ - attendees: List[Attendee] - """ - People attending the call - """ - - -class Interaction(RootModel[ChatMessage | Email | Meeting | PhoneCall]): - root: Annotated[ - ChatMessage | Email | Meeting | PhoneCall, - Field(discriminator="type", title="Interaction"), - ] - - -class InteractionValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["interaction"] - """ - The type of value - """ - data: Interaction | None = None - - -class Location(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - streetAddress: Annotated[str | None, Field(examples=["170 Columbus Ave"])] = None - """ - Street address - """ - city: Annotated[str | None, Field(examples=["San Francisco"])] = None - """ - City - """ - state: Annotated[str | None, Field(examples=["California"])] = None - """ - State - """ - country: Annotated[str | None, Field(examples=["United States"])] = None - """ - Country - """ - continent: Annotated[str | None, Field(examples=["North America"])] = None - """ - Continent - """ - - -class LocationValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["location"] - """ - The type of value - """ - data: Location | None = None - - -class LocationsValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["location-multi"] - """ - The type of value - """ - data: List[Location] | None - """ - The values for many locations - """ - - -class PersonValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["person"] - """ - The type of value - """ - data: PersonData | None = None - - -class PersonsValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["person-multi"] - """ - The type of value - """ - data: Annotated[List[PersonData] | None, Field(max_length=100)] - """ - The values for many persons - """ - - -class RankedDropdown(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - dropdownOptionId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - Dropdown item's unique identifier - """ - text: Annotated[str, Field(examples=["first"])] - """ - Dropdown item text - """ - rank: Annotated[int, Field(examples=[0], ge=0, le=9007199254740991)] - """ - Dropdown item rank - """ - color: Annotated[str | None, Field(examples=["white"])] = None - """ - Dropdown item color - """ - - -class RankedDropdownValue(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - type: Literal["ranked-dropdown"] - """ - The type of value - """ - data: RankedDropdown | None = None - - -class FieldValue( - RootModel[ - CompaniesValue - | CompanyValue - | DateValue - | DropdownsValue - | DropdownValue - | FloatsValue - | FloatValue - | FormulaValue - | InteractionValue - | LocationsValue - | LocationValue - | PersonsValue - | PersonValue - | RankedDropdownValue - | TextsValue - | TextValue - ] -): - root: Annotated[ - CompaniesValue - | CompanyValue - | DateValue - | DropdownsValue - | DropdownValue - | FloatsValue - | FloatValue - | FormulaValue - | InteractionValue - | LocationsValue - | LocationValue - | PersonsValue - | PersonValue - | RankedDropdownValue - | TextsValue - | TextValue, - Field( - discriminator="type", - examples=[ - { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California", - }, - "type": "location", - } - ], - title="FieldValue", - ), - ] - - -class Type2(Enum): - ENRICHED = "enriched" - GLOBAL_ = "global" - LIST = "list" - RELATIONSHIP_INTELLIGENCE = "relationship-intelligence" - - -class EnrichmentSource(Enum): - AFFINITY_DATA = "affinity-data" - DEALROOM = "dealroom" - NONE_TYPE_NONE = None - - -class FieldModel(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[str, Field(examples=["affinity-data-location"])] - """ - The field's unique identifier - """ - name: Annotated[str, Field(examples=["Location"])] - """ - The field's name - """ - type: Annotated[Type2, Field(examples=["enriched"])] - """ - The field's type - """ - enrichmentSource: Annotated[ - EnrichmentSource | None, Field(examples=["affinity-data"]) - ] - """ - The source of the data in this Field (if it is enriched) - """ - value: FieldValue - - -class Company(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The company's unique identifier - """ - name: Annotated[str, Field(examples=["Acme"])] - """ - The company's name - """ - domain: Annotated[str | None, Field(examples=["acme.co"])] = None - """ - The company's primary domain - """ - domains: Annotated[List[str], Field(examples=[["acme.co"]])] - """ - All of the company's domains - """ - isGlobal: Annotated[bool, Field(examples=[True])] - """ - Whether or not the company is tenant specific - """ - fields: List[FieldModel] | None = None - """ - The fields associated with the company - """ - - -class Pagination(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - prevUrl: Annotated[ - AnyUrl | None, - Field( - examples=["https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"] - ), - ] = None - """ - URL for the previous page - """ - nextUrl: Annotated[ - AnyUrl | None, - Field( - examples=["https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA"] - ), - ] = None - """ - URL for the next page - """ - - -class CompanyPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[Company], Field(max_length=100)] - """ - A page of Company results - """ - pagination: Pagination - - -class AuthorizationErrors(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - errors: List[AuthorizationError] - """ - AuthorizationError errors - """ - - -class ValueType(Enum): - PERSON = "person" - PERSON_MULTI = "person-multi" - COMPANY = "company" - COMPANY_MULTI = "company-multi" - FILTERABLE_TEXT = "filterable-text" - FILTERABLE_TEXT_MULTI = "filterable-text-multi" - NUMBER = "number" - NUMBER_MULTI = "number-multi" - DATETIME = "datetime" - LOCATION = "location" - LOCATION_MULTI = "location-multi" - TEXT = "text" - RANKED_DROPDOWN = "ranked-dropdown" - DROPDOWN = "dropdown" - DROPDOWN_MULTI = "dropdown-multi" - FORMULA_NUMBER = "formula-number" - INTERACTION = "interaction" - - -class FieldMetadata(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[str, Field(examples=["affinity-data-location"])] - """ - The field's unique identifier - """ - name: Annotated[str, Field(examples=["Location"])] - """ - The field's name - """ - type: Annotated[Type2, Field(examples=["enriched"])] - """ - The field's type - """ - enrichmentSource: Annotated[ - EnrichmentSource | None, Field(examples=["affinity-data"]) - ] - """ - The source of the data in this Field (if it is enriched) - """ - valueType: Annotated[ValueType, Field(examples=["location"])] - """ - The type of the data in this Field - """ - - -class FieldMetadataPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[FieldMetadata], Field(max_length=100)] - """ - A page of FieldMetadata results - """ - pagination: Pagination - - -class ListModel(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The unique identifier for the list - """ - name: Annotated[str, Field(examples=["All companies"])] - """ - The name of the list - """ - creatorId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the user that created this list - """ - ownerId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the user that owns this list - """ - isPublic: Annotated[bool, Field(examples=[False])] - """ - Whether or not the list is public - """ - - -class ListPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[ListModel], Field(max_length=100)] - """ - A page of List results - """ - pagination: Pagination - - -class ListEntry(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The list entry's unique identifier - """ - listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the list that this list entry belongs to - """ - createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - The date that the list entry was created - """ - creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( - None - ) - """ - The ID of the user that created this list entry - """ - fields: List[FieldModel] - """ - The fields associated with the list entry - """ - - -class ListEntryPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[ListEntry], Field(max_length=100)] - """ - A page of ListEntry results - """ - pagination: Pagination - - -class Type4(Enum): - COMPANY = "company" - OPPORTUNITY = "opportunity" - PERSON = "person" - - -class ListWithType(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The unique identifier for the list - """ - name: Annotated[str, Field(examples=["All companies"])] - """ - The name of the list - """ - creatorId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the user that created this list - """ - ownerId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the user that owns this list - """ - isPublic: Annotated[bool, Field(examples=[False])] - """ - Whether or not the list is public - """ - type: Annotated[Type4, Field(examples=["company"])] - """ - The entity type for this list - """ - - -class ListWithTypePaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[ListWithType], Field(max_length=100)] - """ - A page of ListWithType results - """ - pagination: Pagination - - -class CompanyListEntry(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The list entry's unique identifier - """ - type: Annotated[Literal["company"], Field(examples=["company"])] - """ - The entity type for this list entry - """ - listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the list that this list entry belongs to - """ - createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - The date that the list entry was created - """ - creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( - None - ) - """ - The ID of the user that created this list entry - """ - entity: Company - - -class OpportunityWithFields(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The unique identifier for the opportunity - """ - name: Annotated[str, Field(examples=["Acme Upsell $10k"])] - """ - The name of the opportunity - """ - listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the list that the opportunity belongs to - """ - fields: List[FieldModel] | None = None - """ - The fields associated with the opportunity - """ - - -class OpportunityListEntry(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The list entry's unique identifier - """ - type: Annotated[Literal["opportunity"], Field(examples=["opportunity"])] - """ - The entity type for this list entry - """ - listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the list that this list entry belongs to - """ - createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - The date that the list entry was created - """ - creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( - None - ) - """ - The ID of the user that created this list entry - """ - entity: OpportunityWithFields - - -class Type5(Enum): - INTERNAL = "internal" - EXTERNAL = "external" - - -class Person(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The persons's unique identifier - """ - firstName: Annotated[str, Field(examples=["Jane"])] - """ - The person's first name - """ - lastName: Annotated[str | None, Field(examples=["Doe"])] = None - """ - The person's last name - """ - primaryEmailAddress: Annotated[str | None, Field(examples=["jane.doe@acme.co"])] = ( - None - ) - """ - The person's primary email address - """ - emailAddresses: Annotated[ - List[str], Field(examples=[["jane.doe@acme.co", "janedoe@gmail.com"]]) - ] - """ - All of the person's email addresses - """ - type: Annotated[Type5, Field(examples=["internal"])] - """ - The person's type - """ - fields: List[FieldModel] | None = None - """ - The fields associated with the person - """ - - -class PersonListEntry(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The list entry's unique identifier - """ - type: Annotated[Literal["person"], Field(examples=["person"])] - """ - The entity type for this list entry - """ - listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the list that this list entry belongs to - """ - createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - The date that the list entry was created - """ - creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( - None - ) - """ - The ID of the user that created this list entry - """ - entity: Person - - -class ListEntryWithEntity( - RootModel[CompanyListEntry | OpportunityListEntry | PersonListEntry] -): - root: Annotated[ - CompanyListEntry | OpportunityListEntry | PersonListEntry, - Field( - discriminator="type", - examples=[ - { - "createdAt": "2023-01-01T00:00:00Z", - "creatorId": 1, - "id": 1, - "type": "company", - "entity": { - "domain": "acme.co", - "name": "Acme", - "isGlobal": True, - "domains": ["acme.co"], - "id": 1, - "fields": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California", - }, - "type": "location", - }, - }, - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California", - }, - "type": "location", - }, - }, - ], - }, - } - ], - title="ListEntryWithEntity", - ), - ] - - -class ListEntryWithEntityPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[ListEntryWithEntity] | None, Field(max_length=100)] - """ - A page of ListEntryWithEntity results - """ - pagination: Pagination - - -class Type6(Enum): - SHEET = "sheet" - BOARD = "board" - DASHBOARD = "dashboard" - - -class SavedView(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[28], ge=1, le=9007199254740991)] - """ - The saved view's unique identifier - """ - name: Annotated[str, Field(examples=["my interesting companies"])] - """ - The saved view's name - """ - type: Annotated[Type6, Field(examples=["sheet"])] - """ - The type for this saved view - """ - createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] - """ - The date that the saved view was created - """ - - -class SavedViewPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[SavedView], Field(max_length=100)] - """ - A page of SavedView results - """ - pagination: Pagination - - -class Opportunity(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The unique identifier for the opportunity - """ - name: Annotated[str, Field(examples=["Acme Upsell $10k"])] - """ - The name of the opportunity - """ - listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] - """ - The ID of the list that the opportunity belongs to - """ - - -class OpportunityPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[Opportunity], Field(max_length=100)] - """ - A page of Opportunity results - """ - pagination: Pagination - - -class PersonPaged(MyBaseModel): - model_config = ConfigDict( - extra="forbid", - ) - data: Annotated[List[Person], Field(max_length=100)] - """ - A page of Person results - """ - pagination: Pagination +from .v2 import * +from .v2.interactions import * diff --git a/affinity_model/v2/__init__.py b/affinity_model/v2/__init__.py new file mode 100644 index 0000000..2f62196 --- /dev/null +++ b/affinity_model/v2/__init__.py @@ -0,0 +1,1842 @@ +# generated by datamodel-codegen: +# filename: v2_spec.json + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Annotated, List, Literal +from uuid import UUID + +from pydantic import AnyUrl, ConfigDict, Field, RootModel, constr + +from ..base import MyBaseModel + + +class AuthenticationError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["authentication"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class AuthorizationError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["authorization"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class BadRequestError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["bad-request"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class ConflictError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["conflict"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class MethodNotAllowedError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["method-not-allowed"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class NotAcceptableError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["not-acceptable"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class NotFoundError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["not-found"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class NotImplementedError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["not-implemented"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class RateLimitError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["rate-limit"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class ServerError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["server"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class UnprocessableEntityError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["unprocessable-entity"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class UnsupportedMediaTypeError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["unsupported-media-type"] + """ + Error code + """ + message: str + """ + Error message + """ + + +class ValidationError(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + code: Literal["validation"] + """ + Error code + """ + message: str + """ + Error message + """ + param: str + """ + Param the error refers to + """ + + +class Error( + RootModel[ + AuthenticationError + | AuthorizationError + | BadRequestError + | ConflictError + | MethodNotAllowedError + | NotAcceptableError + | NotFoundError + | NotImplementedError + | RateLimitError + | ServerError + | UnprocessableEntityError + | UnsupportedMediaTypeError + | ValidationError + ] +): + root: Annotated[ + AuthenticationError + | AuthorizationError + | BadRequestError + | ConflictError + | MethodNotAllowedError + | NotAcceptableError + | NotFoundError + | NotImplementedError + | RateLimitError + | ServerError + | UnprocessableEntityError + | UnsupportedMediaTypeError + | ValidationError, + Field(discriminator="code", title="Error"), + ] + + +class Errors(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + errors: List[Error] + """ + Errors + """ + + +class Tenant(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The tenant's unique identifier + """ + name: Annotated[str, Field(examples=["Contoso Ltd."])] + """ + The name of the tenant + """ + subdomain: Annotated[ + constr( + pattern=r"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9])$" + ), + Field(examples=["contoso"]), + ] + """ + The tenant's subdomain under affinity.co + """ + + +class User(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The user's unique identifier + """ + firstName: Annotated[str, Field(examples=["John"])] + """ + The user's first name + """ + lastName: Annotated[str | None, Field(examples=["Smith"])] = None + """ + The user's last name + """ + emailAddress: Annotated[str, Field(examples=["john.smith@contoso.com"])] + """ + The user's email address + """ + + +class Type(Enum): + API_KEY = "api-key" + ACCESS_TOKEN = "access-token" + + +class Grant(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Annotated[Type, Field(examples=["api-key"])] + """ + The type of grant used to authenticate + """ + scopes: Annotated[List[str], Field(examples=[["api"]])] + """ + The scopes available to the current grant + """ + createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + When the grant was created + """ + + +class WhoAmI(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + tenant: Tenant + user: User + grant: Grant + + +class NotFoundErrors(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + errors: List[NotFoundError] + """ + NotFoundError errors + """ + + +class Type1(Enum): + INTERNAL = "internal" + EXTERNAL = "external" + COLLABORATOR = "collaborator" + + +class PersonData(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The persons's unique identifier + """ + firstName: Annotated[str | None, Field(examples=["Jane"])] = None + """ + The person's first name + """ + lastName: Annotated[str | None, Field(examples=["Doe"])] = None + """ + The person's last name + """ + primaryEmailAddress: Annotated[str | None, Field(examples=["jane.doe@acme.co"])] = ( + None + ) + """ + The person's primary email address + """ + type: Annotated[Type1, Field(examples=["internal"])] + """ + The person's type + """ + + +class Participant(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + emailAddress: Annotated[str, Field(examples=["jane.doe@gmail.com"])] + """ + The email address of the participant + """ + person: PersonData | None = None + """ + The participant's metadata (this can be null if we do not find a corresponding person to the email address) + """ + + +class ParticipantsPreview(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[Participant], Field(max_length=100)] + """ + A preview of Participants + """ + totalCount: Annotated[int, Field(examples=[200], ge=0, le=9007199254740991)] + """ + The total count of Participants + """ + + +class Pagination(MyBaseModel): + prevUrl: Annotated[ + AnyUrl | None, + Field( + examples=["https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"] + ), + ] = None + """ + URL for the previous page + """ + nextUrl: Annotated[ + AnyUrl | None, + Field( + examples=["https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA"] + ), + ] = None + """ + URL for the next page + """ + + +class PaginationWithTotalCount(Pagination): + totalCount: Annotated[int | None, Field(ge=0, le=9007199254740991)] = None + """ + The total count of the collection. Only included if requested via the totalCount query string parameter. + """ + + +class CompanyData(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The company's unique identifier + """ + name: Annotated[str, Field(examples=["Acme"])] + """ + The company's name + """ + domain: Annotated[str | None, Field(examples=["acme.co"])] = None + """ + The company's primary domain + """ + + +class CompanyValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["company"] + """ + The type of value + """ + data: CompanyData | None = None + + +class CompaniesValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["company-multi"] + """ + The type of value + """ + data: Annotated[List[CompanyData] | None, Field(max_length=100)] + """ + The values for many companies + """ + + +class DateValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["datetime"] + """ + The type of value + """ + data: datetime | None = None + """ + The value for a date + """ + + +class Dropdown(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dropdownOptionId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + Dropdown item's unique identifier + """ + text: Annotated[str, Field(examples=["first"])] + """ + Dropdown item text + """ + + +class DropdownValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["dropdown"] + """ + The type of value + """ + data: Dropdown | None = None + + +class DropdownsValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["dropdown-multi"] + """ + The type of value + """ + data: List[Dropdown] | None + """ + The value for many dropdown items + """ + + +class FloatValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["number"] + """ + The type of value + """ + data: float | None = None + """ + The value for a number + """ + + +class FloatsValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["number-multi"] + """ + The type of value + """ + data: List[float] | None + """ + The value for many numbers + """ + + +class Type2(Enum): + FILTERABLE_TEXT = "filterable-text" + TEXT = "text" + + +class TextValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Annotated[ + Literal["filterable-text", "text"], Field(examples=["filterable-text"]) + ] + """ + The type of value + """ + data: str | None = None + """ + The value for a string + """ + + +class LinkedInEntry(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + link: str | None = None + text: str | None = None + + +class TextsValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["filterable-text-multi"] + """ + The type of value + """ + data: List[LinkedInEntry] | List[str] | None = None + """ + The value for many strings + """ + + +class FormulaNumber(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + calculatedValue: float | None = None + """ + Calculated value + """ + + +class FormulaValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["formula-number"] + """ + The type of value + """ + data: FormulaNumber | None = None + + +class Direction(Enum): + RECEIVED = "received" + SENT = "sent" + + +class ChatMessage(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Annotated[Literal["chat-message"], Field(examples=["chat-message"])] + """ + The type of interaction + """ + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The chat message's unique identifier + """ + direction: Annotated[Direction, Field(examples=["sent"])] + """ + The direction of the chat message + """ + sentAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The time the chat message was sent + """ + manualCreator: PersonData + participants: List[PersonData] + """ + The participants of the chat + """ + + +class Attendee(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + emailAddress: Annotated[str | None, Field(examples=["john.smith@contoso.com"])] = ( + None + ) + """ + The email addresses of the attendee + """ + person: PersonData | None = None + + +class Email(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Annotated[Literal["email"], Field(examples=["email"])] + """ + The type of interaction + """ + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The email's unique identifier + """ + subject: Annotated[str | None, Field(examples=["Acme Upsell $10k"])] = None + """ + The subject of the email + """ + sentAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The time the email was sent + """ + from_: Annotated[Attendee, Field(alias="from")] + to: List[Attendee] + """ + The recipients of the email + """ + cc: List[Attendee] + """ + The cc recipients of the email + """ + + +class Meeting(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Annotated[Literal["meeting"], Field(examples=["meeting"])] + """ + The type of interaction + """ + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The meeting's unique identifier + """ + title: Annotated[str | None, Field(examples=["Acme Upsell $10k"])] = None + """ + The meeting's title + """ + allDay: Annotated[bool, Field(examples=[False])] + """ + Whether the meeting is an all-day event + """ + startTime: Annotated[datetime, Field(examples=["2023-02-03T04:00:00Z"])] + """ + The meeting start time + """ + endTime: Annotated[datetime | None, Field(examples=["2023-02-03T05:00:00Z"])] = None + """ + The meeting end time + """ + attendees: List[Attendee] + """ + People attending the meeting + """ + + +class PhoneCall(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Annotated[Literal["call"], Field(examples=["call"])] + """ + The type of interaction + """ + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The phon_call's unique identifier + """ + startTime: Annotated[datetime, Field(examples=["2023-02-03T04:00:00Z"])] + """ + The call start time + """ + attendees: List[Attendee] + """ + People attending the call + """ + + +class Interaction(RootModel[ChatMessage | Email | Meeting | PhoneCall]): + root: Annotated[ + ChatMessage | Email | Meeting | PhoneCall, + Field(discriminator="type", title="Interaction"), + ] + + +class InteractionValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["interaction"] + """ + The type of value + """ + data: Interaction | None = None + + +class Location(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + streetAddress: Annotated[str | None, Field(examples=["1 Main Street"])] = None + """ + Street address + """ + city: Annotated[str | None, Field(examples=["San Francisco"])] = None + """ + City + """ + state: Annotated[str | None, Field(examples=["California"])] = None + """ + State + """ + country: Annotated[str | None, Field(examples=["United States"])] = None + """ + Country + """ + continent: Annotated[str | None, Field(examples=["North America"])] = None + """ + Continent + """ + + +class LocationValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["location"] + """ + The type of value + """ + data: Location | None = None + + +class LocationsValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["location-multi"] + """ + The type of value + """ + data: List[Location] | None + """ + The values for many locations + """ + + +class PersonValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["person"] + """ + The type of value + """ + data: PersonData | None = None + + +class PersonsValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["person-multi"] + """ + The type of value + """ + data: Annotated[List[PersonData] | None, Field(max_length=100)] + """ + The values for many persons + """ + + +class RankedDropdown(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dropdownOptionId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + Dropdown item's unique identifier + """ + text: Annotated[str, Field(examples=["first"])] + """ + Dropdown item text + """ + rank: Annotated[int, Field(examples=[0], ge=0, le=9007199254740991)] + """ + Dropdown item rank + """ + color: Annotated[str | None, Field(examples=["white"])] = None + """ + Dropdown item color + """ + + +class RankedDropdownValue(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["ranked-dropdown"] + """ + The type of value + """ + data: RankedDropdown | None = None + + +class FieldValue( + RootModel[ + CompaniesValue + | CompanyValue + | DateValue + | DropdownsValue + | DropdownValue + | FloatsValue + | FloatValue + | FormulaValue + | InteractionValue + | LocationsValue + | LocationValue + | PersonsValue + | PersonValue + | RankedDropdownValue + | TextsValue + | TextValue + ] +): + root: Annotated[ + CompaniesValue + | CompanyValue + | DateValue + | DropdownsValue + | DropdownValue + | FloatsValue + | FloatValue + | FormulaValue + | InteractionValue + | LocationsValue + | LocationValue + | PersonsValue + | PersonValue + | RankedDropdownValue + | TextsValue + | TextValue, + Field( + discriminator="type", + examples=[ + { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + }, + "type": "location", + } + ], + title="FieldValue", + ), + ] + + +class Type3(Enum): + ENRICHED = "enriched" + GLOBAL_ = "global" + LIST = "list" + RELATIONSHIP_INTELLIGENCE = "relationship-intelligence" + + +class EnrichmentSource(Enum): + AFFINITY_DATA = "affinity-data" + DEALROOM = "dealroom" + NONE_TYPE_NONE = None + + +class FieldModel(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[str, Field(examples=["affinity-data-location"])] + """ + The field's unique identifier + """ + name: Annotated[str, Field(examples=["Location"])] + """ + The field's name + """ + type: Annotated[Type3, Field(examples=["enriched"])] + """ + The field's type + """ + enrichmentSource: Annotated[ + EnrichmentSource | None, Field(examples=["affinity-data"]) + ] + """ + The source of the data in this Field (if it is enriched) + """ + value: FieldValue + + +class Company(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The company's unique identifier + """ + name: Annotated[str, Field(examples=["Acme"])] + """ + The company's name + """ + domain: Annotated[str | None, Field(examples=["acme.co"])] = None + """ + The company's primary domain + """ + domains: Annotated[ + List[ + constr( + pattern=r"^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9])$" + ) + ], + Field(examples=[["acme.co"]]), + ] + """ + All of the company's domains + """ + isGlobal: Annotated[bool, Field(examples=[True])] + """ + Whether or not the company is tenant specific + """ + fields: List[FieldModel] | None = None + """ + The fields associated with the company + """ + + +class CompanyPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[Company], Field(max_length=100)] + """ + A page of Company results + """ + pagination: Pagination + + +class AuthorizationErrors(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + errors: List[AuthorizationError] + """ + AuthorizationError errors + """ + + +class ValueType(Enum): + PERSON = "person" + PERSON_MULTI = "person-multi" + COMPANY = "company" + COMPANY_MULTI = "company-multi" + FILTERABLE_TEXT = "filterable-text" + FILTERABLE_TEXT_MULTI = "filterable-text-multi" + NUMBER = "number" + NUMBER_MULTI = "number-multi" + DATETIME = "datetime" + LOCATION = "location" + LOCATION_MULTI = "location-multi" + TEXT = "text" + RANKED_DROPDOWN = "ranked-dropdown" + DROPDOWN = "dropdown" + DROPDOWN_MULTI = "dropdown-multi" + FORMULA_NUMBER = "formula-number" + INTERACTION = "interaction" + + +class FieldMetadata(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[str, Field(examples=["affinity-data-location"])] + """ + The field's unique identifier + """ + name: Annotated[str, Field(examples=["Location"])] + """ + The field's name + """ + type: Annotated[Type3, Field(examples=["enriched"])] + """ + The field's type + """ + enrichmentSource: Annotated[ + EnrichmentSource | None, Field(examples=["affinity-data"]) + ] + """ + The source of the data in this Field (if it is enriched) + """ + valueType: Annotated[ValueType, Field(examples=["location"])] + """ + The type of the data in this Field + """ + + +class FieldMetadataPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[FieldMetadata], Field(max_length=100)] + """ + A page of FieldMetadata results + """ + pagination: Pagination + + +class ListModel(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The unique identifier for the list + """ + name: Annotated[str, Field(examples=["All companies"])] + """ + The name of the list + """ + creatorId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the user that created this list + """ + ownerId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the user that owns this list + """ + isPublic: Annotated[bool, Field(examples=[False])] + """ + Whether or not the list is public + """ + + +class ListPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[ListModel], Field(max_length=100)] + """ + A page of List results + """ + pagination: Pagination + + +class ListEntry(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The list entry's unique identifier + """ + listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the list that this list entry belongs to + """ + createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The date that the list entry was created + """ + creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( + None + ) + """ + The ID of the user that created this list entry + """ + fields: List[FieldModel] + """ + The fields associated with the list entry + """ + + +class ListEntryPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[ListEntry], Field(max_length=100)] + """ + A page of ListEntry results + """ + pagination: Pagination + + +class Type5(Enum): + COMPANY = "company" + OPPORTUNITY = "opportunity" + PERSON = "person" + + +class ListWithType(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The unique identifier for the list + """ + name: Annotated[str, Field(examples=["All companies"])] + """ + The name of the list + """ + creatorId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the user that created this list + """ + ownerId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the user that owns this list + """ + isPublic: Annotated[bool, Field(examples=[False])] + """ + Whether or not the list is public + """ + type: Annotated[Type5, Field(examples=["company"])] + """ + The entity type for this list + """ + + +class ListWithTypePaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[ListWithType], Field(max_length=100)] + """ + A page of ListWithType results + """ + pagination: Pagination + + +class CompanyListEntry(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The list entry's unique identifier + """ + type: Annotated[Literal["company"], Field(examples=["company"])] + """ + The entity type for this list entry + """ + listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the list that this list entry belongs to + """ + createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The date that the list entry was created + """ + creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( + None + ) + """ + The ID of the user that created this list entry + """ + entity: Company + + +class OpportunityWithFields(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The unique identifier for the opportunity + """ + name: Annotated[str, Field(examples=["Acme Upsell $10k"])] + """ + The name of the opportunity + """ + listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the list that the opportunity belongs to + """ + fields: List[FieldModel] | None = None + """ + The fields associated with the opportunity + """ + + +class OpportunityListEntry(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The list entry's unique identifier + """ + type: Annotated[Literal["opportunity"], Field(examples=["opportunity"])] + """ + The entity type for this list entry + """ + listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the list that this list entry belongs to + """ + createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The date that the list entry was created + """ + creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( + None + ) + """ + The ID of the user that created this list entry + """ + entity: OpportunityWithFields + + +class Type6(Enum): + INTERNAL = "internal" + EXTERNAL = "external" + + +class Person(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The persons's unique identifier + """ + firstName: Annotated[str, Field(examples=["Jane"])] + """ + The person's first name + """ + lastName: Annotated[str | None, Field(examples=["Doe"])] = None + """ + The person's last name + """ + primaryEmailAddress: Annotated[str | None, Field(examples=["jane.doe@acme.co"])] = ( + None + ) + """ + The person's primary email address + """ + emailAddresses: Annotated[ + List[str], Field(examples=[["jane.doe@acme.co", "janedoe@gmail.com"]]) + ] + """ + All of the person's email addresses + """ + type: Annotated[Type6, Field(examples=["internal"])] + """ + The person's type + """ + fields: List[FieldModel] | None = None + """ + The fields associated with the person + """ + + +class PersonListEntry(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The list entry's unique identifier + """ + type: Annotated[Literal["person"], Field(examples=["person"])] + """ + The entity type for this list entry + """ + listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the list that this list entry belongs to + """ + createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The date that the list entry was created + """ + creatorId: Annotated[int | None, Field(examples=[1], ge=1, le=9007199254740991)] = ( + None + ) + """ + The ID of the user that created this list entry + """ + entity: Person + + +class ListEntryWithEntity( + RootModel[CompanyListEntry | OpportunityListEntry | PersonListEntry] +): + root: Annotated[ + CompanyListEntry | OpportunityListEntry | PersonListEntry, + Field(discriminator="type", title="ListEntryWithEntity"), + ] + + +class ListEntryWithEntityPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[ListEntryWithEntity] | None, Field(max_length=100)] + """ + A page of ListEntryWithEntity results + """ + pagination: Pagination + + +class FieldPaged(MyBaseModel): + data: Annotated[List[FieldModel], Field(max_length=100)] + """ + A page of Field results + """ + pagination: Pagination + + +class CompanyReference(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(ge=1, le=9007199254740991)] + """ + The company's unique identifier + """ + + +class CompaniesValueUpdate(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["company-multi"] + """ + The type of value + """ + data: Annotated[List[CompanyReference] | None, Field(max_length=100)] + """ + The values for many companies + """ + + +class CompanyValueUpdate(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["company"] + """ + The type of value + """ + data: CompanyReference | None = None + + +class DropdownReference(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dropdownOptionId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + Dropdown item's unique identifier + """ + + +class DropdownValueUpdate(MyBaseModel): + type: Literal["dropdown"] + """ + The type of value + """ + data: DropdownReference | None = None + + +class DropdownsValueUpdate(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["dropdown-multi"] + """ + The type of value + """ + data: List[DropdownReference] | None + """ + The value for many dropdown items + """ + + +class PersonReference(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The persons's unique identifier + """ + + +class PersonValueUpdate(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["person"] + """ + The type of value + """ + data: PersonReference | None = None + + +class PersonsValueUpdate(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + type: Literal["person-multi"] + """ + The type of value + """ + data: Annotated[List[PersonReference] | None, Field(max_length=100)] + """ + The values for many persons + """ + + +class RankedDropdownReference(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + dropdownOptionId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + Ranked Dropdown item's unique identifier + """ + + +class RankedDropdownValueUpdate(MyBaseModel): + type: Literal["ranked-dropdown"] + """ + The type of value + """ + data: RankedDropdownReference | None = None + + +class FieldValueUpdate( + RootModel[ + CompaniesValueUpdate + | CompanyValueUpdate + | DateValue + | DropdownValueUpdate + | DropdownsValueUpdate + | FloatValue + | FloatsValue + | LocationValue + | LocationsValue + | PersonValueUpdate + | PersonsValueUpdate + | RankedDropdownValueUpdate + | TextValue + | TextsValue + ] +): + root: Annotated[ + CompaniesValueUpdate + | CompanyValueUpdate + | DateValue + | DropdownValueUpdate + | DropdownsValueUpdate + | FloatValue + | FloatsValue + | LocationValue + | LocationsValue + | PersonValueUpdate + | PersonsValueUpdate + | RankedDropdownValueUpdate + | TextValue + | TextsValue, + Field( + discriminator="type", + examples=[ + { + "type": "location", + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + }, + } + ], + title="FieldValueUpdate", + ), + ] + + +class Update(MyBaseModel): + id: Annotated[str, Field(examples=["field-105"])] + """ + The field's unique identifier. + """ + value: FieldValueUpdate | None = None + + +class ListEntryBatchOperationUpdateFields(MyBaseModel): + operation: Literal["update-fields"] + updates: Annotated[List[Update], Field(max_length=100)] + + +class ListEntryBatchOperationRequest(RootModel[ListEntryBatchOperationUpdateFields]): + root: Annotated[ + ListEntryBatchOperationUpdateFields, + Field(discriminator="operation", title="ListEntryBatchOperationRequest"), + ] + + +class ListEntryBatchOperations(Enum): + UPDATE_FIELDS = "update-fields" + + +class ListEntryBatchOperationResponse(MyBaseModel): + operation: ListEntryBatchOperations | None = None + + +class FieldUpdate(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + value: FieldValueUpdate | None = None + + +class Type7(Enum): + SHEET = "sheet" + BOARD = "board" + DASHBOARD = "dashboard" + + +class SavedView(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[28], ge=1, le=9007199254740991)] + """ + The saved view's unique identifier + """ + name: Annotated[str, Field(examples=["my interesting companies"])] + """ + The saved view's name + """ + type: Annotated[Type7, Field(examples=["sheet"])] + """ + The type for this saved view + """ + createdAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The date that the saved view was created + """ + + +class SavedViewPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[SavedView], Field(max_length=100)] + """ + A page of SavedView results + """ + pagination: Pagination + + +class Opportunity(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The unique identifier for the opportunity + """ + name: Annotated[str, Field(examples=["Acme Upsell $10k"])] + """ + The name of the opportunity + """ + listId: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The ID of the list that the opportunity belongs to + """ + + +class OpportunityPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[Opportunity], Field(max_length=100)] + """ + A page of Opportunity results + """ + pagination: Pagination + + +class PersonPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[Person], Field(max_length=100)] + """ + A page of Person results + """ + pagination: Pagination + + +class Status(Enum): + IN_PROGRESS = "in-progress" + SUCCESS = "success" + FAILED = "failed" + + +class PersonMergeState(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[12345], ge=1, le=9007199254740991)] + """ + The unique identifier for the merge + """ + status: Annotated[Status, Field(examples=["success"])] + """ + Current status of the merge + """ + taskId: Annotated[UUID, Field(examples=["789e0123-e45b-67c8-d901-234567890123"])] + """ + Identifier for the task this merge belongs to + """ + startedAt: Annotated[datetime, Field(examples=["2025-06-03T10:30:00Z"])] + """ + Timestamp when the merge started + """ + primaryPersonId: Annotated[int, Field(examples=[12345], ge=1, le=9007199254740991)] + """ + ID of the primary person that other profiles were merged into + """ + duplicatePersonId: Annotated[ + int, Field(examples=[67890], ge=1, le=9007199254740991) + ] + """ + ID of the duplicate person that was merged into the primary person + """ + completedAt: Annotated[ + datetime | None, Field(examples=["2025-06-03T10:32:15Z", None]) + ] = None + """ + Timestamp when the merge completed (success or failure) + """ + errorMessage: Annotated[ + str | None, Field(examples=["Primary person not found", None]) + ] = None + """ + Error message if the merge failed + """ + + +class PersonMergeStatePaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[PersonMergeState], Field(max_length=100)] + """ + Array of person merge states + """ + pagination: Pagination + + +class PersonMergeRequest(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + primaryPersonId: Annotated[int, Field(examples=[12345], ge=1, le=9007199254740991)] + """ + The ID of the person profile that will be kept after the merge. All data from the duplicate person will be merged into this person. + """ + duplicatePersonId: Annotated[ + int, Field(examples=[67890], ge=1, le=9007199254740991) + ] + """ + The ID of the person profile that will be merged and then deleted. All data from this person will be transferred to the primary person. + """ + + +class PersonMergeResponse(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + taskUrl: Annotated[ + AnyUrl, + Field( + examples=[ + "https://api.affinit.com/tasks/person-merges/123e4567-e89b-12d3-a456-426614174000" + ] + ), + ] + """ + URL to check the status of the merge task + """ + + +class ResultsSummary(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + total: Annotated[int, Field(examples=[5], ge=0, le=2147483647)] + """ + Total number of merges in the batch + """ + inProgress: Annotated[int, Field(examples=[2], ge=0, le=2147483647)] + """ + Number of merges currently in progress + """ + success: Annotated[int, Field(examples=[2], ge=0, le=2147483647)] + """ + Number of successfully completed merges + """ + failed: Annotated[int, Field(examples=[1], ge=0, le=2147483647)] + """ + Number of failed merges + """ + + +class PersonMergeTask(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[UUID, Field(examples=["123e4567-e89b-12d3-a456-426614174000"])] + """ + The unique identifier for this merge task + """ + status: Annotated[Status, Field(examples=["in-progress"])] + """ + The current status of the batch operation + """ + resultsSummary: ResultsSummary + """ + Summary of merges in this batch task + """ + + +class PersonMergeTaskPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[ + List[PersonMergeTask], + Field( + 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, + }, + }, + ] + ], + max_length=100, + ), + ] + """ + Array of person merge tasks + """ + pagination: Pagination diff --git a/affinity_model/v2/interactions.py b/affinity_model/v2/interactions.py new file mode 100644 index 0000000..586462c --- /dev/null +++ b/affinity_model/v2/interactions.py @@ -0,0 +1,67 @@ +# generated by datamodel-codegen: +# filename: v2_spec.json + +from __future__ import annotations + +from datetime import datetime +from enum import Enum +from typing import Annotated, List, Literal + +from pydantic import ConfigDict, Field + +from ..base import MyBaseModel +from . import PaginationWithTotalCount, Participant, ParticipantsPreview + + +class Direction(Enum): + SENT = "sent" + RECEIVED = "received" + + +class Email(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + id: Annotated[int, Field(examples=[1], ge=1, le=9007199254740991)] + """ + The email's unique identifier + """ + sentAt: Annotated[datetime, Field(examples=["2023-01-01T00:00:00Z"])] + """ + The timestamp of when the email was sent + """ + loggingType: Annotated[Literal["automated"], Field(examples=["automated"])] + """ + Indicates how the interaction was added to Affinity: either manually by a user ('manual') or automatically through Affinity's capture process ('automated'). Currently, emails can only be logged as 'automated'. + """ + direction: Annotated[Direction, Field(examples=["received"])] + """ + The direction of the email: 'sent' if the email was sent by an internal user and 'received' if the email was sent to an internal user. + """ + subject: Annotated[str | None, Field(examples=["Example subject"])] = None + """ + The email's subject + """ + from_: Annotated[Participant, Field(alias="from")] + """ + The participant who sent the email + """ + toParticipantsPreview: ParticipantsPreview + """ + A preview of the participants in the 'To' field of the email + """ + ccParticipantsPreview: ParticipantsPreview + """ + A preview of the participants who are cc'ed in the email + """ + + +class EmailPaged(MyBaseModel): + model_config = ConfigDict( + extra="forbid", + ) + data: Annotated[List[Email], Field(max_length=100)] + """ + A page of Email results + """ + pagination: PaginationWithTotalCount diff --git a/bin/generate_model.sh b/bin/generate_model.sh index 0f67187..724878a 100755 --- a/bin/generate_model.sh +++ b/bin/generate_model.sh @@ -31,9 +31,11 @@ main() { lint-spec log "Generating code..." + rm -rf ../affinity_model/v2 + mkdir -p ../affinity_model/v2 datamodel-codegen \ --input ../spec/v2_spec.json \ - --output ../affinity_model/v2.py \ + --output ../affinity_model/v2/ \ --output-model-type pydantic_v2.BaseModel \ --use-annotated \ --use-union-operator \ @@ -42,7 +44,7 @@ main() { --input-file-type openapi \ --field-constraints \ --use-double-quotes \ - --base-class ..MyBaseModel \ + --base-class ..base.MyBaseModel \ --disable-timestamp \ --target-python-version "${python_version}" diff --git a/devenv.lock b/devenv.lock index b892415..5c2d116 100644 --- a/devenv.lock +++ b/devenv.lock @@ -3,10 +3,10 @@ "devenv": { "locked": { "dir": "src/modules", - "lastModified": 1740460834, + "lastModified": 1752604051, "owner": "cachix", "repo": "devenv", - "rev": "9e4003b2702483bd962dac3d4ff43e8dafb93cda", + "rev": "ee0fd5cd4d0d45650f8a41c7861c6599bd120e79", "type": "github" }, "original": { @@ -19,10 +19,10 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1733328505, + "lastModified": 1747046372, "owner": "edolstra", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -34,10 +34,10 @@ "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1733328505, + "lastModified": 1747046372, "owner": "edolstra", "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", "type": "github" }, "original": { @@ -55,10 +55,10 @@ ] }, "locked": { - "lastModified": 1737465171, + "lastModified": 1750779888, "owner": "cachix", "repo": "git-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", "type": "github" }, "original": { @@ -89,10 +89,10 @@ }, "nixpkgs": { "locked": { - "lastModified": 1733477122, + "lastModified": 1750441195, "owner": "cachix", "repo": "devenv-nixpkgs", - "rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857", + "rev": "0ceffe312871b443929ff3006960d29b120dc627", "type": "github" }, "original": { @@ -110,10 +110,10 @@ ] }, "locked": { - "lastModified": 1733319315, + "lastModified": 1749760516, "owner": "cachix", "repo": "nixpkgs-python", - "rev": "01263eeb28c09f143d59cd6b0b7c4cc8478efd48", + "rev": "908dbb466af5955ea479ac95953333fd64387216", "type": "github" }, "original": { diff --git a/devenv.nix b/devenv.nix index 890e876..15a69a7 100644 --- a/devenv.nix +++ b/devenv.nix @@ -28,37 +28,21 @@ git-hooks.hooks = { shellcheck.enable = true; + shellcheck.excludes = [ + ".envrc" + ]; black.enable = true; typos.enable = true; + typos.excludes = [ + "spec/v2_spec.json" + ]; yamllint.enable = true; yamlfmt.enable = true; commitizen.enable = true; nixfmt-rfc-style.enable = true; markdownlint.enable = true; - }; - - # TODO: Replace with https://github.com/cachix/git-hooks.nix/pull/557 when merged - git-hooks.hooks.validate-spec = { - enable = true; - - # The name of the hook (appears on the report table): - name = "Validate OpenAPI spec"; - - # The command to execute (mandatory): - entry = "openapi-spec-validator"; - - # The pattern of files to run on (default: "" (all)) - # see also https://pre-commit.com/#hooks-files - files = "^spec/.*\\.(yaml|yml|json)$"; - - # The language of the hook - tells pre-commit - # how to install the hook (default: "system") - # see also https://pre-commit.com/#supported-languages - language = "system"; - - # Set this to false to not pass the changed files - # to the command (default: true): - pass_filenames = true; + openapi-spec-validator.enable = true; + openapi-spec-validator.files = "^spec/.*\\.(yaml|yml|json)$"; }; scripts.lint-spec.exec = '' diff --git a/spec/v2_spec.json b/spec/v2_spec.json index cb89551..4657617 100644 --- a/spec/v2_spec.json +++ b/spec/v2_spec.json @@ -1,13 +1,14 @@ { "openapi": "3.1.0", "info": { - "version": "2024-01-01", + "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, 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## 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", + "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## 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" @@ -38,6 +39,11 @@ "description": "Operations about companies", "name": "companies" }, + { + "description": "Operations about emails", + "name": "emails", + "x-stability-level": "beta" + }, { "description": "Operations about lists", "name": "lists" @@ -46,6 +52,11 @@ "description": "Operations about opportunities", "name": "opportunities" }, + { + "description": "Operations about person merges", + "name": "personMerges", + "x-stability-level": "beta" + }, { "description": "Operations about persons", "name": "persons" @@ -56,13 +67,13 @@ "get": { "description": "Returns metadata about the current user.", "summary": "Get current user", - "operationId": "getV2AuthWhoami", + "operationId": "v2_auth_whoami__GET", "tags": [ "auth" ], "responses": { "200": { - "description": "Get current user", + "description": "OK", "content": { "application/json": { "schema": { @@ -104,7 +115,7 @@ "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", + "operationId": "v2_companies__GET", "tags": [ "companies" ], @@ -118,7 +129,8 @@ "examples": [ "ICAgICAgYmVmb3JlOjo6Nw" ] - } + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -133,7 +145,8 @@ "examples": [ 100 ] - } + }, + "example": 100 }, { "name": "ids", @@ -148,17 +161,12 @@ "format": "int64", "minimum": 1, "maximum": 9223372036854776000 - }, - "examples": [ - [ - 1 - ], - [ - 1, - 2 - ] - ] - } + } + }, + "example": [ + 1, + 2 + ] }, { "name": "fieldIds", @@ -169,19 +177,18 @@ "schema": { "type": "array", "items": { - "type": "string", - "format": "string" + "type": "string" }, "examples": [ [ "field-1" - ], - [ - "field-1", - "field-2" ] ] - } + }, + "example": [ + "field-1", + "field-2" + ] }, { "name": "fieldTypes", @@ -193,28 +200,22 @@ "type": "array", "items": { "type": "string", - "format": "string", "enum": [ "enriched", "global", "relationship-intelligence" ] - }, - "examples": [ - [ - "enriched" - ], - [ - "enriched", - "global" - ] - ] - } + } + }, + "example": [ + "enriched", + "global" + ] } ], "responses": { "200": { - "description": "Get all Companies", + "description": "OK", "content": { "application/json": { "schema": { @@ -255,17 +256,17 @@ } } }, - "/v2/companies/{id}": { + "/v2/companies/{companyId}": { "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", + "operationId": "v2_companies_companyId__GET", "tags": [ "companies" ], "parameters": [ { - "name": "id", + "name": "companyId", "description": "Company ID", "in": "path", "required": true, @@ -285,10 +286,18 @@ "schema": { "type": "array", "items": { - "type": "string", - "format": "string" - } - } + "type": "string" + }, + "examples": [ + [ + "field-1" + ] + ] + }, + "example": [ + "field-1", + "field-2" + ] }, { "name": "fieldTypes", @@ -300,19 +309,22 @@ "type": "array", "items": { "type": "string", - "format": "string", "enum": [ "enriched", "global", "relationship-intelligence" ] } - } + }, + "example": [ + "enriched", + "global" + ] } ], "responses": { "200": { - "description": "Get a single Company", + "description": "OK", "content": { "application/json": { "schema": { @@ -360,7 +372,7 @@ "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", + "operationId": "v2_companies_fields__GET", "tags": [ "companies" ], @@ -370,8 +382,12 @@ "description": "Cursor for the next or previous page", "in": "query", "schema": { - "type": "string" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -382,13 +398,17 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 } ], "responses": { "200": { - "description": "Get metadata on Company Fields", + "description": "OK", "content": { "application/json": { "schema": { @@ -426,17 +446,17 @@ } } }, - "/v2/companies/{id}/lists": { + "/v2/companies/{companyId}/lists": { "get": { "description": "Returns metadata for all the Lists on which the given Company appears.", "summary": "Get a Company's Lists", - "operationId": "getV2CompaniesIdLists", + "operationId": "v2_companies_companyId_lists__GET", "tags": [ "companies" ], "parameters": [ { - "name": "id", + "name": "companyId", "description": "Company ID", "in": "path", "required": true, @@ -452,8 +472,12 @@ "description": "Cursor for the next or previous page", "in": "query", "schema": { - "type": "string" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -464,13 +488,17 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 } ], "responses": { "200": { - "description": "Get a Company's Lists", + "description": "OK", "content": { "application/json": { "schema": { @@ -511,17 +539,17 @@ } } }, - "/v2/companies/{id}/list-entries": { + "/v2/companies/{companyId}/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", + "operationId": "v2_companies_companyId_list-entries__GET", "tags": [ "companies" ], "parameters": [ { - "name": "id", + "name": "companyId", "description": "Company ID", "in": "path", "required": true, @@ -537,8 +565,12 @@ "description": "Cursor for the next or previous page", "in": "query", "schema": { - "type": "string" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -549,13 +581,17 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 } ], "responses": { "200": { - "description": "Get a Company's List Entries", + "description": "OK", "content": { "application/json": { "schema": { @@ -599,11 +635,99 @@ } } }, + "/v2/emails": { + "get": { + "x-stability-level": "beta", + "description": "| ⚠️ Coming soon |\n|--|\nThis endpoint returns all Emails.", + "summary": "Get metadata on all Emails [COMING SOON]", + "operationId": "v2_emails__GET", + "tags": [ + "emails" + ], + "parameters": [ + { + "name": "totalCount", + "description": "Include total count of the collection in the pagination response", + "in": "query", + "schema": { + "type": "boolean", + "default": false + } + }, + { + "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, + "examples": [ + 100 + ] + }, + "example": 100 + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/interactions.EmailPaged" + } + } + }, + "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/lists": { "get": { "description": "Returns metadata on Lists.", "summary": "Get metadata on all Lists", - "operationId": "getV2Lists", + "operationId": "v2_lists__GET", "tags": [ "lists" ], @@ -613,8 +737,12 @@ "description": "Cursor for the next or previous page", "in": "query", "schema": { - "type": "string" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -625,17 +753,26 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 } ], "responses": { "200": { - "description": "Get metadata on all Lists", + "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWithTypePaged" + }, + "examples": { + "success": { + "$ref": "#/components/examples/success" + } } } }, @@ -673,7 +810,7 @@ "get": { "description": "Returns metadata on a single List.", "summary": "Get metadata on a single List", - "operationId": "getV2ListsListid", + "operationId": "v2_lists_listId__GET", "tags": [ "lists" ], @@ -693,11 +830,22 @@ ], "responses": { "200": { - "description": "Get metadata on a single List", + "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWithType" + }, + "examples": { + "company-list": { + "$ref": "#/components/examples/company-list" + }, + "opportunity-list": { + "$ref": "#/components/examples/opportunity-list" + }, + "person-list": { + "$ref": "#/components/examples/person-list" + } } } }, @@ -738,7 +886,7 @@ "get": { "description": "Paginate through the List Entries (AKA rows) on a given List.\nReturns basic information and field data, including list-specific\nfield data, on each Company, Person, or Opportunity on the List.\nList Entries also include metadata about their creation,\ni.e., when they were added to the List and by whom.\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/lists/{listId}/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, List Entries 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 data from Lists\" [permission](#section/Getting-Started/Permissions).", "summary": "Get all List Entries on a List", - "operationId": "getV2ListsListidListEntries", + "operationId": "v2_lists_listId_list-entries__GET", "tags": [ "lists" ], @@ -760,8 +908,12 @@ "description": "Cursor for the next or previous page", "in": "query", "schema": { - "type": "string" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -772,8 +924,12 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 }, { "name": "fieldIds", @@ -784,10 +940,18 @@ "schema": { "type": "array", "items": { - "type": "string", - "format": "string" - } - } + "type": "string" + }, + "examples": [ + [ + "field-1" + ] + ] + }, + "example": [ + "field-1", + "field-2" + ] }, { "name": "fieldTypes", @@ -799,7 +963,6 @@ "type": "array", "items": { "type": "string", - "format": "string", "enum": [ "enriched", "global", @@ -807,16 +970,31 @@ "relationship-intelligence" ] } - } + }, + "example": [ + "enriched", + "global" + ] } ], "responses": { "200": { - "description": "Get all List Entries on a List", + "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListEntryWithEntityPaged" + }, + "examples": { + "company-list-enriched": { + "$ref": "#/components/examples/company-list-enriched" + }, + "company-list-relationship-intelligence": { + "$ref": "#/components/examples/company-list-relationship-intelligence" + }, + "company-list-global-and-list": { + "$ref": "#/components/examples/company-list-global-and-list" + } } } }, @@ -856,11 +1034,11 @@ } } }, - "/v2/lists/{listId}/fields": { + "/v2/lists/{listId}/list-entries/{listEntryId}": { "get": { - "description": "Returns metadata on the Fields available on a single List.\n\nUse the returned Field IDs to request field data from the GET `/v2/lists/{listId}/list-entries` endpoint.", - "summary": "Get metadata on a single List's Fields", - "operationId": "getV2ListsListidFields", + "description": "Retrieve a single list entry.\nReturns basic information and field data, including list-specific field data.\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/lists/{listId}/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, the List Entry 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 data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get a single List Entry on a List", + "operationId": "v2_lists_listId_list-entries_listEntryId__GET", "tags": [ "lists" ], @@ -878,38 +1056,86 @@ } }, { - "name": "cursor", - "description": "Cursor for the next or previous page", - "in": "query", + "name": "listEntryId", + "description": "List Entry ID", + "in": "path", + "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 } }, { - "name": "limit", - "description": "Number of items to include in the page", + "name": "fieldIds", + "description": "Field IDs for which to return field data", "in": "query", + "style": "form", + "explode": true, "schema": { - "type": "integer", - "format": "int32", - "minimum": 1, - "maximum": 100, - "default": 100 - } - } - ], - "responses": { - "200": { - "description": "Get metadata on a single List's Fields", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/FieldMetadataPaged" - } - } - }, - "headers": { - "X-Ratelimit-Limit-User": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "field-1" + ] + ] + }, + "example": [ + "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", + "enum": [ + "enriched", + "global", + "list", + "relationship-intelligence" + ] + } + }, + "example": [ + "enriched", + "global" + ] + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEntryWithEntity" + }, + "examples": { + "company-list-enriched": { + "$ref": "#/components/examples/company-list-enriched-2" + }, + "company-list-relationship-intelligence": { + "$ref": "#/components/examples/company-list-relationship-intelligence-2" + }, + "company-list-global-and-list": { + "$ref": "#/components/examples/company-list-global-and-list-2" + } + } + } + }, + "headers": { + "X-Ratelimit-Limit-User": { "$ref": "#/components/headers/X-Ratelimit-Limit-User" }, "X-Ratelimit-Limit-User-Remaining": { @@ -932,6 +1158,9 @@ "400": { "$ref": "#/components/responses/400" }, + "403": { + "$ref": "#/components/responses/403" + }, "404": { "$ref": "#/components/responses/404" }, @@ -941,11 +1170,11 @@ } } }, - "/v2/lists/{listId}/saved-views": { + "/v2/lists/{listId}/list-entries/{listEntryId}/fields": { "get": { - "description": "Returns metadata on the Saved Views on a List.", - "summary": "Get metadata on Saved Views", - "operationId": "getV2ListsListidSavedViews", + "description": "Paginate through all field values on a single list entry.\n\nAll fields will be included by default. The `ids` and `types` parameters can be used to filter the collection.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get field values on a single List Entry", + "operationId": "v2_lists_listId_list-entries_listEntryId_fields__GET", "tags": [ "lists" ], @@ -962,13 +1191,74 @@ "maximum": 9223372036854776000 } }, + { + "name": "listEntryId", + "description": "List Entry ID", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 + } + }, + { + "name": "ids", + "description": "Field IDs for which to return field data", + "in": "query", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "field-1" + ] + ] + }, + "example": [ + "field-1", + "field-2" + ] + }, + { + "name": "types", + "description": "Field Types for which to return field data", + "in": "query", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "enriched", + "global", + "list", + "relationship-intelligence" + ] + } + }, + "example": [ + "enriched", + "global" + ] + }, { "name": "cursor", "description": "Cursor for the next or previous page", "in": "query", "schema": { - "type": "string" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -979,17 +1269,32 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 20, + "examples": [ + 20 + ] + }, + "example": 20 } ], "responses": { "200": { - "description": "Get metadata on Saved Views", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedViewPaged" + "$ref": "#/components/schemas/FieldPaged" + }, + "examples": { + "company-list-enriched": { + "$ref": "#/components/examples/company-list-enriched-3" + }, + "company-list-relationship-intelligence": { + "$ref": "#/components/examples/company-list-relationship-intelligence-3" + }, + "company-list-global-and-list": { + "$ref": "#/components/examples/company-list-global-and-list-3" + } } } }, @@ -1017,6 +1322,9 @@ "400": { "$ref": "#/components/responses/400" }, + "403": { + "$ref": "#/components/responses/403" + }, "404": { "$ref": "#/components/responses/404" }, @@ -1024,13 +1332,11 @@ "$ref": "#/components/responses/default" } } - } - }, - "/v2/lists/{listId}/saved-views/{viewId}": { - "get": { - "description": "Returns metadata on a single Saved View.", - "summary": "Get metadata on a single Saved View", - "operationId": "getV2ListsListidSavedViewsViewid", + }, + "patch": { + "description": "Perform batch operations on a list entry's fields.\n\nCurrently the only operation at the endpoint is `update-fields`, which allows you to update multiple field values with a single request. This is equivalent to calling [the single field update](#operation/v2_lists_listId_list-entries_listEntryId_fields_fieldId__POST) endpoint multiple times. \n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Perform batch operations on a list entry's fields", + "operationId": "v2_lists_listId_list-entries_listEntryId_fields__PATCH", "tags": [ "lists" ], @@ -1048,8 +1354,8 @@ } }, { - "name": "viewId", - "description": "Saved view ID", + "name": "listEntryId", + "description": "List Entry ID", "in": "path", "required": true, "schema": { @@ -1060,13 +1366,33 @@ } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListEntryBatchOperationRequest" + }, + "examples": { + "update-fields": { + "$ref": "#/components/examples/update-fields" + } + } + } + } + }, "responses": { "200": { - "description": "Get metadata on a single Saved View", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedView" + "$ref": "#/components/schemas/ListEntryBatchOperationResponse" + }, + "examples": { + "update-fields": { + "$ref": "#/components/examples/update-fields-2" + } } } }, @@ -1094,6 +1420,9 @@ "400": { "$ref": "#/components/responses/400" }, + "403": { + "$ref": "#/components/responses/403" + }, "404": { "$ref": "#/components/responses/404" }, @@ -1103,11 +1432,11 @@ } } }, - "/v2/lists/{listId}/saved-views/{viewId}/list-entries": { + "/v2/lists/{listId}/list-entries/{listEntryId}/fields/{fieldId}": { "get": { - "description": "Paginate through the List Entries (AKA rows) on a given Saved View.\nUse this endpoint when you need to filter entities or only want **some**\nfield data to be returned: This endpoint respects the filters set on a Saved View\nvia web app, and only returns field data corresponding to the columns that have been\npulled into the Saved View via web app.\n\nThough this endpoint respects the Saved View's filters and column/Field selection,\nit does not yet preserve sort order. This endpoint also only supports **sheet-type\nSaved Views**, and not board- or dashboard-type Saved Views.\n\nSee the [Data Model](#section/Data-Model) section for more information about Saved Views.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", - "summary": "Get all List Entries on a Saved View", - "operationId": "getV2ListsListidSavedViewsViewidListEntries", + "description": "Returns a single field value on a list entry.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get a single field value", + "operationId": "v2_lists_listId_list-entries_listEntryId_fields_fieldId__GET", "tags": [ "lists" ], @@ -1125,8 +1454,8 @@ } }, { - "name": "viewId", - "description": "Saved view ID", + "name": "listEntryId", + "description": "List Entry ID", "in": "path", "required": true, "schema": { @@ -1137,33 +1466,75 @@ } }, { - "name": "cursor", - "description": "Cursor for the next or previous page", - "in": "query", + "name": "fieldId", + "description": "Field ID", + "in": "path", + "required": true, "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 all List Entries on a Saved View", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListEntryWithEntityPaged" + "$ref": "#/components/schemas/Field" + }, + "examples": { + "company": { + "$ref": "#/components/examples/company" + }, + "company-multi": { + "$ref": "#/components/examples/company-multi" + }, + "datetime": { + "$ref": "#/components/examples/datetime" + }, + "dropdown": { + "$ref": "#/components/examples/dropdown" + }, + "dropdown-multi": { + "$ref": "#/components/examples/dropdown-multi" + }, + "filterable-text": { + "$ref": "#/components/examples/filterable-text" + }, + "filterable-text-multi": { + "$ref": "#/components/examples/filterable-text-multi" + }, + "formula-number": { + "$ref": "#/components/examples/formula-number" + }, + "interaction": { + "$ref": "#/components/examples/interaction" + }, + "location": { + "$ref": "#/components/examples/location" + }, + "location-multi": { + "$ref": "#/components/examples/location-multi" + }, + "number": { + "$ref": "#/components/examples/number" + }, + "number-multi": { + "$ref": "#/components/examples/number-multi" + }, + "person": { + "$ref": "#/components/examples/person" + }, + "person-multi": { + "$ref": "#/components/examples/person-multi" + }, + "ranked-dropdown": { + "$ref": "#/components/examples/ranked-dropdown" + }, + "text": { + "$ref": "#/components/examples/text" + } } } }, @@ -1201,64 +1572,109 @@ "$ref": "#/components/responses/default" } } - } - }, - "/v2/opportunities": { - "get": { - "description": "Paginate through Opportunities in Affinity.\nReturns basic information but **not** field data on each Opportunity.\n\nTo access field data on Opportunities, use the `/lists/{list_id}/list-entries`\nor the `/v2/lists/{list_id}/saved-views/{view_id}/list-entries` GET endpoint.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", - "summary": "Get all Opportunities", - "operationId": "getV2Opportunities", + }, + "post": { + "description": "Update a single field value.\n \nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Update a single field value on a List Entry", + "operationId": "v2_lists_listId_list-entries_listEntryId_fields_fieldId__POST", "tags": [ - "opportunities" + "lists" ], "parameters": [ { - "name": "cursor", - "description": "Cursor for the next or previous page", - "in": "query", + "name": "listId", + "description": "List ID", + "in": "path", + "required": true, "schema": { - "type": "string" + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 } }, { - "name": "limit", - "description": "Number of items to include in the page", - "in": "query", + "name": "listEntryId", + "description": "List Entry ID", + "in": "path", + "required": true, "schema": { "type": "integer", - "format": "int32", + "format": "int64", "minimum": 1, - "maximum": 100, - "default": 100 + "maximum": 9223372036854776000 } }, { - "name": "ids", - "description": "Opportunity IDs", - "in": "query", - "style": "form", - "explode": true, + "name": "fieldId", + "description": "Field ID", + "in": "path", + "required": true, "schema": { - "type": "array", - "items": { - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9223372036854776000 - } + "type": "string" } } ], - "responses": { - "200": { - "description": "Get all Opportunities", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpportunityPaged" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FieldUpdate" + }, + "examples": { + "company": { + "$ref": "#/components/examples/company-2" + }, + "company-multi": { + "$ref": "#/components/examples/company-multi-2" + }, + "datetime": { + "$ref": "#/components/examples/datetime-2" + }, + "dropdown": { + "$ref": "#/components/examples/dropdown-2" + }, + "dropdown-multi": { + "$ref": "#/components/examples/dropdown-multi-2" + }, + "filterable-text": { + "$ref": "#/components/examples/filterable-text-2" + }, + "filterable-text-multi": { + "$ref": "#/components/examples/filterable-text-multi-2" + }, + "location": { + "$ref": "#/components/examples/location-2" + }, + "location-multi": { + "$ref": "#/components/examples/location-multi-2" + }, + "number": { + "$ref": "#/components/examples/number-2" + }, + "number-multi": { + "$ref": "#/components/examples/number-multi-2" + }, + "person": { + "$ref": "#/components/examples/person-2" + }, + "person-multi": { + "$ref": "#/components/examples/person-multi-2" + }, + "ranked-dropdown": { + "$ref": "#/components/examples/ranked-dropdown-2" + }, + "text": { + "$ref": "#/components/examples/text-2" } } - }, + } + } + }, + "responses": { + "204": { + "description": "No Content", "headers": { "X-Ratelimit-Limit-User": { "$ref": "#/components/headers/X-Ratelimit-Limit-User" @@ -1295,18 +1711,18 @@ } } }, - "/v2/opportunities/{id}": { + "/v2/lists/{listId}/fields": { "get": { - "description": "Returns basic information but **not** field data on the requested Opportunity.\n\nTo access field data on Opportunities, use the `/lists/{list_id}/list-entries`\nor the `/v2/lists/{list_id}/saved-views/{view_id}/list-entries` GET endpoint.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", - "summary": "Get a single Opportunity", - "operationId": "getV2OpportunitiesId", - "tags": [ - "opportunities" + "description": "Returns metadata on the Fields available on a single List.\n\nUse the returned Field IDs to request field data from the GET `/v2/lists/{listId}/list-entries` endpoint.", + "summary": "Get metadata on a single List's Fields", + "operationId": "v2_lists_listId_fields__GET", + "tags": [ + "lists" ], "parameters": [ { - "name": "id", - "description": "Opportunity ID", + "name": "listId", + "description": "List ID", "in": "path", "required": true, "schema": { @@ -1315,15 +1731,54 @@ "minimum": 1, "maximum": 9223372036854776000 } + }, + { + "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, + "examples": [ + 100 + ] + }, + "example": 100 } ], "responses": { "200": { - "description": "Get a single Opportunity", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Opportunity" + "$ref": "#/components/schemas/FieldMetadataPaged" + }, + "examples": { + "company-list": { + "$ref": "#/components/examples/company-list-2" + }, + "person-list": { + "$ref": "#/components/examples/person-list-2" + }, + "opportunity-list": { + "$ref": "#/components/examples/opportunity-list-2" + } } } }, @@ -1351,9 +1806,6 @@ "400": { "$ref": "#/components/responses/400" }, - "403": { - "$ref": "#/components/responses/403" - }, "404": { "$ref": "#/components/responses/404" }, @@ -1363,22 +1815,38 @@ } } }, - "/v2/persons": { + "/v2/lists/{listId}/saved-views": { "get": { - "description": "Paginate through Persons in Affinity.\nReturns basic information and non-list-specific field data on each Person.\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/persons/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, Persons 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 People directory\" [permission](#section/Getting-Started/Permissions).", - "summary": "Get all Persons", - "operationId": "getV2Persons", + "description": "Returns metadata on the Saved Views on a List.", + "summary": "Get metadata on Saved Views", + "operationId": "v2_lists_listId_saved-views__GET", "tags": [ - "persons" + "lists" ], "parameters": [ + { + "name": "listId", + "description": "List 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" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -1389,66 +1857,21 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } - }, - { - "name": "ids", - "description": "People IDs", - "in": "query", - "style": "form", - "explode": true, - "schema": { - "type": "array", - "items": { - "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" - ] - } - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 } ], "responses": { "200": { - "description": "Get all Persons", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PersonPaged" + "$ref": "#/components/schemas/SavedViewPaged" } } }, @@ -1476,8 +1899,8 @@ "400": { "$ref": "#/components/responses/400" }, - "403": { - "$ref": "#/components/responses/403" + "404": { + "$ref": "#/components/responses/404" }, "default": { "$ref": "#/components/responses/default" @@ -1485,18 +1908,18 @@ } } }, - "/v2/persons/{id}": { + "/v2/lists/{listId}/saved-views/{viewId}": { "get": { - "description": "Returns basic information and non-list-specific field data on the requested Person.\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/persons/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, Persons 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 People directory\" [permission](#section/Getting-Started/Permissions).", - "summary": "Get a single Person", - "operationId": "getV2PersonsId", + "description": "Returns metadata on a single Saved View.", + "summary": "Get metadata on a single Saved View", + "operationId": "v2_lists_listId_saved-views_viewId__GET", "tags": [ - "persons" + "lists" ], "parameters": [ { - "name": "id", - "description": "Person ID", + "name": "listId", + "description": "List ID", "in": "path", "required": true, "schema": { @@ -1507,46 +1930,25 @@ } }, { - "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, + "name": "viewId", + "description": "Saved view ID", + "in": "path", + "required": true, "schema": { - "type": "array", - "items": { - "type": "string", - "format": "string", - "enum": [ - "enriched", - "global", - "relationship-intelligence" - ] - } + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 } } ], "responses": { "200": { - "description": "Get a single Person", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Person" + "$ref": "#/components/schemas/SavedView" } } }, @@ -1574,9 +1976,6 @@ "400": { "$ref": "#/components/responses/400" }, - "403": { - "$ref": "#/components/responses/403" - }, "404": { "$ref": "#/components/responses/404" }, @@ -1586,22 +1985,50 @@ } } }, - "/v2/persons/fields": { + "/v2/lists/{listId}/saved-views/{viewId}/list-entries": { "get": { - "description": "Returns metadata on non-list-specific Person Fields.\n\nUse the returned Field IDs to request field data from the GET `/v2/persons` and GET `/v2/persons/{id}` endpoints.", - "summary": "Get metadata on Person Fields", - "operationId": "getV2PersonsFields", + "description": "Paginate through the List Entries (AKA rows) on a given Saved View.\nUse this endpoint when you need to filter entities or only want **some**\nfield data to be returned: This endpoint respects the filters set on a Saved View\nvia web app, and only returns field data corresponding to the columns that have been\npulled into the Saved View via web app.\n\nThough this endpoint respects the Saved View's filters and column/Field selection,\nit does not yet preserve sort order. This endpoint also only supports **sheet-type\nSaved Views**, and not board- or dashboard-type Saved Views.\n\nSee the [Data Model](#section/Data-Model) section for more information about Saved Views.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get all List Entries on a Saved View", + "operationId": "v2_lists_listId_saved-views_viewId_list-entries__GET", "tags": [ - "persons" + "lists" ], "parameters": [ + { + "name": "listId", + "description": "List ID", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 + } + }, + { + "name": "viewId", + "description": "Saved view 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" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -1612,17 +2039,21 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 } ], "responses": { "200": { - "description": "Get metadata on Person Fields", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FieldMetadataPaged" + "$ref": "#/components/schemas/ListEntryWithEntityPaged" } } }, @@ -1650,61 +2081,83 @@ "400": { "$ref": "#/components/responses/400" }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, "default": { "$ref": "#/components/responses/default" } } } }, - "/v2/persons/{id}/lists": { + "/v2/opportunities": { "get": { - "description": "Returns metadata for all the Lists on which the given Person appears.", - "summary": "Get a Person's Lists", - "operationId": "getV2PersonsIdLists", + "description": "Paginate through Opportunities in Affinity.\nReturns basic information but **not** field data on each Opportunity.\n\nTo access field data on Opportunities, use the `/lists/{list_id}/list-entries`\nor the `/v2/lists/{list_id}/saved-views/{view_id}/list-entries` GET endpoint.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get all Opportunities", + "operationId": "v2_opportunities__GET", "tags": [ - "persons" + "opportunities" ], "parameters": [ - { - "name": "id", - "description": "Persons 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", + "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 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 + }, + { + "name": "ids", + "description": "Opportunity IDs", + "in": "query", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 + } + }, + "example": [ + 1, + 2 + ] } ], "responses": { "200": { - "description": "Get a Person's Lists", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListPaged" + "$ref": "#/components/schemas/OpportunityPaged" } } }, @@ -1732,6 +2185,9 @@ "400": { "$ref": "#/components/responses/400" }, + "403": { + "$ref": "#/components/responses/403" + }, "404": { "$ref": "#/components/responses/404" }, @@ -1741,18 +2197,18 @@ } } }, - "/v2/persons/{id}/list-entries": { + "/v2/opportunities/{opportunityId}": { "get": { - "description": "Paginate through the List Entries (AKA rows) for the given Person across all Lists.\nEach List Entry includes field data for the Person, 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 Person's List Entries", - "operationId": "getV2PersonsIdListEntries", + "description": "Returns basic information but **not** field data on the requested Opportunity.\n\nTo access field data on Opportunities, use the `/lists/{list_id}/list-entries`\nor the `/v2/lists/{list_id}/saved-views/{view_id}/list-entries` GET endpoint.\n\nRequires the \"Export data from Lists\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get a single Opportunity", + "operationId": "v2_opportunities_opportunityId__GET", "tags": [ - "persons" + "opportunities" ], "parameters": [ { - "name": "id", - "description": "Persons ID", + "name": "opportunityId", + "description": "Opportunity ID", "in": "path", "required": true, "schema": { @@ -1761,14 +2217,74 @@ "minimum": 1, "maximum": 9223372036854776000 } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Opportunity" + } + } + }, + "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/persons": { + "get": { + "description": "Paginate through Persons in Affinity.\nReturns basic information and non-list-specific field data on each Person.\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/persons/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, Persons 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 People directory\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get all Persons", + "operationId": "v2_persons__GET", + "tags": [ + "persons" + ], + "parameters": [ { "name": "cursor", "description": "Cursor for the next or previous page", "in": "query", "schema": { - "type": "string" - } + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { "name": "limit", @@ -1779,17 +2295,85 @@ "format": "int32", "minimum": 1, "maximum": 100, - "default": 100 - } + "default": 100, + "examples": [ + 100 + ] + }, + "example": 100 + }, + { + "name": "ids", + "description": "People IDs", + "in": "query", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 + } + }, + "example": [ + 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" + }, + "examples": [ + [ + "field-1" + ] + ] + }, + "example": [ + "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", + "enum": [ + "enriched", + "global", + "relationship-intelligence" + ] + } + }, + "example": [ + "enriched", + "global" + ] } ], "responses": { "200": { - "description": "Get a Person's List Entries", + "description": "OK", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListEntryPaged" + "$ref": "#/components/schemas/PersonPaged" } } }, @@ -1820,1057 +2404,1327 @@ "403": { "$ref": "#/components/responses/403" }, - "404": { - "$ref": "#/components/responses/404" - }, "default": { "$ref": "#/components/responses/default" } } } - } - }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer" - } - }, - "headers": { - "X-Ratelimit-Limit-User": { - "description": "Number of requests allowed per minute for the user", - "schema": { - "type": "integer" - } - }, - "X-Ratelimit-Limit-User-Remaining": { - "description": "Number of requests remaining for the user", - "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" - } - }, - "X-Ratelimit-Limit-Org-Remaining": { - "description": "Number of requests remaining for the account", - "schema": { - "type": "integer" - } - }, - "X-Ratelimit-Limit-Org-Reset": { - "description": "Time in seconds before the limit resets for the account", - "schema": { - "type": "integer" - } - } }, - "schemas": { - "AuthenticationError": { - "title": "AuthenticationError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "authentication" - }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" + "/v2/persons/{personId}": { + "get": { + "description": "Returns basic information and non-list-specific field data on the requested Person.\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/persons/fields` endpoint.\nWhen no `fieldIds` or `fieldTypes` are provided, Persons 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 People directory\" [permission](#section/Getting-Started/Permissions).", + "summary": "Get a single Person", + "operationId": "v2_persons_personId__GET", + "tags": [ + "persons" ], - "additionalProperties": false, - "examples": [ + "parameters": [ { - "code": "authentication", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "AuthorizationError": { - "title": "AuthorizationError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "authorization" + "name": "personId", + "description": "Person ID", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 + } }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false, - "examples": [ { - "code": "authorization", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "BadRequestError": { - "title": "BadRequestError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "bad-request" + "name": "fieldIds", + "description": "Field IDs for which to return field data", + "in": "query", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "field-1" + ] + ] + }, + "example": [ + "field-1", + "field-2" + ] }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false, - "examples": [ { - "code": "bad-request", - "message": "🚨 Error! Sound the alarm! 🚨" + "name": "fieldTypes", + "description": "Field Types for which to return field data", + "in": "query", + "style": "form", + "explode": true, + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "enriched", + "global", + "relationship-intelligence" + ] + } + }, + "example": [ + "enriched", + "global" + ] } - ] - }, - "ConflictError": { - "title": "ConflictError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "conflict" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Person" + } + } + }, + "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" + } + } }, - "message": { - "description": "Error message", - "type": "string" + "400": { + "$ref": "#/components/responses/400" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "default": { + "$ref": "#/components/responses/default" } - }, - "required": [ - "code", - "message" + } + } + }, + "/v2/persons/fields": { + "get": { + "description": "Returns metadata on non-list-specific Person Fields.\n\nUse the returned Field IDs to request field data from the GET `/v2/persons` and GET `/v2/persons/{id}` endpoints.", + "summary": "Get metadata on Person Fields", + "operationId": "v2_persons_fields__GET", + "tags": [ + "persons" ], - "additionalProperties": false, - "examples": [ + "parameters": [ { - "code": "conflict", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "MethodNotAllowedError": { - "title": "MethodNotAllowedError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "method-not-allowed" + "name": "cursor", + "description": "Cursor for the next or previous page", + "in": "query", + "schema": { + "type": "string" + } }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false, - "examples": [ { - "code": "method-not-allowed", - "message": "🚨 Error! Sound the alarm! 🚨" + "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 + ] + }, + "example": 100 } - ] - }, - "NotAcceptableError": { - "title": "NotAcceptableError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "not-acceptable" + ], + "responses": { + "200": { + "description": "OK", + "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" + } + } }, - "message": { - "description": "Error message", - "type": "string" + "400": { + "$ref": "#/components/responses/400" + }, + "default": { + "$ref": "#/components/responses/default" } - }, - "required": [ - "code", - "message" + } + } + }, + "/v2/persons/{personId}/lists": { + "get": { + "description": "Returns metadata for all the Lists on which the given Person appears.", + "summary": "Get a Person's Lists", + "operationId": "v2_persons_personId_lists__GET", + "tags": [ + "persons" ], - "additionalProperties": false, - "examples": [ + "parameters": [ { - "code": "not-acceptable", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "NotFoundError": { - "title": "NotFoundError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "not-found" + "name": "personId", + "description": "Persons ID", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 + } }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false, - "examples": [ { - "code": "not-found", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "NotImplementedError": { - "title": "NotImplementedError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "not-implemented" + "name": "cursor", + "description": "Cursor for the next or previous page", + "in": "query", + "schema": { + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false, - "examples": [ { - "code": "not-implemented", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "RateLimitError": { - "title": "RateLimitError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "rate-limit" - }, - "message": { - "description": "Error message", - "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, + "examples": [ + 100 + ] + }, + "example": 100 } - }, - "required": [ - "code", - "message" ], - "additionalProperties": false, - "examples": [ - { - "code": "rate-limit", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "ServerError": { - "title": "ServerError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "server" + "responses": { + "200": { + "description": "OK", + "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" + } + } }, - "message": { - "description": "Error message", - "type": "string" + "400": { + "$ref": "#/components/responses/400" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "default": { + "$ref": "#/components/responses/default" } - }, - "required": [ - "code", - "message" + } + } + }, + "/v2/persons/{personId}/list-entries": { + "get": { + "description": "Paginate through the List Entries (AKA rows) for the given Person across all Lists.\nEach List Entry includes field data for the Person, 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 Person's List Entries", + "operationId": "v2_persons_personId_list-entries__GET", + "tags": [ + "persons" ], - "additionalProperties": false, - "examples": [ + "parameters": [ { - "code": "server", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "UnprocessableEntityError": { - "title": "UnprocessableEntityError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "unprocessable-entity" + "name": "personId", + "description": "Persons ID", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9223372036854776000 + } }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false, - "examples": [ { - "code": "unprocessable-entity", - "message": "🚨 Error! Sound the alarm! 🚨" - } - ] - }, - "UnsupportedMediaTypeError": { - "title": "UnsupportedMediaTypeError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "unsupported-media-type" + "name": "cursor", + "description": "Cursor for the next or previous page", + "in": "query", + "schema": { + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" + ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, - "message": { - "description": "Error message", - "type": "string" - } - }, - "required": [ - "code", - "message" - ], - "additionalProperties": false, - "examples": [ { - "code": "unsupported-media-type", - "message": "🚨 Error! Sound the alarm! 🚨" + "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 + ] + }, + "example": 100 } - ] - }, - "ValidationError": { - "title": "ValidationError", - "type": "object", - "properties": { - "code": { - "description": "Error code", - "type": "string", - "const": "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! 🚨" - } - ] - }, - "Error": { - "title": "Error", - "oneOf": [ - { - "$ref": "#/components/schemas/AuthenticationError" - }, - { - "$ref": "#/components/schemas/AuthorizationError" - }, - { - "$ref": "#/components/schemas/BadRequestError" - }, - { - "$ref": "#/components/schemas/ConflictError" + "responses": { + "200": { + "description": "OK", + "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" + } + } }, - { - "$ref": "#/components/schemas/MethodNotAllowedError" + "400": { + "$ref": "#/components/responses/400" }, - { - "$ref": "#/components/schemas/NotAcceptableError" + "403": { + "$ref": "#/components/responses/403" }, - { - "$ref": "#/components/schemas/NotFoundError" + "404": { + "$ref": "#/components/responses/404" }, + "default": { + "$ref": "#/components/responses/default" + } + } + } + }, + "/v2/person-merges": { + "get": { + "x-stability-level": "beta", + "description": "| ⚠️ Coming soon |\n|--|\n\n\nRetrieve a paginated list of person merges for the organization.\n\n\nReturns all person merges initiated by users in your organization, including their current\nstatus, the persons involved, and merge details.\n\n\nYou can filter person merges using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties.\n| **Property Name** | **Type** | **Allowed Operators** | **Allowed values** | **Examples** |\n|-----------------------------|---------|-----------------------|-------------------------------------|----------------------------------------------------------|\n| `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` |\n| `taskId` | `string`| `=` | | `taskId=789e0123-e45b-67c8-d901-234567890123` |\n\n\nPerson merges are returned in reverse chronological order (most recent first).\n\n\nRequires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and\norganization admin role.\n", + "summary": "Get All Person Merges [COMING SOON]", + "operationId": "v2_person-merges__GET", + "tags": [ + "personMerges" + ], + "parameters": [ { - "$ref": "#/components/schemas/NotImplementedError" + "name": "cursor", + "description": "Cursor for the next or previous page", + "in": "query", + "schema": { + "type": "string" + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, { - "$ref": "#/components/schemas/RateLimitError" + "name": "limit", + "description": "Number of items to include in the page", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 100, + "default": 25 + }, + "example": 25 }, { - "$ref": "#/components/schemas/ServerError" + "name": "filter", + "description": "Filter person 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/PersonMergeStatePaged" + }, + "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" + } + } }, - { - "$ref": "#/components/schemas/UnprocessableEntityError" + "400": { + "$ref": "#/components/responses/400" }, - { - "$ref": "#/components/schemas/UnsupportedMediaTypeError" + "403": { + "$ref": "#/components/responses/403" }, - { - "$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" + "default": { + "$ref": "#/components/responses/default" } } }, - "Errors": { - "title": "Errors", - "type": "object", - "properties": { - "errors": { - "description": "Errors", - "type": "array", - "items": { - "$ref": "#/components/schemas/Error" + "post": { + "x-stability-level": "beta", + "description": "| ⚠️ Coming soon |\n|--|\n\nInitiate a person merge to combine a duplicate person profile into a primary person profile.\n\nThis is an asynchronous process that will merge all data from the duplicate person into the primary person. Once the merge is initiated, you can track its progress using the returned [task URL](#tag/personMerges/operation/v2_tasks_person-merges_taskId__GET).\n\nRequires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role.", + "summary": "Initiate Person Merge [COMING SOON]", + "operationId": "v2_person-merges__POST", + "tags": [ + "personMerges" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonMergeRequest" + }, + "examples": { + "merge-persons": { + "$ref": "#/components/examples/merge-persons" + } + } } } }, - "required": [ - "errors" - ], - "additionalProperties": false - }, - "Tenant": { - "title": "Tenant", - "type": "object", - "properties": { - "id": { - "description": "The tenant's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] + "responses": { + "202": { + "description": "Accepted", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonMergeResponse" + }, + "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" + } + } }, - "name": { - "description": "The name of the tenant", - "type": "string", - "examples": [ - "Contoso Ltd." - ] + "400": { + "$ref": "#/components/responses/400" }, - "subdomain": { - "description": "The tenant's subdomain under affinity.co", - "type": "string", - "format": "hostname", - "examples": [ - "contoso" - ] + "403": { + "$ref": "#/components/responses/403" + }, + "default": { + "$ref": "#/components/responses/default" } - }, - "required": [ - "id", - "name", - "subdomain" + } + } + }, + "/v2/person-merges/{mergeId}": { + "get": { + "x-stability-level": "beta", + "description": "| ⚠️ Coming soon |\n|--|\n\nRetrieve the status and details of a specific person merge.\n\nReturns information about the person merge including its current status, the persons involved, timestamps, and any error information if the merge failed.\n\nThe `mergeId` can be obtained from the response of the [Get All Person Merges](#tag/personMerges/operation/v2_person-merges__GET) endpoint, or by filtering person merges by task ID using `/v2/person-merges?filter=taskId={taskId}` after initiating a merge.\n\nRequires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role.", + "summary": "Get Person Merge [COMING SOON]", + "operationId": "v2_person-merges_mergeId__GET", + "tags": [ + "personMerges" ], - "additionalProperties": false, - "examples": [ + "parameters": [ { - "name": "Contoso Ltd.", - "subdomain": "contoso", - "id": 1 + "name": "mergeId", + "description": "Person merge ID", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 12345 + ] + } } - ] - }, - "User": { - "title": "User", - "type": "object", - "properties": { - "id": { - "description": "The user's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonMergeState" + }, + "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" + } + } }, - "firstName": { - "description": "The user's first name", - "type": "string", - "examples": [ - "John" - ] + "400": { + "$ref": "#/components/responses/400" }, - "lastName": { - "description": "The user's last name", - "type": [ - "string", - "null" - ], - "examples": [ - "Smith" - ] + "403": { + "$ref": "#/components/responses/403" }, - "emailAddress": { - "description": "The user's email address", - "type": "string", - "format": "email", - "examples": [ - "john.smith@contoso.com" - ] + "404": { + "$ref": "#/components/responses/404" + }, + "default": { + "$ref": "#/components/responses/default" } - }, - "required": [ - "emailAddress", - "firstName", - "id", - "lastName" + } + } + }, + "/v2/tasks/person-merges": { + "get": { + "x-stability-level": "beta", + "description": "| ⚠️ Coming soon |\n|--|\n\n\nRetrieve a paginated list of person merge tasks for the organization.\n\n\nReturns all merge tasks initiated by users in your organization, including their current status,\nthe persons involved, and task details.\n\n\nYou can filter tasks using the `filter` query parameter. The filter parameter is a string that you can specify conditions based on the following properties.\n| **Property Name** | **Type** | **Allowed Operators** | **Allowed values** | **Examples** |\n|-----------------------------|---------|-----------------------|-------------------------------------|----------------------------------|\n| `status` | `enum` | `=` | `in-progress`, `success`, `failed` | `status=failed` |\n\n\nTasks are returned in reverse chronological order (most recent first).\n\n\nRequires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and\norganization admin role.\n", + "summary": "Get All Person Merge Tasks [COMING SOON]", + "operationId": "v2_tasks_person-merges__GET", + "tags": [ + "personMerges" ], - "additionalProperties": false, - "examples": [ + "parameters": [ { - "firstName": "John", - "lastName": "Smith", - "emailAddress": "john.smith@contoso.com", - "id": 1 - } - ] - }, - "Grant": { - "title": "Grant", - "type": "object", - "properties": { - "type": { - "description": "The type of grant used to authenticate", - "type": "string", - "const": "api-key", - "examples": [ - "api-key" - ] - }, - "scopes": { - "description": "The scopes available to the current grant", - "type": "array", - "items": { - "type": "string" - }, - "examples": [ - [ - "api" + "name": "cursor", + "description": "Cursor for the next or previous page", + "in": "query", + "schema": { + "type": "string", + "examples": [ + "ICAgICAgYmVmb3JlOjo6Nw" ] - ] + }, + "example": "ICAgICAgYmVmb3JlOjo6Nw" }, - "createdAt": { - "description": "When the grant was created", - "type": "string", - "format": "date-time", - "examples": [ - "2023-01-01T00:00:00Z" - ] - } - }, - "required": [ - "createdAt", - "scopes", - "type" - ], - "additionalProperties": false, - "examples": [ { - "createdAt": "2023-01-01T00:00:00Z", - "scopes": [ - "api" - ], - "type": "api-key" - } - ] - }, - "WhoAmI": { - "title": "WhoAmI", - "description": "WhoAmI model", - "type": "object", - "properties": { - "tenant": { - "$ref": "#/components/schemas/Tenant" - }, - "user": { - "$ref": "#/components/schemas/User" + "name": "limit", + "description": "Number of items to include in the page", + "in": "query", + "schema": { + "type": "integer", + "format": "int32", + "minimum": 1, + "maximum": 100, + "default": 25, + "examples": [ + 25 + ] + }, + "example": 25 }, - "grant": { - "$ref": "#/components/schemas/Grant" - } - }, - "required": [ - "grant", - "tenant", - "user" - ], - "additionalProperties": false, - "examples": [ { - "grant": { - "createdAt": "2023-01-01T00:00:00Z", - "scopes": [ - "api" - ], - "type": "api-key" - }, - "user": { - "firstName": "John", - "lastName": "Smith", - "emailAddress": "john.smith@contoso.com", - "id": 1 + "name": "filter", + "description": "Filter tasks using Affinity Filtering Language", + "in": "query", + "schema": { + "type": "string" }, - "tenant": { - "name": "Contoso Ltd.", - "subdomain": "contoso", - "id": 1 - } - } - ] - }, - "NotFoundErrors": { - "title": "NotFoundErrors", - "description": "NotFoundErrors model", - "type": "object", - "properties": { - "errors": { - "description": "NotFoundError errors", - "type": "array", - "items": { - "$ref": "#/components/schemas/NotFoundError" - } + "example": "status=failed" } - }, - "required": [ - "errors" ], - "additionalProperties": false, - "examples": [ - { - "errors": [ - { - "code": "not-found", - "message": "🚨 Error! Sound the alarm! 🚨" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonMergeTaskPaged" + }, + "examples": { + "tasks-list": { + "$ref": "#/components/examples/tasks-list" + } + } + } + }, + "headers": { + "X-Ratelimit-Limit-User": { + "$ref": "#/components/headers/X-Ratelimit-Limit-User" }, - { - "code": "not-found", - "message": "🚨 Error! Sound the alarm! 🚨" + "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/person-merges/{taskId}": { + "get": { + "x-stability-level": "beta", + "description": "| ⚠️ Coming soon |\n|--|\n\nRetrieve the status and details of a specific task for person merges.\n\nReturns information about the person merges for a specific task including its overall status, number of merges in-progress, completed, and failed.\n\nDetailed information about individual merges for this task can be found by querying: `/v2/person-merges?filter=taskId={taskId}` See [Person Merges](#tag/personMerges/operation/v2_person-merges__GET) for more details.\n\nTask statuses:\n- `in-progress`: The merge task is currently being processed - `success`: The merge task completed successfully - `failed`: The merge task failed\n\nRequires the \"Manage duplicates\" [permission](#section/Getting-Started/Permissions) and organization admin role.", + "summary": "Get Person Merge Task [COMING SOON]", + "operationId": "v2_tasks_person-merges_taskId__GET", + "tags": [ + "personMerges" + ], + "parameters": [ + { + "name": "taskId", + "description": "Person 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/PersonMergeTask" + }, + "examples": { + "task-in-progress": { + "$ref": "#/components/examples/task-in-progress" + }, + "task-success": { + "$ref": "#/components/examples/task-success" + }, + "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": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer" + } + }, + "headers": { + "X-Ratelimit-Limit-User": { + "description": "Number of requests allowed per minute for the user", + "schema": { + "type": "integer" + } }, - "CompanyData": { - "title": "CompanyData", + "X-Ratelimit-Limit-User-Remaining": { + "description": "Number of requests remaining for the user", + "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" + } + }, + "X-Ratelimit-Limit-Org-Remaining": { + "description": "Number of requests remaining for the account", + "schema": { + "type": "integer" + } + }, + "X-Ratelimit-Limit-Org-Reset": { + "description": "Time in seconds before the limit resets for the account", + "schema": { + "type": "integer" + } + } + }, + "schemas": { + "AuthenticationError": { + "title": "AuthenticationError", "type": "object", "properties": { - "id": { - "description": "The company's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "name": { - "description": "The company's name", + "code": { + "description": "Error code", "type": "string", - "examples": [ - "Acme" - ] + "const": "authentication" }, - "domain": { - "description": "The company's primary domain", - "type": [ - "string", - "null" - ], - "format": "hostname", - "examples": [ - "acme.co" - ] + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "domain", - "id", - "name" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "authentication", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "CompanyValue": { - "title": "CompanyValue", + "AuthorizationError": { + "title": "AuthorizationError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "const": "company" + "const": "authorization" }, - "data": { - "oneOf": [ - { - "$ref": "#/components/schemas/CompanyData" - }, - { - "type": "null" - } - ] + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "authorization", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "CompaniesValue": { - "title": "CompaniesValue", + "BadRequestError": { + "title": "BadRequestError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "const": "company-multi" + "const": "bad-request" }, - "data": { - "description": "The values for many companies", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/components/schemas/CompanyData" - }, - "maxItems": 100 + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "bad-request", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "DateValue": { - "title": "DateValue", + "ConflictError": { + "title": "ConflictError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "const": "datetime" + "const": "conflict" }, - "data": { - "description": "The value for a date", - "type": [ - "string", - "null" - ], - "format": "date-time" + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "conflict", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "Dropdown": { - "title": "Dropdown", + "MethodNotAllowedError": { + "title": "MethodNotAllowedError", "type": "object", "properties": { - "dropdownOptionId": { - "description": "Dropdown item's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "text": { - "description": "Dropdown item text", + "code": { + "description": "Error code", "type": "string", - "examples": [ - "first" - ] + "const": "method-not-allowed" + }, + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "dropdownOptionId", - "text" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "method-not-allowed", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "DropdownValue": { - "title": "DropdownValue", + "NotAcceptableError": { + "title": "NotAcceptableError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "const": "dropdown" + "const": "not-acceptable" }, - "data": { - "oneOf": [ - { - "$ref": "#/components/schemas/Dropdown" - }, - { - "type": "null" - } - ] + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "not-acceptable", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "DropdownsValue": { - "title": "DropdownsValue", + "NotFoundError": { + "title": "NotFoundError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "const": "dropdown-multi" + "const": "not-found" }, - "data": { - "description": "The value for many dropdown items", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/components/schemas/Dropdown" - } + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "not-found", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "FloatValue": { - "title": "FloatValue", + "NotImplementedError": { + "title": "NotImplementedError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "const": "number" + "const": "not-implemented" }, - "data": { - "description": "The value for a number", - "type": [ - "number", - "null" - ] + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "not-implemented", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "FloatsValue": { - "title": "FloatsValue", + "RateLimitError": { + "title": "RateLimitError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "const": "number-multi" + "const": "rate-limit" }, - "data": { - "description": "The value for many numbers", - "type": [ - "array", - "null" - ], - "items": { - "type": "number" - } + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "rate-limit", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "TextValue": { - "title": "TextValue", + "ServerError": { + "title": "ServerError", "type": "object", "properties": { - "type": { - "description": "The type of value", + "code": { + "description": "Error code", "type": "string", - "enum": [ - "filterable-text", - "text" - ], - "examples": [ - "filterable-text" - ] + "const": "server" }, - "data": { - "description": "The value for a string", - "type": [ - "string", - "null" - ] + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false - }, - "TextsValue": { - "title": "TextsValue", - "type": "object", - "properties": { - "type": { - "description": "The type of value", + "additionalProperties": false, + "examples": [ + { + "code": "server", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] + }, + "UnprocessableEntityError": { + "title": "UnprocessableEntityError", + "type": "object", + "properties": { + "code": { + "description": "Error code", "type": "string", - "const": "filterable-text-multi" + "const": "unprocessable-entity" }, - "data": { - "description": "The value for many strings", - "type": [ - "array", - "null" - ], - "items": { - "type": "string" - } + "message": { + "description": "Error message", + "type": "string" } }, "required": [ - "data", - "type" + "code", + "message" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "code": "unprocessable-entity", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] }, - "FormulaNumber": { - "title": "FormulaNumber", + "UnsupportedMediaTypeError": { + "title": "UnsupportedMediaTypeError", "type": "object", "properties": { - "calculatedValue": { - "description": "Calculated value", - "type": [ - "number", - "null" - ] + "code": { + "description": "Error code", + "type": "string", + "const": "unsupported-media-type" + }, + "message": { + "description": "Error message", + "type": "string" + } + }, + "required": [ + "code", + "message" + ], + "additionalProperties": false, + "examples": [ + { + "code": "unsupported-media-type", + "message": "🚨 Error! Sound the alarm! 🚨" + } + ] + }, + "ValidationError": { + "title": "ValidationError", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string", + "const": "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! 🚨" + } + ] + }, + "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" + } + } + }, + "Errors": { + "title": "Errors", + "type": "object", + "properties": { + "errors": { + "description": "Errors", + "type": "array", + "items": { + "$ref": "#/components/schemas/Error" + } } }, + "required": [ + "errors" + ], "additionalProperties": false }, - "FormulaValue": { - "title": "FormulaValue", + "Tenant": { + "title": "Tenant", "type": "object", "properties": { - "type": { - "description": "The type of value", + "id": { + "description": "The tenant's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "name": { + "description": "The name of the tenant", "type": "string", - "const": "formula-number" + "examples": [ + "Contoso Ltd." + ] }, - "data": { - "oneOf": [ - { - "$ref": "#/components/schemas/FormulaNumber" - }, - { - "type": "null" - } + "subdomain": { + "description": "The tenant's subdomain under affinity.co", + "type": "string", + "format": "hostname", + "examples": [ + "contoso" ] } }, "required": [ - "data", - "type" + "id", + "name", + "subdomain" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "name": "Contoso Ltd.", + "subdomain": "contoso", + "id": 1 + } + ] }, - "PersonData": { - "title": "PersonData", + "User": { + "title": "User", "type": "object", "properties": { "id": { - "description": "The persons's unique identifier", + "description": "The user's unique identifier", "type": "integer", "format": "int64", "minimum": 1, @@ -2880,72 +3734,181 @@ ] }, "firstName": { - "description": "The person's first name", - "type": [ - "string", - "null" - ], + "description": "The user's first name", + "type": "string", "examples": [ - "Jane" + "John" ] }, "lastName": { - "description": "The person's last name", + "description": "The user's last name", "type": [ "string", "null" ], "examples": [ - "Doe" + "Smith" ] }, - "primaryEmailAddress": { - "description": "The person's primary email address", - "type": [ - "string", - "null" - ], + "emailAddress": { + "description": "The user's email address", + "type": "string", "format": "email", "examples": [ - "jane.doe@acme.co" + "john.smith@contoso.com" ] - }, + } + }, + "required": [ + "emailAddress", + "firstName", + "id", + "lastName" + ], + "additionalProperties": false, + "examples": [ + { + "firstName": "John", + "lastName": "Smith", + "emailAddress": "john.smith@contoso.com", + "id": 1 + } + ] + }, + "Grant": { + "title": "Grant", + "type": "object", + "properties": { "type": { - "description": "The person's type", + "description": "The type of grant used to authenticate", "type": "string", "enum": [ - "internal", - "external", - "collaborator" + "api-key", + "access-token" ], "examples": [ - "internal" + "api-key" + ] + }, + "scopes": { + "description": "The scopes available to the current grant", + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "api" + ] + ] + }, + "createdAt": { + "description": "When the grant was created", + "type": "string", + "format": "date-time", + "examples": [ + "2023-01-01T00:00:00Z" ] } }, "required": [ - "firstName", - "id", - "lastName", - "primaryEmailAddress", + "createdAt", + "scopes", "type" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "createdAt": "2023-01-01T00:00:00Z", + "scopes": [ + "api" + ], + "type": "api-key" + } + ] }, - "ChatMessage": { - "title": "ChatMessage", + "WhoAmI": { + "title": "WhoAmI", + "description": "WhoAmI model", "type": "object", "properties": { - "type": { - "description": "The type of interaction", - "type": "string", - "const": "chat-message", - "examples": [ - "chat-message" - ] + "tenant": { + "$ref": "#/components/schemas/Tenant" + }, + "user": { + "$ref": "#/components/schemas/User" }, + "grant": { + "$ref": "#/components/schemas/Grant" + } + }, + "required": [ + "grant", + "tenant", + "user" + ], + "additionalProperties": false, + "examples": [ + { + "grant": { + "createdAt": "2023-01-01T00:00:00Z", + "scopes": [ + "api" + ], + "type": "api-key" + }, + "user": { + "firstName": "John", + "lastName": "Smith", + "emailAddress": "john.smith@contoso.com", + "id": 1 + }, + "tenant": { + "name": "Contoso Ltd.", + "subdomain": "contoso", + "id": 1 + } + } + ] + }, + "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! 🚨" + } + ] + } + ] + }, + "PersonData": { + "title": "PersonData", + "type": "object", + "properties": { "id": { - "description": "The chat message's unique identifier", + "description": "The persons's unique identifier", "type": "integer", "format": "int64", "minimum": 1, @@ -2954,62 +3917,74 @@ 1 ] }, - "direction": { - "description": "The direction of the chat message", - "type": "string", - "enum": [ - "received", - "sent" + "firstName": { + "description": "The person's first name", + "type": [ + "string", + "null" ], "examples": [ - "outbound" + "Jane" ] }, - "sentAt": { - "description": "The time the chat message was sent", - "type": "string", - "format": "date-time", + "lastName": { + "description": "The person's last name", + "type": [ + "string", + "null" + ], "examples": [ - "2023-01-01T00:00:00Z" + "Doe" ] }, - "manualCreator": { - "$ref": "#/components/schemas/PersonData" + "primaryEmailAddress": { + "description": "The person's primary email address", + "type": [ + "string", + "null" + ], + "format": "email", + "examples": [ + "jane.doe@acme.co" + ] }, - "participants": { - "description": "The participants of the chat", - "type": "array", - "items": { - "$ref": "#/components/schemas/PersonData" - } + "type": { + "description": "The person's type", + "type": "string", + "enum": [ + "internal", + "external", + "collaborator" + ], + "examples": [ + "internal" + ] } }, "required": [ - "direction", + "firstName", "id", - "manualCreator", - "participants", - "sentAt", + "lastName", + "primaryEmailAddress", "type" ], "additionalProperties": false }, - "Attendee": { - "title": "Attendee", + "Participant": { + "x-stability-level": "beta", + "title": "interactions.Participant", "type": "object", "properties": { "emailAddress": { - "description": "The email addresses of the attendee", - "type": [ - "string", - "null" - ], + "description": "The email address of the participant", + "type": "string", "format": "email", "examples": [ - "john.smith@contoso.com" + "jane.doe@gmail.com" ] }, "person": { + "description": "The participant's metadata (this can be null if we do not find a corresponding person to the email address)", "oneOf": [ { "$ref": "#/components/schemas/PersonData" @@ -3026,166 +4001,94 @@ ], "additionalProperties": false }, - "Email": { - "title": "Email", + "ParticipantsPreview": { + "x-stability-level": "beta", + "title": "interactions.ParticipantsPreview", "type": "object", "properties": { - "type": { - "description": "The type of interaction", - "type": "string", - "const": "email", - "examples": [ - "email" - ] + "data": { + "description": "A preview of Participants", + "type": "array", + "items": { + "$ref": "#/components/schemas/Participant" + }, + "maxItems": 100 }, - "id": { - "description": "The email's unique identifier", + "totalCount": { + "description": "The total count of Participants", "type": "integer", "format": "int64", - "minimum": 1, + "minimum": 0, "maximum": 9007199254740991, "examples": [ - 1 + 200 ] - }, - "subject": { - "description": "The subject of the email", - "type": [ - "string", - "null" - ], - "examples": [ - "Acme Upsell $10k" - ] - }, - "sentAt": { - "description": "The time the email was sent", - "type": "string", - "format": "date-time", - "examples": [ - "2023-01-01T00:00:00Z" - ] - }, - "from": { - "$ref": "#/components/schemas/Attendee" - }, - "to": { - "description": "The recipients of the email", - "type": "array", - "items": { - "$ref": "#/components/schemas/Attendee" - } - }, - "cc": { - "description": "The cc recipients of the email", - "type": "array", - "items": { - "$ref": "#/components/schemas/Attendee" - } } }, "required": [ - "cc", - "from", - "id", - "sentAt", - "subject", - "to", - "type" + "data", + "totalCount" ], "additionalProperties": false }, - "Meeting": { - "title": "Meeting", + "Pagination": { + "title": "Pagination", "type": "object", "properties": { - "type": { - "description": "The type of interaction", - "type": "string", - "const": "meeting", - "examples": [ - "meeting" - ] - }, - "id": { - "description": "The meeting's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "title": { - "description": "The meeting's title", + "prevUrl": { + "description": "URL for the previous page", "type": [ "string", "null" ], + "format": "uri", "examples": [ - "Acme Upsell $10k" - ] - }, - "allDay": { - "description": "Whether the meeting is an all-day event", - "type": "boolean", - "examples": [ - false - ] - }, - "startTime": { - "description": "The meeting start time", - "type": "string", - "format": "date-time", - "examples": [ - "2023-02-03T04:00:00Z" + "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw" ] }, - "endTime": { - "description": "The meeting end time", + "nextUrl": { + "description": "URL for the next page", "type": [ "string", "null" ], - "format": "date-time", + "format": "uri", "examples": [ - "2023-02-03T05:00:00Z" + "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" ] - }, - "attendees": { - "description": "People attending the meeting", - "type": "array", - "items": { - "$ref": "#/components/schemas/Attendee" - } } }, - "required": [ - "allDay", - "attendees", - "endTime", - "id", - "startTime", - "title", - "type" + "examples": [ + { + "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + } + ] + }, + "PaginationWithTotalCount": { + "title": "PaginationWithTotalCount", + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + } ], - "additionalProperties": false + "properties": { + "totalCount": { + "description": "The total count of the collection. Only included if requested via the totalCount query string parameter.", + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 9007199254740991 + } + } }, - "PhoneCall": { - "title": "PhoneCall", + "CompanyData": { + "title": "CompanyData", "type": "object", "properties": { - "type": { - "description": "The type of interaction", - "type": "string", - "const": "call", - "examples": [ - "call" - ] - }, "id": { - "description": "The phon_call's unique identifier", + "description": "The company's unique identifier", "type": "integer", "format": "int64", "minimum": 1, @@ -3194,69 +4097,45 @@ 1 ] }, - "startTime": { - "description": "The call start time", + "name": { + "description": "The company's name", "type": "string", - "format": "date-time", "examples": [ - "2023-02-03T04:00:00Z" + "Acme" ] }, - "attendees": { - "description": "People attending the call", - "type": "array", - "items": { - "$ref": "#/components/schemas/Attendee" - } + "domain": { + "description": "The company's primary domain", + "type": [ + "string", + "null" + ], + "format": "hostname", + "examples": [ + "acme.co" + ] } }, "required": [ - "attendees", + "domain", "id", - "startTime", - "type" + "name" ], "additionalProperties": false }, - "Interaction": { - "title": "Interaction", - "oneOf": [ - { - "$ref": "#/components/schemas/ChatMessage" - }, - { - "$ref": "#/components/schemas/Email" - }, - { - "$ref": "#/components/schemas/Meeting" - }, - { - "$ref": "#/components/schemas/PhoneCall" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "chat-message": "#/components/schemas/ChatMessage", - "email": "#/components/schemas/Email", - "meeting": "#/components/schemas/Meeting", - "call": "#/components/schemas/PhoneCall" - } - } - }, - "InteractionValue": { - "title": "InteractionValue", + "CompanyValue": { + "title": "CompanyValue", "type": "object", "properties": { "type": { "description": "The type of value", "type": "string", - "const": "interaction" + "const": "company" }, "data": { "oneOf": [ { - "$ref": "#/components/schemas/Interaction" + "$ref": "#/components/schemas/CompanyData" }, { "type": "null" @@ -3270,92 +4149,98 @@ ], "additionalProperties": false }, - "Location": { - "title": "Location", + "CompaniesValue": { + "title": "CompaniesValue", "type": "object", "properties": { - "streetAddress": { - "description": "Street address", + "type": { + "description": "The type of value", + "type": "string", + "const": "company-multi" + }, + "data": { + "description": "The values for many companies", "type": [ - "string", + "array", "null" ], - "examples": [ - "170 Columbus Ave" - ] + "items": { + "$ref": "#/components/schemas/CompanyData" + }, + "maxItems": 100 + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "DateValue": { + "title": "DateValue", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "datetime" }, - "city": { - "description": "City", + "data": { + "description": "The value for a date", "type": [ "string", "null" ], + "format": "date-time" + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "Dropdown": { + "title": "Dropdown", + "type": "object", + "properties": { + "dropdownOptionId": { + "description": "Dropdown item's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, "examples": [ - "San Francisco" + 1 ] }, - "state": { - "description": "State", - "type": [ - "string", - "null" - ], - "examples": [ - "California" - ] - }, - "country": { - "description": "Country", - "type": [ - "string", - "null" - ], - "examples": [ - "United States" - ] - }, - "continent": { - "description": "Continent", - "type": [ - "string", - "null" - ], + "text": { + "description": "Dropdown item text", + "type": "string", "examples": [ - "North America" + "first" ] } }, "required": [ - "city", - "continent", - "country", - "state", - "streetAddress" + "dropdownOptionId", + "text" ], - "additionalProperties": false, - "examples": [ - { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - } - ] + "additionalProperties": false }, - "LocationValue": { - "title": "LocationValue", + "DropdownValue": { + "title": "DropdownValue", "type": "object", "properties": { "type": { "description": "The type of value", "type": "string", - "const": "location" + "const": "dropdown" }, "data": { "oneOf": [ { - "$ref": "#/components/schemas/Location" + "$ref": "#/components/schemas/Dropdown" }, { "type": "null" @@ -3369,23 +4254,23 @@ ], "additionalProperties": false }, - "LocationsValue": { - "title": "LocationsValue", + "DropdownsValue": { + "title": "DropdownsValue", "type": "object", "properties": { "type": { "description": "The type of value", "type": "string", - "const": "location-multi" + "const": "dropdown-multi" }, "data": { - "description": "The values for many locations", + "description": "The value for many dropdown items", "type": [ "array", "null" ], "items": { - "$ref": "#/components/schemas/Location" + "$ref": "#/components/schemas/Dropdown" } } }, @@ -3395,23 +4280,20 @@ ], "additionalProperties": false }, - "PersonValue": { - "title": "PersonValue", + "FloatValue": { + "title": "FloatValue", "type": "object", "properties": { "type": { "description": "The type of value", "type": "string", - "const": "person" + "const": "number" }, "data": { - "oneOf": [ - { - "$ref": "#/components/schemas/PersonData" - }, - { - "type": "null" - } + "description": "The value for a number", + "type": [ + "number", + "null" ] } }, @@ -3421,25 +4303,24 @@ ], "additionalProperties": false }, - "PersonsValue": { - "title": "PersonsValue", + "FloatsValue": { + "title": "FloatsValue", "type": "object", "properties": { "type": { "description": "The type of value", "type": "string", - "const": "person-multi" + "const": "number-multi" }, "data": { - "description": "The values for many persons", + "description": "The value for many numbers", "type": [ "array", "null" ], "items": { - "$ref": "#/components/schemas/PersonData" - }, - "maxItems": 100 + "type": "number" + } } }, "required": [ @@ -3448,69 +4329,88 @@ ], "additionalProperties": false }, - "RankedDropdown": { - "title": "RankedDropdown", + "TextValue": { + "title": "TextValue", "type": "object", "properties": { - "dropdownOptionId": { - "description": "Dropdown item's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "text": { - "description": "Dropdown item text", + "type": { + "description": "The type of value", "type": "string", + "enum": [ + "filterable-text", + "text" + ], "examples": [ - "first" + "filterable-text" ] }, - "rank": { - "description": "Dropdown item rank", - "type": "integer", - "format": "int64", - "minimum": 0, - "maximum": 9007199254740991, - "examples": [ - 0 + "data": { + "description": "The value for a string", + "type": [ + "string", + "null" ] + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "TextsValue": { + "title": "TextsValue", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "filterable-text-multi" }, - "color": { - "description": "Dropdown item color", + "data": { + "description": "The value for many strings", "type": [ - "string", + "array", "null" ], - "examples": [ - "white" - ] + "items": { + "type": "string" + } } }, "required": [ - "color", - "dropdownOptionId", - "rank", - "text" + "data", + "type" ], "additionalProperties": false }, - "RankedDropdownValue": { - "title": "RankedDropdownValue", + "FormulaNumber": { + "title": "FormulaNumber", + "type": "object", + "properties": { + "calculatedValue": { + "description": "Calculated value", + "type": [ + "number", + "null" + ] + } + }, + "additionalProperties": false + }, + "FormulaValue": { + "title": "FormulaValue", "type": "object", "properties": { "type": { "description": "The type of value", "type": "string", - "const": "ranked-dropdown" + "const": "formula-number" }, "data": { "oneOf": [ { - "$ref": "#/components/schemas/RankedDropdown" + "$ref": "#/components/schemas/FormulaNumber" }, { "type": "null" @@ -3524,177 +4424,183 @@ ], "additionalProperties": false }, - "FieldValue": { - "title": "FieldValue", - "oneOf": [ - { - "$ref": "#/components/schemas/CompaniesValue" - }, - { - "$ref": "#/components/schemas/CompanyValue" - }, - { - "$ref": "#/components/schemas/DateValue" - }, - { - "$ref": "#/components/schemas/DropdownsValue" - }, - { - "$ref": "#/components/schemas/DropdownValue" - }, - { - "$ref": "#/components/schemas/FloatsValue" + "ChatMessage": { + "title": "ChatMessage", + "type": "object", + "properties": { + "type": { + "description": "The type of interaction", + "type": "string", + "const": "chat-message", + "examples": [ + "chat-message" + ] }, - { - "$ref": "#/components/schemas/FloatValue" + "id": { + "description": "The chat message's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] }, - { - "$ref": "#/components/schemas/FormulaValue" + "direction": { + "description": "The direction of the chat message", + "type": "string", + "enum": [ + "received", + "sent" + ], + "examples": [ + "sent" + ] }, - { - "$ref": "#/components/schemas/InteractionValue" + "sentAt": { + "description": "The time the chat message was sent", + "type": "string", + "format": "date-time", + "examples": [ + "2023-01-01T00:00:00Z" + ] }, - { - "$ref": "#/components/schemas/LocationsValue" + "manualCreator": { + "$ref": "#/components/schemas/PersonData" }, - { - "$ref": "#/components/schemas/LocationValue" - }, - { - "$ref": "#/components/schemas/PersonsValue" - }, - { - "$ref": "#/components/schemas/PersonValue" - }, - { - "$ref": "#/components/schemas/RankedDropdownValue" - }, - { - "$ref": "#/components/schemas/TextsValue" - }, - { - "$ref": "#/components/schemas/TextValue" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "company": "#/components/schemas/CompanyValue", - "company-multi": "#/components/schemas/CompaniesValue", - "datetime": "#/components/schemas/DateValue", - "dropdown": "#/components/schemas/DropdownValue", - "dropdown-multi": "#/components/schemas/DropdownsValue", - "number": "#/components/schemas/FloatValue", - "number-multi": "#/components/schemas/FloatsValue", - "filterable-text": "#/components/schemas/TextValue", - "filterable-text-multi": "#/components/schemas/TextsValue", - "formula-number": "#/components/schemas/FormulaValue", - "interaction": "#/components/schemas/InteractionValue", - "location": "#/components/schemas/LocationValue", - "location-multi": "#/components/schemas/LocationsValue", - "person": "#/components/schemas/PersonValue", - "person-multi": "#/components/schemas/PersonsValue", - "ranked-dropdown": "#/components/schemas/RankedDropdownValue", - "text": "#/components/schemas/TextValue" + "participants": { + "description": "The participants of the chat", + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonData" + } } }, - "examples": [ - { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - ] + "required": [ + "direction", + "id", + "manualCreator", + "participants", + "sentAt", + "type" + ], + "additionalProperties": false }, - "Field": { - "title": "Field", + "Attendee": { + "title": "Attendee", "type": "object", "properties": { - "id": { - "description": "The field's unique identifier", - "type": "string", + "emailAddress": { + "description": "The email addresses of the attendee", + "type": [ + "string", + "null" + ], + "format": "email", "examples": [ - "affinity-data-location" + "john.smith@contoso.com" ] }, - "name": { - "description": "The field's name", + "person": { + "oneOf": [ + { + "$ref": "#/components/schemas/PersonData" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "emailAddress", + "person" + ], + "additionalProperties": false + }, + "Email": { + "title": "Email", + "type": "object", + "properties": { + "type": { + "description": "The type of interaction", "type": "string", + "const": "email", "examples": [ - "Location" + "email" ] }, - "type": { - "description": "The field's type", - "type": "string", - "enum": [ - "enriched", - "global", - "list", - "relationship-intelligence" - ], + "id": { + "description": "The email's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, "examples": [ - "enriched" + 1 ] }, - "enrichmentSource": { - "description": "The source of the data in this Field (if it is enriched)", + "subject": { + "description": "The subject of the email", "type": [ "string", "null" ], - "enum": [ - "affinity-data", - "dealroom", - null - ], "examples": [ - "affinity-data" + "Acme Upsell $10k" ] }, - "value": { - "$ref": "#/components/schemas/FieldValue" + "sentAt": { + "description": "The time the email was sent", + "type": "string", + "format": "date-time", + "examples": [ + "2023-01-01T00:00:00Z" + ] + }, + "from": { + "$ref": "#/components/schemas/Attendee" + }, + "to": { + "description": "The recipients of the email", + "type": "array", + "items": { + "$ref": "#/components/schemas/Attendee" + } + }, + "cc": { + "description": "The cc recipients of the email", + "type": "array", + "items": { + "$ref": "#/components/schemas/Attendee" + } } }, "required": [ - "enrichmentSource", + "cc", + "from", "id", - "name", - "type", - "value" + "sentAt", + "subject", + "to", + "type" ], - "additionalProperties": false, - "examples": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - } - ] + "additionalProperties": false }, - "Company": { - "title": "Company", - "description": "Company model", + "Meeting": { + "title": "Meeting", "type": "object", "properties": { + "type": { + "description": "The type of interaction", + "type": "string", + "const": "meeting", + "examples": [ + "meeting" + ] + }, "id": { - "description": "The company's unique identifier", + "description": "The meeting's unique identifier", "type": "integer", "format": "int64", "minimum": 1, @@ -3703,591 +4609,632 @@ 1 ] }, - "name": { - "description": "The company's name", - "type": "string", - "examples": [ - "Acme" - ] - }, - "domain": { - "description": "The company's primary domain", + "title": { + "description": "The meeting's title", "type": [ "string", "null" ], - "format": "hostname", "examples": [ - "acme.co" + "Acme Upsell $10k" ] }, - "domains": { - "description": "All of the company's domains", - "type": "array", - "items": { - "type": "string", - "format": "hostname" - }, + "allDay": { + "description": "Whether the meeting is an all-day event", + "type": "boolean", "examples": [ - [ - "acme.co" - ] + false ] }, - "isGlobal": { - "description": "Whether or not the company is tenant specific", - "type": "boolean", + "startTime": { + "description": "The meeting start time", + "type": "string", + "format": "date-time", "examples": [ - true + "2023-02-03T04:00:00Z" ] }, - "fields": { - "description": "The fields associated with the company", - "type": "array", - "items": { - "$ref": "#/components/schemas/Field" - } - } - }, - "required": [ - "domain", - "domains", - "id", - "isGlobal", - "name" + "endTime": { + "description": "The meeting end time", + "type": [ + "string", + "null" + ], + "format": "date-time", + "examples": [ + "2023-02-03T05:00:00Z" + ] + }, + "attendees": { + "description": "People attending the meeting", + "type": "array", + "items": { + "$ref": "#/components/schemas/Attendee" + } + } + }, + "required": [ + "allDay", + "attendees", + "endTime", + "id", + "startTime", + "title", + "type" ], - "additionalProperties": false, - "examples": [ + "additionalProperties": false + }, + "PhoneCall": { + "title": "PhoneCall", + "type": "object", + "properties": { + "type": { + "description": "The type of interaction", + "type": "string", + "const": "call", + "examples": [ + "call" + ] + }, + "id": { + "description": "The phon_call's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "startTime": { + "description": "The call start time", + "type": "string", + "format": "date-time", + "examples": [ + "2023-02-03T04:00:00Z" + ] + }, + "attendees": { + "description": "People attending the call", + "type": "array", + "items": { + "$ref": "#/components/schemas/Attendee" + } + } + }, + "required": [ + "attendees", + "id", + "startTime", + "type" + ], + "additionalProperties": false + }, + "Interaction": { + "title": "Interaction", + "oneOf": [ { - "domain": "acme.co", - "name": "Acme", - "isGlobal": true, - "domains": [ - "acme.co" - ], - "id": 1, - "fields": [ + "$ref": "#/components/schemas/ChatMessage" + }, + { + "$ref": "#/components/schemas/Email" + }, + { + "$ref": "#/components/schemas/Meeting" + }, + { + "$ref": "#/components/schemas/PhoneCall" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "chat-message": "#/components/schemas/ChatMessage", + "email": "#/components/schemas/Email", + "meeting": "#/components/schemas/Meeting", + "call": "#/components/schemas/PhoneCall" + } + } + }, + "InteractionValue": { + "title": "InteractionValue", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "interaction" + }, + "data": { + "oneOf": [ { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } + "$ref": "#/components/schemas/Interaction" }, { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } + "type": "null" } ] } - ] + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false }, - "Pagination": { - "title": "Pagination", + "Location": { + "title": "Location", "type": "object", "properties": { - "prevUrl": { - "description": "URL for the previous page", + "streetAddress": { + "description": "Street address", "type": [ "string", "null" ], - "format": "url", "examples": [ - "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw" + "1 Main Street" ] }, - "nextUrl": { - "description": "URL for the next page", + "city": { + "description": "City", "type": [ "string", "null" ], - "format": "url", "examples": [ - "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + "San Francisco" + ] + }, + "state": { + "description": "State", + "type": [ + "string", + "null" + ], + "examples": [ + "California" + ] + }, + "country": { + "description": "Country", + "type": [ + "string", + "null" + ], + "examples": [ + "United States" + ] + }, + "continent": { + "description": "Continent", + "type": [ + "string", + "null" + ], + "examples": [ + "North America" ] } }, + "required": [ + "city", + "continent", + "country", + "state", + "streetAddress" + ], "additionalProperties": false, "examples": [ { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" } ] }, - "CompanyPaged": { - "title": "CompanyPaged", - "description": "CompanyPaged model", + "LocationValue": { + "title": "LocationValue", "type": "object", "properties": { - "data": { - "description": "A page of Company results", - "type": "array", - "items": { - "$ref": "#/components/schemas/Company" - }, - "maxItems": 100 + "type": { + "description": "The type of value", + "type": "string", + "const": "location" }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "data": { + "oneOf": [ + { + "$ref": "#/components/schemas/Location" + }, + { + "type": "null" + } + ] } }, "required": [ "data", - "pagination" + "type" ], - "additionalProperties": false, - "examples": [ - { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - }, - "data": [ - { - "domain": "acme.co", - "name": "Acme", - "isGlobal": true, - "domains": [ - "acme.co" - ], - "id": 1, - "fields": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - }, - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - } - ] - }, - { - "domain": "acme.co", - "name": "Acme", - "isGlobal": true, - "domains": [ - "acme.co" - ], - "id": 1, - "fields": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - }, - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - } - ] - } - ] - } - ] + "additionalProperties": false }, - "AuthorizationErrors": { - "title": "AuthorizationErrors", - "description": "AuthorizationErrors model", + "LocationsValue": { + "title": "LocationsValue", "type": "object", "properties": { - "errors": { - "description": "AuthorizationError errors", - "type": "array", + "type": { + "description": "The type of value", + "type": "string", + "const": "location-multi" + }, + "data": { + "description": "The values for many locations", + "type": [ + "array", + "null" + ], "items": { - "$ref": "#/components/schemas/AuthorizationError" + "$ref": "#/components/schemas/Location" } } }, "required": [ - "errors" + "data", + "type" ], - "additionalProperties": false, - "examples": [ - { - "errors": [ + "additionalProperties": false + }, + "PersonValue": { + "title": "PersonValue", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "person" + }, + "data": { + "oneOf": [ { - "code": "authorization", - "message": "🚨 Error! Sound the alarm! 🚨" + "$ref": "#/components/schemas/PersonData" }, { - "code": "authorization", - "message": "🚨 Error! Sound the alarm! 🚨" + "type": "null" } ] } - ] + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false }, - "FieldMetadata": { - "title": "FieldMetadata", + "PersonsValue": { + "title": "PersonsValue", "type": "object", "properties": { - "id": { - "description": "The field's unique identifier", + "type": { + "description": "The type of value", "type": "string", + "const": "person-multi" + }, + "data": { + "description": "The values for many persons", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/PersonData" + }, + "maxItems": 100 + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "RankedDropdown": { + "title": "RankedDropdown", + "type": "object", + "properties": { + "dropdownOptionId": { + "description": "Dropdown item's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, "examples": [ - "affinity-data-location" + 1 ] }, - "name": { - "description": "The field's name", + "text": { + "description": "Dropdown item text", "type": "string", "examples": [ - "Location" + "first" ] }, - "type": { - "description": "The field's type", - "type": "string", - "enum": [ - "enriched", - "global", - "list", - "relationship-intelligence" - ], + "rank": { + "description": "Dropdown item rank", + "type": "integer", + "format": "int64", + "minimum": 0, + "maximum": 9007199254740991, "examples": [ - "enriched" + 0 ] }, - "enrichmentSource": { - "description": "The source of the data in this Field (if it is enriched)", + "color": { + "description": "Dropdown item color", "type": [ "string", "null" ], - "enum": [ - "affinity-data", - "dealroom", - null - ], - "examples": [ - "affinity-data" - ] - }, - "valueType": { - "description": "The type of the data in this Field", - "type": "string", - "enum": [ - "person", - "person-multi", - "company", - "company-multi", - "filterable-text", - "filterable-text-multi", - "number", - "number-multi", - "datetime", - "location", - "location-multi", - "text", - "ranked-dropdown", - "dropdown", - "dropdown-multi", - "formula-number", - "interaction" - ], "examples": [ - "location" + "white" ] } }, "required": [ - "enrichmentSource", - "id", - "name", - "type", - "valueType" + "color", + "dropdownOptionId", + "rank", + "text" ], - "additionalProperties": false, - "examples": [ - { - "enrichmentSource": "affinity-data", - "valueType": "location", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched" - } - ] + "additionalProperties": false }, - "FieldMetadataPaged": { - "title": "FieldMetadataPaged", - "description": "FieldMetadataPaged model", + "RankedDropdownValue": { + "title": "RankedDropdownValue", "type": "object", "properties": { - "data": { - "description": "A page of FieldMetadata results", - "type": "array", - "items": { - "$ref": "#/components/schemas/FieldMetadata" - }, - "maxItems": 100 + "type": { + "description": "The type of value", + "type": "string", + "const": "ranked-dropdown" }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "data": { + "oneOf": [ + { + "$ref": "#/components/schemas/RankedDropdown" + }, + { + "type": "null" + } + ] } }, "required": [ "data", - "pagination" + "type" ], - "additionalProperties": false, + "additionalProperties": false + }, + "FieldValue": { + "title": "FieldValue", + "oneOf": [ + { + "$ref": "#/components/schemas/CompaniesValue" + }, + { + "$ref": "#/components/schemas/CompanyValue" + }, + { + "$ref": "#/components/schemas/DateValue" + }, + { + "$ref": "#/components/schemas/DropdownsValue" + }, + { + "$ref": "#/components/schemas/DropdownValue" + }, + { + "$ref": "#/components/schemas/FloatsValue" + }, + { + "$ref": "#/components/schemas/FloatValue" + }, + { + "$ref": "#/components/schemas/FormulaValue" + }, + { + "$ref": "#/components/schemas/InteractionValue" + }, + { + "$ref": "#/components/schemas/LocationsValue" + }, + { + "$ref": "#/components/schemas/LocationValue" + }, + { + "$ref": "#/components/schemas/PersonsValue" + }, + { + "$ref": "#/components/schemas/PersonValue" + }, + { + "$ref": "#/components/schemas/RankedDropdownValue" + }, + { + "$ref": "#/components/schemas/TextsValue" + }, + { + "$ref": "#/components/schemas/TextValue" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "company": "#/components/schemas/CompanyValue", + "company-multi": "#/components/schemas/CompaniesValue", + "datetime": "#/components/schemas/DateValue", + "dropdown": "#/components/schemas/DropdownValue", + "dropdown-multi": "#/components/schemas/DropdownsValue", + "number": "#/components/schemas/FloatValue", + "number-multi": "#/components/schemas/FloatsValue", + "filterable-text": "#/components/schemas/TextValue", + "filterable-text-multi": "#/components/schemas/TextsValue", + "formula-number": "#/components/schemas/FormulaValue", + "interaction": "#/components/schemas/InteractionValue", + "location": "#/components/schemas/LocationValue", + "location-multi": "#/components/schemas/LocationsValue", + "person": "#/components/schemas/PersonValue", + "person-multi": "#/components/schemas/PersonsValue", + "ranked-dropdown": "#/components/schemas/RankedDropdownValue", + "text": "#/components/schemas/TextValue" + } + }, "examples": [ { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" }, - "data": [ - { - "enrichmentSource": "affinity-data", - "valueType": "location", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched" - }, - { - "enrichmentSource": "affinity-data", - "valueType": "location", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched" - } - ] + "type": "location" } ] }, - "List": { - "title": "List", + "Field": { + "title": "Field", "type": "object", "properties": { "id": { - "description": "The unique identifier for the list", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, + "description": "The field's unique identifier", + "type": "string", "examples": [ - 1 + "affinity-data-location" ] }, "name": { - "description": "The name of the list", + "description": "The field's name", "type": "string", "examples": [ - "All companies" + "Location" ] }, - "creatorId": { - "description": "The ID of the user that created this list", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, + "type": { + "description": "The field's type", + "type": "string", + "enum": [ + "enriched", + "global", + "list", + "relationship-intelligence" + ], "examples": [ - 1 + "enriched" ] }, - "ownerId": { - "description": "The ID of the user that owns this list", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, + "enrichmentSource": { + "description": "The source of the data in this Field (if it is enriched)", + "type": [ + "string", + "null" + ], + "enum": [ + "affinity-data", + "dealroom", + null + ], "examples": [ - 1 + "affinity-data" ] }, - "isPublic": { - "description": "Whether or not the list is public", - "type": "boolean", - "examples": [ - false - ] + "value": { + "$ref": "#/components/schemas/FieldValue" } }, "required": [ - "creatorId", + "enrichmentSource", "id", - "isPublic", "name", - "ownerId" + "type", + "value" ], "additionalProperties": false, "examples": [ { - "name": "All companies", - "creatorId": 1, - "isPublic": false, - "id": 1, - "ownerId": 1 + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } } ] }, - "ListPaged": { - "title": "ListPaged", - "description": "ListPaged model", + "Company": { + "title": "Company", + "description": "Company model", "type": "object", "properties": { - "data": { - "description": "A page of List results", + "id": { + "description": "The company's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "name": { + "description": "The company's name", + "type": "string", + "examples": [ + "Acme" + ] + }, + "domain": { + "description": "The company's primary domain", + "type": [ + "string", + "null" + ], + "format": "hostname", + "examples": [ + "acme.co" + ] + }, + "domains": { + "description": "All of the company's domains", "type": "array", "items": { - "$ref": "#/components/schemas/List" + "type": "string", + "format": "hostname" }, - "maxItems": 100 - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" - } - }, - "required": [ - "data", - "pagination" - ], - "additionalProperties": false, - "examples": [ - { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - }, - "data": [ - { - "name": "All companies", - "creatorId": 1, - "isPublic": false, - "id": 1, - "ownerId": 1 - }, - { - "name": "All companies", - "creatorId": 1, - "isPublic": false, - "id": 1, - "ownerId": 1 - } - ] - } - ] - }, - "ListEntry": { - "title": "ListEntry", - "type": "object", - "properties": { - "id": { - "description": "The list entry's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "listId": { - "description": "The ID of the list that this list entry belongs to", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "createdAt": { - "description": "The date that the list entry was created", - "type": "string", - "format": "date-time", "examples": [ - "2023-01-01T00:00:00Z" + [ + "acme.co" + ] ] }, - "creatorId": { - "description": "The ID of the user that created this list entry", - "type": [ - "integer", - "null" - ], - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, + "isGlobal": { + "description": "Whether or not the company is tenant specific", + "type": "boolean", "examples": [ - 1 + true ] }, "fields": { - "description": "The fields associated with the list entry", + "description": "The fields associated with the company", "type": "array", "items": { "$ref": "#/components/schemas/Field" @@ -4295,18 +5242,21 @@ } }, "required": [ - "createdAt", - "creatorId", - "fields", + "domain", + "domains", "id", - "listId" + "isGlobal", + "name" ], "additionalProperties": false, "examples": [ { - "listId": 1, - "createdAt": "2023-01-01T00:00:00Z", - "creatorId": 1, + "domain": "acme.co", + "name": "Acme", + "isGlobal": true, + "domains": [ + "acme.co" + ], "id": 1, "fields": [ { @@ -4318,7 +5268,7 @@ "data": { "continent": "North America", "country": "United States", - "streetAddress": "170 Columbus Ave", + "streetAddress": "1 Main Street", "city": "San Francisco", "state": "California" }, @@ -4334,7 +5284,7 @@ "data": { "continent": "North America", "country": "United States", - "streetAddress": "170 Columbus Ave", + "streetAddress": "1 Main Street", "city": "San Francisco", "state": "California" }, @@ -4345,16 +5295,16 @@ } ] }, - "ListEntryPaged": { - "title": "ListEntryPaged", - "description": "ListEntryPaged model", + "CompanyPaged": { + "title": "CompanyPaged", + "description": "CompanyPaged model", "type": "object", "properties": { "data": { - "description": "A page of ListEntry results", + "description": "A page of Company results", "type": "array", "items": { - "$ref": "#/components/schemas/ListEntry" + "$ref": "#/components/schemas/Company" }, "maxItems": 100 }, @@ -4375,9 +5325,12 @@ }, "data": [ { - "listId": 1, - "createdAt": "2023-01-01T00:00:00Z", - "creatorId": 1, + "domain": "acme.co", + "name": "Acme", + "isGlobal": true, + "domains": [ + "acme.co" + ], "id": 1, "fields": [ { @@ -4389,7 +5342,7 @@ "data": { "continent": "North America", "country": "United States", - "streetAddress": "170 Columbus Ave", + "streetAddress": "1 Main Street", "city": "San Francisco", "state": "California" }, @@ -4405,7 +5358,7 @@ "data": { "continent": "North America", "country": "United States", - "streetAddress": "170 Columbus Ave", + "streetAddress": "1 Main Street", "city": "San Francisco", "state": "California" }, @@ -4415,9 +5368,12 @@ ] }, { - "listId": 1, - "createdAt": "2023-01-01T00:00:00Z", - "creatorId": 1, + "domain": "acme.co", + "name": "Acme", + "isGlobal": true, + "domains": [ + "acme.co" + ], "id": 1, "fields": [ { @@ -4429,7 +5385,7 @@ "data": { "continent": "North America", "country": "United States", - "streetAddress": "170 Columbus Ave", + "streetAddress": "1 Main Street", "city": "San Francisco", "state": "California" }, @@ -4445,7 +5401,7 @@ "data": { "continent": "North America", "country": "United States", - "streetAddress": "170 Columbus Ave", + "streetAddress": "1 Main Street", "city": "San Francisco", "state": "California" }, @@ -4458,98 +5414,139 @@ } ] }, - "ListWithType": { - "title": "ListWithType", - "description": "ListWithType model", + "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! 🚨" + } + ] + } + ] + }, + "FieldMetadata": { + "title": "FieldMetadata", "type": "object", "properties": { "id": { - "description": "The unique identifier for the list", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, + "description": "The field's unique identifier", + "type": "string", "examples": [ - 1 + "affinity-data-location" ] }, "name": { - "description": "The name of the list", + "description": "The field's name", "type": "string", "examples": [ - "All companies" - ] - }, - "creatorId": { - "description": "The ID of the user that created this list", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 + "Location" ] }, - "ownerId": { - "description": "The ID of the user that owns this list", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, + "type": { + "description": "The field's type", + "type": "string", + "enum": [ + "enriched", + "global", + "list", + "relationship-intelligence" + ], "examples": [ - 1 + "enriched" ] }, - "isPublic": { - "description": "Whether or not the list is public", - "type": "boolean", + "enrichmentSource": { + "description": "The source of the data in this Field (if it is enriched)", + "type": [ + "string", + "null" + ], + "enum": [ + "affinity-data", + "dealroom", + null + ], "examples": [ - false + "affinity-data" ] }, - "type": { - "description": "The entity type for this list", + "valueType": { + "description": "The type of the data in this Field", "type": "string", "enum": [ + "person", + "person-multi", "company", - "opportunity", - "person" + "company-multi", + "filterable-text", + "filterable-text-multi", + "number", + "number-multi", + "datetime", + "location", + "location-multi", + "text", + "ranked-dropdown", + "dropdown", + "dropdown-multi", + "formula-number", + "interaction" ], "examples": [ - "company" + "location" ] } }, "required": [ - "creatorId", + "enrichmentSource", "id", - "isPublic", "name", - "ownerId", - "type" + "type", + "valueType" ], "additionalProperties": false, "examples": [ { - "name": "All companies", - "creatorId": 1, - "isPublic": false, - "id": 1, - "ownerId": 1, - "type": "company" - } + "enrichmentSource": "affinity-data", + "valueType": "location", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched" + } ] }, - "ListWithTypePaged": { - "title": "ListWithTypePaged", - "description": "ListWithTypePaged model", + "FieldMetadataPaged": { + "title": "FieldMetadataPaged", + "description": "FieldMetadataPaged model", "type": "object", "properties": { "data": { - "description": "A page of ListWithType results", + "description": "A page of FieldMetadata results", "type": "array", "items": { - "$ref": "#/components/schemas/ListWithType" + "$ref": "#/components/schemas/FieldMetadata" }, "maxItems": 100 }, @@ -4561,40 +5558,14 @@ "data", "pagination" ], - "additionalProperties": false, - "examples": [ - { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - }, - "data": [ - { - "name": "All companies", - "creatorId": 1, - "isPublic": false, - "id": 1, - "ownerId": 1, - "type": "company" - }, - { - "name": "All companies", - "creatorId": 1, - "isPublic": false, - "id": 1, - "ownerId": 1, - "type": "company" - } - ] - } - ] + "additionalProperties": false }, - "CompanyListEntry": { - "title": "CompanyListEntry", + "List": { + "title": "List", "type": "object", "properties": { "id": { - "description": "The list entry's unique identifier", + "description": "The unique identifier for the list", "type": "integer", "format": "int64", "minimum": 1, @@ -4603,16 +5574,15 @@ 1 ] }, - "type": { - "description": "The entity type for this list entry", + "name": { + "description": "The name of the list", "type": "string", - "const": "company", "examples": [ - "company" + "All companies" ] }, - "listId": { - "description": "The ID of the list that this list entry belongs to", + "creatorId": { + "description": "The ID of the user that created this list", "type": "integer", "format": "int64", "minimum": 1, @@ -4621,20 +5591,9 @@ 1 ] }, - "createdAt": { - "description": "The date that the list entry was created", - "type": "string", - "format": "date-time", - "examples": [ - "2023-01-01T00:00:00Z" - ] - }, - "creatorId": { - "description": "The ID of the user that created this list entry", - "type": [ - "integer", - "null" - ], + "ownerId": { + "description": "The ID of the user that owns this list", + "type": "integer", "format": "int64", "minimum": 1, "maximum": 9007199254740991, @@ -4642,68 +5601,81 @@ 1 ] }, - "entity": { - "$ref": "#/components/schemas/Company" + "isPublic": { + "description": "Whether or not the list is public", + "type": "boolean", + "examples": [ + false + ] } }, "required": [ - "createdAt", "creatorId", - "entity", "id", - "listId", - "type" + "isPublic", + "name", + "ownerId" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "name": "All companies", + "creatorId": 1, + "isPublic": false, + "id": 1, + "ownerId": 1 + } + ] }, - "OpportunityWithFields": { - "title": "OpportunityWithFields", + "ListPaged": { + "title": "ListPaged", + "description": "ListPaged model", "type": "object", "properties": { - "id": { - "description": "The unique identifier for the opportunity", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "name": { - "description": "The name of the opportunity", - "type": "string", - "examples": [ - "Acme Upsell $10k" - ] - }, - "listId": { - "description": "The ID of the list that the opportunity belongs to", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "fields": { - "description": "The fields associated with the opportunity", + "data": { + "description": "A page of List results", "type": "array", "items": { - "$ref": "#/components/schemas/Field" - } + "$ref": "#/components/schemas/List" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" } }, "required": [ - "id", - "listId", - "name" + "data", + "pagination" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "pagination": { + "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + }, + "data": [ + { + "name": "All companies", + "creatorId": 1, + "isPublic": false, + "id": 1, + "ownerId": 1 + }, + { + "name": "All companies", + "creatorId": 1, + "isPublic": false, + "id": 1, + "ownerId": 1 + } + ] + } + ] }, - "OpportunityListEntry": { - "title": "OpportunityListEntry", + "ListEntry": { + "title": "ListEntry", "type": "object", "properties": { "id": { @@ -4716,14 +5688,6 @@ 1 ] }, - "type": { - "description": "The entity type for this list entry", - "type": "string", - "const": "opportunity", - "examples": [ - "opportunity" - ] - }, "listId": { "description": "The ID of the list that this list entry belongs to", "type": "integer", @@ -4755,159 +5719,185 @@ 1 ] }, - "entity": { - "$ref": "#/components/schemas/OpportunityWithFields" + "fields": { + "description": "The fields associated with the list entry", + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + } } }, "required": [ "createdAt", "creatorId", - "entity", + "fields", "id", - "listId", - "type" + "listId" ], - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "listId": 1, + "createdAt": "2023-01-01T00:00:00Z", + "creatorId": 1, + "id": 1, + "fields": [ + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + }, + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + } + ] + } + ] }, - "Person": { - "title": "Person", - "description": "Person model", + "ListEntryPaged": { + "title": "ListEntryPaged", + "description": "ListEntryPaged model", "type": "object", "properties": { - "id": { - "description": "The persons's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "firstName": { - "description": "The person's first name", - "type": "string", - "examples": [ - "Jane" - ] - }, - "lastName": { - "description": "The person's last name", - "type": [ - "string", - "null" - ], - "examples": [ - "Doe" - ] - }, - "primaryEmailAddress": { - "description": "The person's primary email address", - "type": [ - "string", - "null" - ], - "format": "email", - "examples": [ - "jane.doe@acme.co" - ] - }, - "emailAddresses": { - "description": "All of the person's email addresses", + "data": { + "description": "A page of ListEntry results", "type": "array", "items": { - "type": "string", - "format": "email" + "$ref": "#/components/schemas/ListEntry" }, - "examples": [ - [ - "jane.doe@acme.co", - "janedoe@gmail.com" - ] - ] - }, - "type": { - "description": "The person's type", - "type": "string", - "enum": [ - "internal", - "external" - ], - "examples": [ - "internal" - ] + "maxItems": 100 }, - "fields": { - "description": "The fields associated with the person", - "type": "array", - "items": { - "$ref": "#/components/schemas/Field" - } + "pagination": { + "$ref": "#/components/schemas/Pagination" } }, "required": [ - "emailAddresses", - "firstName", - "id", - "lastName", - "primaryEmailAddress", - "type" + "data", + "pagination" ], "additionalProperties": false, "examples": [ { - "firstName": "Jane", - "lastName": "Doe", - "emailAddresses": [ - "jane.doe@acme.co", - "janedoe@gmail.com" - ], - "id": 1, - "type": "internal", - "fields": [ + "pagination": { + "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + }, + "data": [ { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" + "listId": 1, + "createdAt": "2023-01-01T00:00:00Z", + "creatorId": 1, + "id": 1, + "fields": [ + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } }, - "type": "location" - } + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + } + ] }, { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" + "listId": 1, + "createdAt": "2023-01-01T00:00:00Z", + "creatorId": 1, + "id": 1, + "fields": [ + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } }, - "type": "location" - } + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + } + ] } - ], - "primaryEmailAddress": "jane.doe@acme.co" + ] } ] }, - "PersonListEntry": { - "title": "PersonListEntry", + "interactions.Email": { + "x-stability-level": "beta", + "title": "interactions.Email", "type": "object", "properties": { "id": { - "description": "The list entry's unique identifier", + "description": "The email's unique identifier", "type": "integer", "format": "int64", "minimum": 1, @@ -4916,16 +5906,99 @@ 1 ] }, - "type": { - "description": "The entity type for this list entry", + "sentAt": { + "description": "The timestamp of when the email was sent", "type": "string", - "const": "person", + "format": "date-time", "examples": [ - "person" + "2023-01-01T00:00:00Z" ] }, - "listId": { - "description": "The ID of the list that this list entry belongs to", + "loggingType": { + "description": "Indicates how the interaction was added to Affinity: either manually by a user ('manual') or automatically through Affinity's capture process ('automated'). Currently, emails can only be logged as 'automated'.", + "type": "string", + "const": "automated", + "examples": [ + "automated" + ] + }, + "direction": { + "description": "The direction of the email: 'sent' if the email was sent by an internal user and 'received' if the email was sent to an internal user.", + "type": "string", + "enum": [ + "sent", + "received" + ], + "examples": [ + "received" + ] + }, + "subject": { + "description": "The email's subject", + "type": [ + "string", + "null" + ], + "examples": [ + "Example subject" + ] + }, + "from": { + "description": "The participant who sent the email", + "$ref": "#/components/schemas/Participant" + }, + "toParticipantsPreview": { + "description": "A preview of the participants in the 'To' field of the email", + "$ref": "#/components/schemas/ParticipantsPreview" + }, + "ccParticipantsPreview": { + "description": "A preview of the participants who are cc'ed in the email", + "$ref": "#/components/schemas/ParticipantsPreview" + } + }, + "required": [ + "id", + "sentAt", + "loggingType", + "direction", + "subject", + "from", + "toParticipantsPreview", + "ccParticipantsPreview" + ], + "additionalProperties": false + }, + "interactions.EmailPaged": { + "x-stability-level": "beta", + "title": "interactions.EmailPaged", + "description": "EmailPaged model", + "type": "object", + "properties": { + "data": { + "description": "A page of Email results", + "type": "array", + "items": { + "$ref": "#/components/schemas/interactions.Email" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/PaginationWithTotalCount" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + }, + "ListWithType": { + "title": "ListWithType", + "description": "ListWithType model", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier for the list", "type": "integer", "format": "int64", "minimum": 1, @@ -4934,710 +6007,5169 @@ 1 ] }, - "createdAt": { - "description": "The date that the list entry was created", + "name": { + "description": "The name of the list", + "type": "string", + "examples": [ + "All companies" + ] + }, + "creatorId": { + "description": "The ID of the user that created this list", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "ownerId": { + "description": "The ID of the user that owns this list", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "isPublic": { + "description": "Whether or not the list is public", + "type": "boolean", + "examples": [ + false + ] + }, + "type": { + "description": "The entity type for this list", + "type": "string", + "enum": [ + "company", + "opportunity", + "person" + ], + "examples": [ + "company" + ] + } + }, + "required": [ + "creatorId", + "id", + "isPublic", + "name", + "ownerId", + "type" + ], + "additionalProperties": false + }, + "ListWithTypePaged": { + "title": "ListWithTypePaged", + "description": "ListWithTypePaged model", + "type": "object", + "properties": { + "data": { + "description": "A page of ListWithType results", + "type": "array", + "items": { + "$ref": "#/components/schemas/ListWithType" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + }, + "CompanyListEntry": { + "title": "CompanyListEntry", + "type": "object", + "properties": { + "id": { + "description": "The list entry's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "type": { + "description": "The entity type for this list entry", + "type": "string", + "const": "company", + "examples": [ + "company" + ] + }, + "listId": { + "description": "The ID of the list that this list entry belongs to", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "createdAt": { + "description": "The date that the list entry was created", + "type": "string", + "format": "date-time", + "examples": [ + "2023-01-01T00:00:00Z" + ] + }, + "creatorId": { + "description": "The ID of the user that created this list entry", + "type": [ + "integer", + "null" + ], + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "entity": { + "$ref": "#/components/schemas/Company" + } + }, + "required": [ + "createdAt", + "creatorId", + "entity", + "id", + "listId", + "type" + ], + "additionalProperties": false + }, + "OpportunityWithFields": { + "title": "OpportunityWithFields", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier for the opportunity", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "name": { + "description": "The name of the opportunity", + "type": "string", + "examples": [ + "Acme Upsell $10k" + ] + }, + "listId": { + "description": "The ID of the list that the opportunity belongs to", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "fields": { + "description": "The fields associated with the opportunity", + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + } + } + }, + "required": [ + "id", + "listId", + "name" + ], + "additionalProperties": false + }, + "OpportunityListEntry": { + "title": "OpportunityListEntry", + "type": "object", + "properties": { + "id": { + "description": "The list entry's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "type": { + "description": "The entity type for this list entry", + "type": "string", + "const": "opportunity", + "examples": [ + "opportunity" + ] + }, + "listId": { + "description": "The ID of the list that this list entry belongs to", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "createdAt": { + "description": "The date that the list entry was created", "type": "string", "format": "date-time", "examples": [ "2023-01-01T00:00:00Z" ] - }, - "creatorId": { - "description": "The ID of the user that created this list entry", - "type": [ - "integer", - "null" - ], - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 + }, + "creatorId": { + "description": "The ID of the user that created this list entry", + "type": [ + "integer", + "null" + ], + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "entity": { + "$ref": "#/components/schemas/OpportunityWithFields" + } + }, + "required": [ + "createdAt", + "creatorId", + "entity", + "id", + "listId", + "type" + ], + "additionalProperties": false + }, + "Person": { + "title": "Person", + "description": "Person model", + "type": "object", + "properties": { + "id": { + "description": "The persons's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "firstName": { + "description": "The person's first name", + "type": "string", + "examples": [ + "Jane" + ] + }, + "lastName": { + "description": "The person's last name", + "type": [ + "string", + "null" + ], + "examples": [ + "Doe" + ] + }, + "primaryEmailAddress": { + "description": "The person's primary email address", + "type": [ + "string", + "null" + ], + "format": "email", + "examples": [ + "jane.doe@acme.co" + ] + }, + "emailAddresses": { + "description": "All of the person's email addresses", + "type": "array", + "items": { + "type": "string", + "format": "email" + }, + "examples": [ + [ + "jane.doe@acme.co", + "janedoe@gmail.com" + ] + ] + }, + "type": { + "description": "The person's type", + "type": "string", + "enum": [ + "internal", + "external" + ], + "examples": [ + "internal" + ] + }, + "fields": { + "description": "The fields associated with the person", + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + } + } + }, + "required": [ + "emailAddresses", + "firstName", + "id", + "lastName", + "primaryEmailAddress", + "type" + ], + "additionalProperties": false, + "examples": [ + { + "firstName": "Jane", + "lastName": "Doe", + "emailAddresses": [ + "jane.doe@acme.co", + "janedoe@gmail.com" + ], + "id": 1, + "type": "internal", + "fields": [ + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + }, + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + } + ], + "primaryEmailAddress": "jane.doe@acme.co" + } + ] + }, + "PersonListEntry": { + "title": "PersonListEntry", + "type": "object", + "properties": { + "id": { + "description": "The list entry's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "type": { + "description": "The entity type for this list entry", + "type": "string", + "const": "person", + "examples": [ + "person" + ] + }, + "listId": { + "description": "The ID of the list that this list entry belongs to", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "createdAt": { + "description": "The date that the list entry was created", + "type": "string", + "format": "date-time", + "examples": [ + "2023-01-01T00:00:00Z" + ] + }, + "creatorId": { + "description": "The ID of the user that created this list entry", + "type": [ + "integer", + "null" + ], + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "entity": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "createdAt", + "creatorId", + "entity", + "id", + "listId", + "type" + ], + "additionalProperties": false + }, + "ListEntryWithEntity": { + "title": "ListEntryWithEntity", + "oneOf": [ + { + "$ref": "#/components/schemas/CompanyListEntry" + }, + { + "$ref": "#/components/schemas/OpportunityListEntry" + }, + { + "$ref": "#/components/schemas/PersonListEntry" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "company": "#/components/schemas/CompanyListEntry", + "opportunity": "#/components/schemas/OpportunityListEntry", + "person": "#/components/schemas/PersonListEntry" + } + } + }, + "ListEntryWithEntityPaged": { + "title": "ListEntryWithEntityPaged", + "description": "ListEntryWithEntityPaged model", + "type": "object", + "properties": { + "data": { + "description": "A page of ListEntryWithEntity results", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/ListEntryWithEntity" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + }, + "FieldPaged": { + "title": "FieldPaged", + "description": "FieldPaged model", + "type": "object", + "properties": { + "data": { + "description": "A page of Field results", + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ] + }, + "CompanyReference": { + "title": "CompanyReference", + "type": "object", + "properties": { + "id": { + "description": "The company's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991 + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "CompaniesValueUpdate": { + "title": "CompaniesValueUpdate", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "company-multi" + }, + "data": { + "description": "The values for many companies", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/CompanyReference" + }, + "maxItems": 100 + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "CompanyValueUpdate": { + "title": "CompanyValueUpdate", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "company" + }, + "data": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/CompanyReference" + } + ] + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "DropdownReference": { + "title": "DropdownReference", + "type": "object", + "properties": { + "dropdownOptionId": { + "description": "Dropdown item's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + } + }, + "required": [ + "dropdownOptionId" + ], + "additionalProperties": false + }, + "DropdownValueUpdate": { + "title": "DropdownValueUpdate", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "dropdown" + }, + "data": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/DropdownReference" + } + ] + } + }, + "required": [ + "data", + "type" + ] + }, + "DropdownsValueUpdate": { + "title": "DropdownsValueUpdate", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "dropdown-multi" + }, + "data": { + "description": "The value for many dropdown items", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/DropdownReference" + } + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "PersonReference": { + "title": "PersonReference", + "type": "object", + "properties": { + "id": { + "description": "The persons's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "PersonValueUpdate": { + "title": "PersonValueUpdate", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "person" + }, + "data": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/PersonReference" + } + ] + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "PersonsValueUpdate": { + "title": "PersonsValueUpdate", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "person-multi" + }, + "data": { + "description": "The values for many persons", + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/PersonReference" + }, + "maxItems": 100 + } + }, + "required": [ + "data", + "type" + ], + "additionalProperties": false + }, + "RankedDropdownReference": { + "title": "RankedDropdownReference", + "type": "object", + "properties": { + "dropdownOptionId": { + "description": "Ranked Dropdown item's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + } + }, + "required": [ + "dropdownOptionId" + ], + "additionalProperties": false + }, + "RankedDropdownValueUpdate": { + "title": "RankedDropdownValueUpdate", + "type": "object", + "properties": { + "type": { + "description": "The type of value", + "type": "string", + "const": "ranked-dropdown" + }, + "data": { + "oneOf": [ + { + "type": "null" + }, + { + "$ref": "#/components/schemas/RankedDropdownReference" + } + ] + } + }, + "required": [ + "data", + "type" + ] + }, + "FieldValueUpdate": { + "title": "FieldValueUpdate", + "oneOf": [ + { + "$ref": "#/components/schemas/CompaniesValueUpdate" + }, + { + "$ref": "#/components/schemas/CompanyValueUpdate" + }, + { + "$ref": "#/components/schemas/DateValue" + }, + { + "$ref": "#/components/schemas/DropdownValueUpdate" + }, + { + "$ref": "#/components/schemas/DropdownsValueUpdate" + }, + { + "$ref": "#/components/schemas/FloatValue" + }, + { + "$ref": "#/components/schemas/FloatsValue" + }, + { + "$ref": "#/components/schemas/LocationValue" + }, + { + "$ref": "#/components/schemas/LocationsValue" + }, + { + "$ref": "#/components/schemas/PersonValueUpdate" + }, + { + "$ref": "#/components/schemas/PersonsValueUpdate" + }, + { + "$ref": "#/components/schemas/RankedDropdownValueUpdate" + }, + { + "$ref": "#/components/schemas/TextValue" + }, + { + "$ref": "#/components/schemas/TextsValue" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "company-multi": "#/components/schemas/CompaniesValueUpdate", + "company": "#/components/schemas/CompanyValueUpdate", + "datetime": "#/components/schemas/DateValue", + "dropdown": "#/components/schemas/DropdownValueUpdate", + "dropdown-multi": "#/components/schemas/DropdownsValueUpdate", + "number": "#/components/schemas/FloatValue", + "number-multi": "#/components/schemas/FloatsValue", + "location": "#/components/schemas/LocationValue", + "location-multi": "#/components/schemas/LocationsValue", + "person": "#/components/schemas/PersonValueUpdate", + "person-multi": "#/components/schemas/PersonsValueUpdate", + "ranked-dropdown": "#/components/schemas/RankedDropdownValueUpdate", + "filterable-text": "#/components/schemas/TextValue", + "filterable-text-multi": "#/components/schemas/TextsValue", + "text": "#/components/schemas/TextValue" + } + }, + "examples": [ + { + "type": "location", + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + } + } + ] + }, + "ListEntryBatchOperationUpdateFields": { + "title": "ListEntryBatchOperationUpdateFields", + "description": "Update multiple field values.", + "type": "object", + "properties": { + "operation": { + "type": "string", + "const": "update-fields" + }, + "updates": { + "type": "array", + "maxItems": 100, + "items": { + "type": "object", + "properties": { + "id": { + "description": "The field's unique identifier.", + "type": "string", + "examples": [ + "field-105" + ] + }, + "value": { + "$ref": "#/components/schemas/FieldValueUpdate" + } + }, + "required": [ + "id" + ] + } + } + }, + "required": [ + "operation", + "updates" + ] + }, + "ListEntryBatchOperationRequest": { + "title": "ListEntryBatchOperationRequest", + "oneOf": [ + { + "$ref": "#/components/schemas/ListEntryBatchOperationUpdateFields" + } + ], + "discriminator": { + "propertyName": "operation", + "mapping": { + "update-fields": "#/components/schemas/ListEntryBatchOperationUpdateFields" + } + } + }, + "ListEntryBatchOperations": { + "title": "ListEntryBatchOperations", + "type": "string", + "enum": [ + "update-fields" + ] + }, + "ListEntryBatchOperationResponse": { + "title": "ListEntryBatchOperationResponse", + "type": "object", + "properties": { + "operation": { + "$ref": "#/components/schemas/ListEntryBatchOperations" + } + } + }, + "FieldUpdate": { + "title": "FieldUpdate", + "type": "object", + "properties": { + "value": { + "$ref": "#/components/schemas/FieldValueUpdate" + } + }, + "examples": [ + { + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + } + ], + "additionalProperties": false + }, + "SavedView": { + "title": "SavedView", + "description": "SavedView model", + "type": "object", + "properties": { + "id": { + "description": "The saved view's unique identifier", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 28 + ] + }, + "name": { + "description": "The saved view's name", + "type": "string", + "examples": [ + "my interesting companies" + ] + }, + "type": { + "description": "The type for this saved view", + "type": "string", + "enum": [ + "sheet", + "board", + "dashboard" + ], + "examples": [ + "sheet" + ] + }, + "createdAt": { + "description": "The date that the saved view was created", + "type": "string", + "format": "date-time", + "examples": [ + "2023-01-01T00:00:00Z" + ] + } + }, + "required": [ + "createdAt", + "id", + "name", + "type" + ], + "additionalProperties": false, + "examples": [ + { + "createdAt": "2023-01-01T00:00:00Z", + "name": "my interesting companies", + "id": 28, + "type": "sheet" + } + ] + }, + "SavedViewPaged": { + "title": "SavedViewPaged", + "description": "SavedViewPaged model", + "type": "object", + "properties": { + "data": { + "description": "A page of SavedView results", + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedView" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false, + "examples": [ + { + "pagination": { + "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + }, + "data": [ + { + "createdAt": "2023-01-01T00:00:00Z", + "name": "my interesting companies", + "id": 28, + "type": "sheet" + }, + { + "createdAt": "2023-01-01T00:00:00Z", + "name": "my interesting companies", + "id": 28, + "type": "sheet" + } + ] + } + ] + }, + "Opportunity": { + "title": "Opportunity", + "description": "Opportunity model", + "type": "object", + "properties": { + "id": { + "description": "The unique identifier for the opportunity", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + }, + "name": { + "description": "The name of the opportunity", + "type": "string", + "examples": [ + "Acme Upsell $10k" + ] + }, + "listId": { + "description": "The ID of the list that the opportunity belongs to", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 1 + ] + } + }, + "required": [ + "id", + "listId", + "name" + ], + "additionalProperties": false, + "examples": [ + { + "listId": 1, + "name": "Acme Upsell $10k", + "id": 1 + } + ] + }, + "OpportunityPaged": { + "title": "OpportunityPaged", + "description": "OpportunityPaged model", + "type": "object", + "properties": { + "data": { + "description": "A page of Opportunity results", + "type": "array", + "items": { + "$ref": "#/components/schemas/Opportunity" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false, + "examples": [ + { + "pagination": { + "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + }, + "data": [ + { + "listId": 1, + "name": "Acme Upsell $10k", + "id": 1 + }, + { + "listId": 1, + "name": "Acme Upsell $10k", + "id": 1 + } + ] + } + ] + }, + "PersonPaged": { + "title": "PersonPaged", + "description": "PersonPaged model", + "type": "object", + "properties": { + "data": { + "description": "A page of Person results", + "type": "array", + "items": { + "$ref": "#/components/schemas/Person" + }, + "maxItems": 100 + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false, + "examples": [ + { + "pagination": { + "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" + }, + "data": [ + { + "firstName": "Jane", + "lastName": "Doe", + "emailAddresses": [ + "jane.doe@acme.co", + "janedoe@gmail.com" + ], + "id": 1, + "type": "internal", + "fields": [ + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + }, + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + } + ], + "primaryEmailAddress": "jane.doe@acme.co" + }, + { + "firstName": "Jane", + "lastName": "Doe", + "emailAddresses": [ + "jane.doe@acme.co", + "janedoe@gmail.com" + ], + "id": 1, + "type": "internal", + "fields": [ + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + }, + { + "enrichmentSource": "affinity-data", + "name": "Location", + "id": "affinity-data-location", + "type": "enriched", + "value": { + "data": { + "continent": "North America", + "country": "United States", + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California" + }, + "type": "location" + } + } + ], + "primaryEmailAddress": "jane.doe@acme.co" + } + ] + } + ] + }, + "PersonMergeState": { + "x-stability-level": "beta", + "title": "PersonMergeState", + "description": "Entity representing the state of an individual person 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" + ] + }, + "primaryPersonId": { + "description": "ID of the primary person that other profiles were merged into", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 12345 + ] + }, + "duplicatePersonId": { + "description": "ID of the duplicate person that was merged into the primary person", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 67890 + ] + }, + "completedAt": { + "description": "Timestamp when the merge completed (success or failure)", + "type": [ + "string", + "null" + ], + "format": "date-time", + "examples": [ + "2025-06-03T10:32:15Z", + null + ] + }, + "errorMessage": { + "description": "Error message if the merge failed", + "type": [ + "string", + "null" + ], + "examples": [ + "Primary person not found", + null + ] + } + }, + "required": [ + "id", + "status", + "taskId", + "startedAt", + "primaryPersonId", + "duplicatePersonId", + "completedAt", + "errorMessage" + ], + "additionalProperties": false + }, + "PersonMergeStatePaged": { + "x-stability-level": "beta", + "title": "PersonMergeStatePaged", + "description": "Paginated list of person merge states", + "type": "object", + "properties": { + "data": { + "description": "Array of person merge states", + "type": "array", + "maxItems": 100, + "items": { + "$ref": "#/components/schemas/PersonMergeState" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + }, + "required": [ + "data", + "pagination" + ], + "additionalProperties": false + }, + "PersonMergeRequest": { + "x-stability-level": "beta", + "title": "PersonMergeRequest", + "description": "Request body for initiating a person merge", + "type": "object", + "properties": { + "primaryPersonId": { + "description": "The ID of the person profile that will be kept after the merge. All data from the duplicate person will be merged into this person.", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 12345 + ] + }, + "duplicatePersonId": { + "description": "The ID of the person profile that will be merged and then deleted. All data from this person will be transferred to the primary person.", + "type": "integer", + "format": "int64", + "minimum": 1, + "maximum": 9007199254740991, + "examples": [ + 67890 + ] + } + }, + "required": [ + "primaryPersonId", + "duplicatePersonId" + ], + "additionalProperties": false + }, + "PersonMergeResponse": { + "x-stability-level": "beta", + "title": "PersonMergeResponse", + "description": "Response body for initiating a person 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/person-merges/123e4567-e89b-12d3-a456-426614174000" + ] + } + }, + "required": [ + "taskUrl" + ], + "additionalProperties": false + }, + "PersonMergeTask": { + "x-stability-level": "beta", + "title": "PersonMergeTask", + "description": "Person 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 + }, + "PersonMergeTaskPaged": { + "x-stability-level": "beta", + "title": "PersonMergeTaskPaged", + "description": "Paginated list of person merge tasks", + "type": "object", + "properties": { + "data": { + "description": "Array of person merge tasks", + "type": "array", + "maxItems": 100, + "items": { + "$ref": "#/components/schemas/PersonMergeTask" + }, + "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 + } + }, + "responses": { + "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" + } + } + }, + "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" + } + } + }, + "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" + } + } + }, + "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" + } + } + } + }, + "examples": { + "success": { + "value": { + "data": [ + { + "id": 1, + "name": "My Companies", + "type": "company", + "isPublic": false, + "ownerId": 1, + "creatorId": 1 + }, + { + "id": 2, + "name": "My Persons", + "type": "person", + "isPublic": false, + "ownerId": 1, + "creatorId": 1 + }, + { + "id": 3, + "name": "My Opportunities", + "type": "opportunity", + "isPublic": false, + "ownerId": 1, + "creatorId": 1 + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists?cursor=ICAgICAgIGFmdGVyOjo6NA" + } + } + }, + "company-list": { + "description": "Example Company list.", + "value": { + "id": 1, + "name": "My Companies", + "type": "company", + "isPublic": false, + "ownerId": 1, + "creatorId": 1 + } + }, + "opportunity-list": { + "description": "Example Opportunity list.", + "value": { + "id": 3, + "name": "My Opportunities", + "type": "opportunity", + "isPublic": false, + "ownerId": 1, + "creatorId": 1 + } + }, + "person-list": { + "description": "Example Person list.", + "value": { + "id": 2, + "name": "My Persons", + "type": "person", + "isPublic": false, + "ownerId": 1, + "creatorId": 1 + } + }, + "company-list-enriched": { + "description": "Example response on a Company list using `fieldTypes=enriched`.", + "value": { + "data": [ + { + "id": 1, + "type": "company", + "listId": 1, + "entity": { + "id": 1, + "name": "Acme", + "domain": "acme.co", + "domains": [ + "acme.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "affinity-data-description", + "name": "Description", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "Acme is a mega-corporation that manufactures everything from anvils to earthquake pills." + } + }, + { + "id": "affinity-data-industry", + "name": "Industry", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Aerospace", + "Construction", + "Consumer Goods" + ] + } + }, + { + "id": "affinity-data-investment-stage", + "name": "Investment Stage", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text", + "data": "Public Markets" + } + }, + { + "id": "affinity-data-investors", + "name": "Investors", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Marvin Acme", + "Yosemite Sam" + ] + } + }, + { + "id": "affinity-data-last-funding-amount", + "name": "Last Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 100000000 + } + }, + { + "id": "affinity-data-last-funding-date", + "name": "Last Funding Date", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "datetime", + "data": "2023-01-01T00:00:00Z" + } + }, + { + "id": "affinity-data-linkedin-url", + "name": "LinkedIn URL", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "https://linkedin.com/company/acme" + } + }, + { + "id": "affinity-data-location", + "name": "Location", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "location", + "data": { + "streetAddress": null, + "city": "Fairfield", + "state": "New Jersey", + "country": "United States", + "continent": null + } + } + }, + { + "id": "affinity-data-number-of-employees", + "name": "Number of Employees", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 3990 + } + }, + { + "id": "affinity-data-total-funding-amount", + "name": "Total Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 90000000 + } + }, + { + "id": "affinity-data-year-founded", + "name": "Year Founded", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 1952 + } + } + ] + }, + "creatorId": 1, + "createdAt": "2023-01-01T00:00:00Z" + }, + { + "id": 2, + "type": "company", + "listId": 1, + "entity": { + "id": 2, + "name": "Umbrella Corporation", + "domain": "umbrella.co", + "domains": [ + "umbrella.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "affinity-data-description", + "name": "Description", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "The Umbrella Corporation is a multinational conglomerate with subsidiaries active in a variety of industries." + } + }, + { + "id": "affinity-data-industry", + "name": "Industry", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Cosmetics", + "Chemical", + "Consumer Goods", + "Food Products", + "Machinery Manufacturing", + "Pharmaceuticals", + "Transportation", + "Tourism" + ] + } + }, + { + "id": "affinity-data-investment-stage", + "name": "Investment Stage", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text", + "data": "Public Markets" + } + }, + { + "id": "affinity-data-investors", + "name": "Investors", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Oswell E. Spencer", + "Albert Wesker" + ] + } + }, + { + "id": "affinity-data-last-funding-amount", + "name": "Last Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 100000000 + } + }, + { + "id": "affinity-data-last-funding-date", + "name": "Last Funding Date", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "datetime", + "data": "2023-01-01T00:00:00Z" + } + }, + { + "id": "affinity-data-linkedin-url", + "name": "LinkedIn URL", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "https://linkedin.com/company/umbrella" + } + }, + { + "id": "affinity-data-location", + "name": "Location", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "location", + "data": { + "streetAddress": null, + "city": "Chicago", + "state": "Illinois", + "country": "United States", + "continent": null + } + } + }, + { + "id": "affinity-data-number-of-employees", + "name": "Number of Employees", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 12000 + } + }, + { + "id": "affinity-data-total-funding-amount", + "name": "Total Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 60000000 + } + }, + { + "id": "affinity-data-year-founded", + "name": "Year Founded", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 1968 + } + } + ] + }, + "creatorId": 1, + "createdAt": "2023-01-01T00:00:00Z" + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/1/list-entries?fieldTypes=enriched&cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/1/list-entries?fieldTypes=enriched&cursor=ICAgICAgIGFmdGVyOjo6NA" + } + } + }, + "company-list-relationship-intelligence": { + "description": "Example response on a Company list using `fieldTypes=relationship-intelligence`.", + "value": { + "data": [ + { + "id": 1, + "type": "company", + "listId": 1, + "entity": { + "id": 1, + "name": "Acme", + "domain": "acme.co", + "domains": [ + "acme.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "first-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-01T00:00:00Z", + "manualCreator": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + "participants": [ + { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + ] + } + } + }, + { + "id": "first-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Email", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "email", + "subject": "Defective Products", + "sentAt": "2020-01-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "first-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Event", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "meeting", + "title": "Defective Products", + "allDay": false, + "startTime": "2020-01-02T00:00:00Z", + "endTime": "2020-01-02T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "last-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-02T00:00:00Z", + "manualCreator": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + "participants": [ + { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + ] + } + } + }, + { + "id": "last-contact", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Contact", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "email", + "subject": "re: re: re: Defective Products", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Email", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "email", + "subject": "re: re: re: Defective Products", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Event", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "meeting", + "title": "re: re: re: Defective Products", + "allDay": false, + "startTime": "2020-01-03T00:00:00Z", + "endTime": "2020-01-03T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "next-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Next Event", + "value": { + "type": "interaction", + "data": { + "id": 3, + "type": "meeting", + "title": "re: re: re: re: Defective Products", + "allDay": false, + "startTime": "2020-02-03T00:00:00Z", + "endTime": "2020-02-03T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "source-of-introduction", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Source of Introduction", + "value": { + "type": "person", + "data": { + "id": 3, + "firstName": "Yosemite", + "lastName": "Sam", + "primaryEmailAddress": "yosemite@sam.com", + "type": "internal" + } + } + } + ] + }, + "creatorId": 1, + "createdAt": "2023-01-01T00:00:00Z" + }, + { + "id": 2, + "type": "company", + "listId": 1, + "entity": { + "id": 2, + "name": "Umbrella Corporation", + "domain": "umbrella.co", + "domains": [ + "umbrella.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "first-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 3, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-01T00:00:00Z", + "manualCreator": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + }, + "participants": [ + { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + }, + { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + ] + } + } + }, + { + "id": "first-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Email", + "value": { + "type": "interaction", + "data": { + "id": 4, + "type": "email", + "subject": "Zombie Outbreak", + "sentAt": "2020-01-01T00:00:00Z", + "from": { + "emailAddress": "leon.s@kennedy.com", + "person": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "oswell.e.spencer@umbrella.co", + "person": { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "first-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Event", + "value": { + "type": "interaction", + "data": { + "id": 4, + "type": "meeting", + "title": "Zombie Outbreak", + "allDay": false, + "startTime": "2020-01-02T00:00:00Z", + "endTime": "2020-01-02T01:00:00Z", + "attendees": [ + { + "emailAddress": "leon.s@kennedy.com", + "person": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + } + }, + { + "emailAddress": "oswell.e.spencer@umbrella.co", + "person": { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + } + ] + } + } + }, + { + "id": "last-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 4, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-02T00:00:00Z", + "manualCreator": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + }, + "participants": [ + { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + }, + { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + ] + } + } + }, + { + "id": "last-contact", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Contact", + "value": { + "type": "interaction", + "data": { + "id": 5, + "type": "email", + "subject": "re: re: re: Zombie Outbreak", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "leon.s@kennedy.com", + "person": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "oswell.e.spencer@umbrella.co", + "person": { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Email", + "value": { + "type": "interaction", + "data": { + "id": 5, + "type": "email", + "subject": "re: re: re: Zombie Outbreak", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "leon.s@kennedy.com", + "person": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "oswell.e.spencer@umbrella.co", + "person": { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Event", + "value": { + "type": "interaction", + "data": { + "id": 5, + "type": "meeting", + "title": "re: re: re: Zombie Outbreak", + "allDay": false, + "startTime": "2020-01-02T00:00:00Z", + "endTime": "2020-01-02T01:00:00Z", + "attendees": [ + { + "emailAddress": "leon.s@kennedy.com", + "person": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + } + }, + { + "emailAddress": "oswell.e.spencer@umbrella.co", + "person": { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + } + ] + } + } + }, + { + "id": "next-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Next Event", + "value": { + "type": "interaction", + "data": { + "id": 6, + "type": "meeting", + "title": "re: re: re: re: Zombie Outbreak", + "allDay": false, + "startTime": "2020-01-03T00:00:00Z", + "endTime": "2020-01-03T01:00:00Z", + "attendees": [ + { + "emailAddress": "leon.s@kennedy.com", + "person": { + "id": 4, + "firstName": "Leon S", + "lastName": "Kennedy", + "primaryEmailAddress": "leon.s@kennedy.com", + "type": "internal" + } + }, + { + "emailAddress": "oswell.e.spencer@umbrella.co", + "person": { + "id": 5, + "firstName": "Oswell E.", + "lastName": "Spencer", + "primaryEmailAddress": "oswell.e.spencer@umbrella.co", + "type": "external" + } + } + ] + } + } + }, + { + "id": "source-of-introduction", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Source of Introduction", + "value": { + "type": "person", + "data": { + "id": 3, + "firstName": "Albert", + "lastName": "Wesker", + "primaryEmailAddress": "albert.wesker@umbrella.com", + "type": "internal" + } + } + } + ] + }, + "creatorId": 1, + "createdAt": "2023-01-01T00:00:00Z" + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/1/list-entries?fieldTypes=relationship-intelligence&cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/1/list-entries?fieldTypes=relationship-intelligence&cursor=ICAgICAgIGFmdGVyOjo6NA" + } + } + }, + "company-list-global-and-list": { + "description": "Example response on a Company list using `fieldTypes=global&fieldTypes=list`.", + "value": { + "data": [ + { + "id": 1, + "type": "company", + "listId": 1, + "entity": { + "id": 222345350, + "name": "Acme", + "domain": "acme.co", + "domains": [ + "acme.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "field-1", + "type": "global", + "enrichmentSource": null, + "name": "Global Number Field", + "value": { + "type": "number", + "data": 100 + } + }, + { + "id": "field-2", + "type": "list", + "enrichmentSource": null, + "name": "List Number Field", + "value": { + "type": "number", + "data": 200 + } + } + ] + }, + "createdAt": "2023-01-01T00:00:00Z", + "creatorId": 1 + }, + { + "id": 2, + "type": "company", + "listId": 1, + "entity": { + "id": 2, + "name": "Umbrella Corporation", + "domain": "umbrella.co", + "domains": [ + "umbrella.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "field-1", + "type": "global", + "enrichmentSource": null, + "name": "Global Number Field", + "value": { + "type": "number", + "data": 100 + } + }, + { + "id": "field-2", + "type": "list", + "enrichmentSource": null, + "name": "List Number Field", + "value": { + "type": "number", + "data": 200 + } + } + ] + }, + "createdAt": "2023-01-01T00:00:00Z", + "creatorId": 1 + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/1/list-entries?fieldTypes=global&fieldTypes=list&cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/1/list-entries?fieldTypes=global&fieldTypes=list&cursor=ICAgICAgIGFmdGVyOjo6NA" + } + } + }, + "company-list-enriched-2": { + "description": "Example response on a Company list using `fieldTypes=enriched`.", + "value": { + "id": 1, + "type": "company", + "listId": 1, + "entity": { + "id": 1, + "name": "Acme", + "domain": "acme.co", + "domains": [ + "acme.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "affinity-data-description", + "name": "Description", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "Acme is a mega-corporation that manufactures everything from anvils to earthquake pills." + } + }, + { + "id": "affinity-data-industry", + "name": "Industry", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Aerospace", + "Construction", + "Consumer Goods" + ] + } + }, + { + "id": "affinity-data-investment-stage", + "name": "Investment Stage", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text", + "data": "Public Markets" + } + }, + { + "id": "affinity-data-investors", + "name": "Investors", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Marvin Acme", + "Yosemite Sam" + ] + } + }, + { + "id": "affinity-data-last-funding-amount", + "name": "Last Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 100000000 + } + }, + { + "id": "affinity-data-last-funding-date", + "name": "Last Funding Date", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "datetime", + "data": "2023-01-01T00:00:00Z" + } + }, + { + "id": "affinity-data-linkedin-url", + "name": "LinkedIn URL", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "https://linkedin.com/company/acme" + } + }, + { + "id": "affinity-data-location", + "name": "Location", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "location", + "data": { + "streetAddress": null, + "city": "Fairfield", + "state": "New Jersey", + "country": "United States", + "continent": null + } + } + }, + { + "id": "affinity-data-number-of-employees", + "name": "Number of Employees", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 3990 + } + }, + { + "id": "affinity-data-total-funding-amount", + "name": "Total Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 90000000 + } + }, + { + "id": "affinity-data-year-founded", + "name": "Year Founded", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 1952 + } + } + ] + }, + "creatorId": 1, + "createdAt": "2023-01-01T00:00:00Z" + } + }, + "company-list-relationship-intelligence-2": { + "description": "Example response on a Company list using `fieldTypes=relationship-intelligence`.", + "value": { + "id": 1, + "type": "company", + "listId": 1, + "entity": { + "id": 1, + "name": "Acme", + "domain": "acme.co", + "domains": [ + "acme.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "first-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-01T00:00:00Z", + "manualCreator": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + "participants": [ + { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + ] + } + } + }, + { + "id": "first-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Email", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "email", + "subject": "Defective Products", + "sentAt": "2020-01-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "first-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Event", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "meeting", + "title": "Defective Products", + "allDay": false, + "startTime": "2020-01-02T00:00:00Z", + "endTime": "2020-01-02T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "last-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-02T00:00:00Z", + "manualCreator": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + "participants": [ + { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + ] + } + } + }, + { + "id": "last-contact", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Contact", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "email", + "subject": "re: re: re: Defective Products", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Email", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "email", + "subject": "re: re: re: Defective Products", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Event", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "meeting", + "title": "re: re: re: Defective Products", + "allDay": false, + "startTime": "2020-01-03T00:00:00Z", + "endTime": "2020-01-03T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "next-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Next Event", + "value": { + "type": "interaction", + "data": { + "id": 3, + "type": "meeting", + "title": "re: re: re: re: Defective Products", + "allDay": false, + "startTime": "2020-02-03T00:00:00Z", + "endTime": "2020-02-03T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "source-of-introduction", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Source of Introduction", + "value": { + "type": "person", + "data": { + "id": 3, + "firstName": "Yosemite", + "lastName": "Sam", + "primaryEmailAddress": "yosemite@sam.com", + "type": "internal" + } + } + } + ] + }, + "creatorId": 1, + "createdAt": "2023-01-01T00:00:00Z" + } + }, + "company-list-global-and-list-2": { + "description": "Example response on a Company list using `fieldTypes=global&fieldTypes=list`.", + "value": { + "id": 1, + "type": "company", + "listId": 1, + "entity": { + "id": 222345350, + "name": "Acme", + "domain": "acme.co", + "domains": [ + "acme.co" + ], + "isGlobal": true, + "fields": [ + { + "id": "field-1", + "type": "global", + "enrichmentSource": null, + "name": "Global Number Field", + "value": { + "type": "number", + "data": 100 + } + }, + { + "id": "field-2", + "type": "list", + "enrichmentSource": null, + "name": "List Number Field", + "value": { + "type": "number", + "data": 200 + } + } + ] + }, + "createdAt": "2023-01-01T00:00:00Z", + "creatorId": 1 + } + }, + "company-list-enriched-3": { + "description": "Example response on a Company list using `types=enriched`.", + "value": { + "data": [ + { + "id": "affinity-data-description", + "name": "Description", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "Acme is a mega-corporation that manufactures everything from anvils to earthquake pills." + } + }, + { + "id": "affinity-data-industry", + "name": "Industry", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Aerospace", + "Construction", + "Consumer Goods" + ] + } + }, + { + "id": "affinity-data-investment-stage", + "name": "Investment Stage", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text", + "data": "Public Markets" + } + }, + { + "id": "affinity-data-investors", + "name": "Investors", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "filterable-text-multi", + "data": [ + "Marvin Acme", + "Yosemite Sam" + ] + } + }, + { + "id": "affinity-data-last-funding-amount", + "name": "Last Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 100000000 + } + }, + { + "id": "affinity-data-last-funding-date", + "name": "Last Funding Date", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "datetime", + "data": "2023-01-01T00:00:00Z" + } + }, + { + "id": "affinity-data-linkedin-url", + "name": "LinkedIn URL", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "text", + "data": "https://linkedin.com/company/acme" + } + }, + { + "id": "affinity-data-location", + "name": "Location", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "location", + "data": { + "streetAddress": null, + "city": "Fairfield", + "state": "New Jersey", + "country": "United States", + "continent": null + } + } + }, + { + "id": "affinity-data-number-of-employees", + "name": "Number of Employees", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 3990 + } + }, + { + "id": "affinity-data-total-funding-amount", + "name": "Total Funding Amount (USD)", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 90000000 + } + }, + { + "id": "affinity-data-year-founded", + "name": "Year Founded", + "type": "enriched", + "enrichmentSource": "affinity-data", + "value": { + "type": "number", + "data": 1952 + } + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/1/list-entries?types=enriched&cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/1/list-entries?types=enriched&cursor=ICAgICAgIGFmdGVyOjo6NA" + } + } + }, + "company-list-relationship-intelligence-3": { + "description": "Example response on a Company list using `types=relationship-intelligence`.", + "value": { + "data": [ + { + "id": "first-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-01T00:00:00Z", + "manualCreator": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + "participants": [ + { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + ] + } + } + }, + { + "id": "first-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Email", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "email", + "subject": "Defective Products", + "sentAt": "2020-01-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "first-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "First Event", + "value": { + "type": "interaction", + "data": { + "id": 1, + "type": "meeting", + "title": "Defective Products", + "allDay": false, + "startTime": "2020-01-02T00:00:00Z", + "endTime": "2020-01-02T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "last-chat-message", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Chat Message", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "chat-message", + "direction": "sent", + "sentAt": "2020-01-02T00:00:00Z", + "manualCreator": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + "participants": [ + { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + }, + { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + ] + } + } + }, + { + "id": "last-contact", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Contact", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "email", + "subject": "re: re: re: Defective Products", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-email", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Email", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "email", + "subject": "re: re: re: Defective Products", + "sentAt": "2020-02-01T00:00:00Z", + "from": { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + "to": [ + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ], + "cc": [] + } + } + }, + { + "id": "last-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Last Event", + "value": { + "type": "interaction", + "data": { + "id": 2, + "type": "meeting", + "title": "re: re: re: Defective Products", + "allDay": false, + "startTime": "2020-01-03T00:00:00Z", + "endTime": "2020-01-03T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "next-event", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Next Event", + "value": { + "type": "interaction", + "data": { + "id": 3, + "type": "meeting", + "title": "re: re: re: re: Defective Products", + "allDay": false, + "startTime": "2020-02-03T00:00:00Z", + "endTime": "2020-02-03T01:00:00Z", + "attendees": [ + { + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + }, + { + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" + } + } + ] + } + } + }, + { + "id": "source-of-introduction", + "type": "relationship-intelligence", + "enrichmentSource": null, + "name": "Source of Introduction", + "value": { + "type": "person", + "data": { + "id": 3, + "firstName": "Yosemite", + "lastName": "Sam", + "primaryEmailAddress": "yosemite@sam.com", + "type": "internal" + } + } + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/1/list-entries?types=relationship-intelligence&cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/1/list-entries?types=relationship-intelligence&cursor=ICAgICAgIGFmdGVyOjo6NA" + } + } + }, + "company-list-global-and-list-3": { + "description": "Example response on a Company list using `types=global&fieldTypes=list`.", + "value": { + "data": [ + { + "id": "field-1", + "type": "global", + "enrichmentSource": null, + "name": "Global Number Field", + "value": { + "type": "number", + "data": 100 + } + }, + { + "id": "field-2", + "type": "list", + "enrichmentSource": null, + "name": "List Number Field", + "value": { + "type": "number", + "data": 200 + } + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/1/list-entries/1/fields?types=global&types=list&cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/1/list-entries/1/fields?types=global&types=list&cursor=ICAgICAgIGFmdGVyOjo6NA" + } + } + }, + "update-fields": { + "description": "Example request for an `update-fields` operation.", + "value": { + "operation": "update-fields", + "updates": [ + { + "id": "field-1", + "value": { + "type": "company", + "data": { + "id": 1 + } + } + }, + { + "id": "field-2", + "value": { + "type": "company-multi", + "data": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + }, + { + "id": "field-3", + "value": { + "type": "datetime", + "data": "2023-01-01T00:00:00Z" + } + }, + { + "id": "field-4", + "value": { + "type": "dropdown", + "data": { + "dropdownOptionId": 1 + } + } + }, + { + "id": "field-5", + "value": { + "type": "dropdown-multi", + "data": [ + { + "dropdownOptionId": 1 + }, + { + "dropdownOptionId": 2 + } + ] + } + }, + { + "id": "field-6", + "value": { + "type": "location", + "data": { + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + "country": "United States", + "continent": "North America" + } + } + }, + { + "id": "field-7", + "value": { + "type": "location-multi", + "data": [ + { + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + "country": "United States", + "continent": "North America" + }, + { + "streetAddress": "1600 Pennsylvania Avenue NW", + "city": "Washington", + "state": "DC", + "country": "United States", + "continent": "North America" + } + ] + } + }, + { + "id": "field-8", + "value": { + "type": "number", + "data": 100 + } + }, + { + "id": "field-9", + "value": { + "type": "number-multi", + "data": [ + 100, + 200, + 300 + ] + } + }, + { + "id": "field-10", + "value": { + "type": "person", + "data": { + "id": 1 + } + } + }, + { + "id": "field-11", + "value": { + "type": "person-multi", + "data": [ + { + "id": 1 + }, + { + "id": 2 + } + ] + } + }, + { + "id": "field-12", + "value": { + "type": "ranked-dropdown", + "data": { + "dropdownOptionId": 1 + } + } + }, + { + "id": "field-13", + "value": { + "type": "text", + "data": "Some new text" + } + } + ] + } + }, + "update-fields-2": { + "description": "Example response from an update-fields operation.", + "value": { + "operation": "update-fields" + } + }, + "company": { + "description": "Example response on a field with a company value.", + "value": { + "id": "field-1", + "name": "Field with company value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "company", + "data": { + "id": 1, + "name": "Acme", + "domain": "acme.co" + } + } + } + }, + "company-multi": { + "description": "Example response on a field with a company-multi value.", + "value": { + "id": "field-2", + "name": "Field with company-multi value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "company-multi", + "data": [ + { + "id": 1, + "name": "Acme", + "domain": "acme.co" + }, + { + "id": 2, + "name": "Umbrella Corporation", + "domain": "umbrella.co" + } + ] + } + } + }, + "datetime": { + "description": "Example response on a field with a datetime value.", + "value": { + "id": "field-3", + "name": "Field with datetime value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "datetime", + "data": "2023-01-01T00:00:00Z" + } + } + }, + "dropdown": { + "description": "Example response on a field with a dropdown value.", + "value": { + "id": "field-4", + "name": "Field with dropdown value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "dropdown", + "data": { + "dropdownOptionId": 1, + "text": "Option 1" + } + } + } + }, + "dropdown-multi": { + "description": "Example response on a field with a dropdown-multi value.", + "value": { + "id": "field-5", + "name": "Field with dropdown-multi value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "dropdown-multi", + "data": [ + { + "dropdownOptionId": 1, + "text": "Option 1" + }, + { + "dropdownOptionId": 2, + "text": "Option 2" + } ] - }, - "entity": { - "$ref": "#/components/schemas/Person" } - }, - "required": [ - "createdAt", - "creatorId", - "entity", - "id", - "listId", - "type" - ], - "additionalProperties": false + } }, - "ListEntryWithEntity": { - "title": "ListEntryWithEntity", - "oneOf": [ - { - "$ref": "#/components/schemas/CompanyListEntry" - }, - { - "$ref": "#/components/schemas/OpportunityListEntry" - }, - { - "$ref": "#/components/schemas/PersonListEntry" + "filterable-text": { + "description": "Example response on a field with a filterable-text value.", + "value": { + "id": "field-6", + "name": "Field with filterable-text value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "filterable-text", + "data": "A text value" } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "company": "#/components/schemas/CompanyListEntry", - "opportunity": "#/components/schemas/OpportunityListEntry", - "person": "#/components/schemas/PersonListEntry" + } + }, + "filterable-text-multi": { + "description": "Example response on a field with a filterable-text-multi value.", + "value": { + "id": "field-7", + "name": "Field with filterable-text-multi value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "filterable-text-multi", + "data": [ + "A text value", + "Another text value" + ] } - }, - "examples": [ - { - "createdAt": "2023-01-01T00:00:00Z", - "creatorId": 1, - "id": 1, - "type": "company", - "entity": { - "domain": "acme.co", - "name": "Acme", - "isGlobal": true, - "domains": [ - "acme.co" - ], + } + }, + "formula-number": { + "description": "Example response on a field with a formula-number value.", + "value": { + "id": "field-8", + "name": "Field with formula-number value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "formula-number", + "data": { + "calculatedValue": 100 + } + } + } + }, + "interaction": { + "description": "Example response on a field with a interaction value.", + "value": { + "id": "field-9", + "name": "Field with interaction value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "interaction", + "data": { "id": 1, - "fields": [ + "type": "meeting", + "title": "Defective Products", + "allDay": false, + "startTime": "2020-01-02T00:00:00Z", + "endTime": "2020-01-02T01:00:00Z", + "attendees": [ { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" + "emailAddress": "wile.e@coyote.com", + "person": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" } }, { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" + "emailAddress": "bobbo@acme.co", + "person": { + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" } } ] } } - ] + } }, - "ListEntryWithEntityPaged": { - "title": "ListEntryWithEntityPaged", - "description": "ListEntryWithEntityPaged model", - "type": "object", - "properties": { - "data": { - "description": "A page of ListEntryWithEntity results", - "type": [ - "array", - "null" - ], - "items": { - "$ref": "#/components/schemas/ListEntryWithEntity" - }, - "maxItems": 100 - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "location": { + "description": "Example response on a field with a location value.", + "value": { + "id": "field-10", + "name": "Field with location value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "location", + "data": { + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + "country": "United States", + "continent": "North America" + } } - }, - "required": [ - "data", - "pagination" - ], - "additionalProperties": false, - "examples": [ - { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - }, + } + }, + "location-multi": { + "description": "Example response on a field with a location-multi value.", + "value": { + "id": "field-11", + "name": "Field with location-multi value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "location-multi", "data": [ { - "createdAt": "2023-01-01T00:00:00Z", - "creatorId": 1, - "id": 1, - "type": "company", - "entity": { - "domain": "acme.co", - "name": "Acme", - "isGlobal": true, - "domains": [ - "acme.co" - ], - "id": 1, - "fields": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - }, - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - } - ] - } + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + "country": "United States", + "continent": "North America" }, { - "createdAt": "2023-01-01T00:00:00Z", - "creatorId": 1, - "id": 1, - "type": "company", - "entity": { - "domain": "acme.co", - "name": "Acme", - "isGlobal": true, - "domains": [ - "acme.co" - ], - "id": 1, - "fields": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - }, - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - } - ] - } + "streetAddress": "1600 Pennsylvania Avenue NW", + "city": "Washington", + "state": "DC", + "country": "United States", + "continent": "North America" } ] } - ] + } }, - "SavedView": { - "title": "SavedView", - "description": "SavedView model", - "type": "object", - "properties": { - "id": { - "description": "The saved view's unique identifier", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 28 - ] - }, - "name": { - "description": "The saved view's name", - "type": "string", - "examples": [ - "my interesting companies" - ] - }, - "type": { - "description": "The type for this saved view", - "type": "string", - "enum": [ - "sheet", - "board", - "dashboard" - ], - "examples": [ - "sheet" - ] - }, - "createdAt": { - "description": "The date that the saved view was created", - "type": "string", - "format": "date-time", - "examples": [ - "2023-01-01T00:00:00Z" - ] - } - }, - "required": [ - "createdAt", - "id", - "name", - "type" - ], - "additionalProperties": false, - "examples": [ - { - "createdAt": "2023-01-01T00:00:00Z", - "name": "my interesting companies", - "id": 28, - "type": "sheet" + "number": { + "description": "Example response on a field with a number value.", + "value": { + "id": "field-12", + "name": "Field with number value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "number", + "data": 100 } - ] + } }, - "SavedViewPaged": { - "title": "SavedViewPaged", - "description": "SavedViewPaged model", - "type": "object", - "properties": { - "data": { - "description": "A page of SavedView results", - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedView" - }, - "maxItems": 100 - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" - } - }, - "required": [ - "data", - "pagination" - ], - "additionalProperties": false, - "examples": [ - { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - }, + "number-multi": { + "description": "Example response on a field with a number-multi value.", + "value": { + "id": "field-13", + "name": "Field with number-multi value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "number-multi", + "data": [ + 100, + 200, + 300 + ] + } + } + }, + "person": { + "description": "Example response on a field with a person value.", + "value": { + "id": "field-14", + "name": "Field with person value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "person", + "data": { + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" + } + } + } + }, + "person-multi": { + "description": "Example response on a field with a person-multi value.", + "value": { + "id": "field-15", + "name": "Field with person-multi value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "person-multi", "data": [ { - "createdAt": "2023-01-01T00:00:00Z", - "name": "my interesting companies", - "id": 28, - "type": "sheet" + "id": 1, + "firstName": "Wile E.", + "lastName": "Coyote", + "primaryEmailAddress": "wile.e@coyote.com", + "type": "internal" }, { - "createdAt": "2023-01-01T00:00:00Z", - "name": "my interesting companies", - "id": 28, - "type": "sheet" + "id": 2, + "firstName": "Bobbo", + "lastName": "Acme", + "primaryEmailAddress": "bobbo@stackshare.io", + "type": "external" } ] } - ] + } }, - "Opportunity": { - "title": "Opportunity", - "description": "Opportunity model", - "type": "object", - "properties": { - "id": { - "description": "The unique identifier for the opportunity", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] - }, - "name": { - "description": "The name of the opportunity", - "type": "string", - "examples": [ - "Acme Upsell $10k" - ] - }, - "listId": { - "description": "The ID of the list that the opportunity belongs to", - "type": "integer", - "format": "int64", - "minimum": 1, - "maximum": 9007199254740991, - "examples": [ - 1 - ] + "ranked-dropdown": { + "description": "Example response on a field with a ranked-dropdown value.", + "value": { + "id": "field-16", + "name": "Field with ranked-dropdown value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "ranked-dropdown", + "data": { + "dropdownOptionId": 1, + "text": "Option 1", + "rank": 1, + "color": "gray" + } } - }, - "required": [ - "id", - "listId", - "name" - ], - "additionalProperties": false, - "examples": [ - { - "listId": 1, - "name": "Acme Upsell $10k", - "id": 1 + } + }, + "text": { + "description": "Example response on a field with a text value.", + "value": { + "id": "field-17", + "name": "Field with text value", + "type": "list", + "enrichmentSource": null, + "value": { + "type": "text", + "data": "Hello" } - ] + } }, - "OpportunityPaged": { - "title": "OpportunityPaged", - "description": "OpportunityPaged model", - "type": "object", - "properties": { - "data": { - "description": "A page of Opportunity results", - "type": "array", - "items": { - "$ref": "#/components/schemas/Opportunity" - }, - "maxItems": 100 - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "company-2": { + "description": "Example response on a field with a company value.", + "value": { + "value": { + "type": "company", + "data": { + "id": 1 + } } - }, - "required": [ - "data", - "pagination" - ], - "additionalProperties": false, - "examples": [ - { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - }, + } + }, + "company-multi-2": { + "description": "Example response on a field with a company-multi value.", + "value": { + "value": { + "type": "company-multi", "data": [ { - "listId": 1, - "name": "Acme Upsell $10k", "id": 1 }, { - "listId": 1, - "name": "Acme Upsell $10k", - "id": 1 + "id": 2 } ] } - ] + } }, - "PersonPaged": { - "title": "PersonPaged", - "description": "PersonPaged model", - "type": "object", - "properties": { - "data": { - "description": "A page of Person results", - "type": "array", - "items": { - "$ref": "#/components/schemas/Person" - }, - "maxItems": 100 - }, - "pagination": { - "$ref": "#/components/schemas/Pagination" + "datetime-2": { + "description": "Example response on a field with a datetime value.", + "value": { + "value": { + "type": "datetime", + "data": "2023-01-01T00:00:00Z" } - }, - "required": [ - "data", - "pagination" - ], - "additionalProperties": false, - "examples": [ - { - "pagination": { - "prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw", - "nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - }, + } + }, + "dropdown-2": { + "description": "Example response on a field with a dropdown value.", + "value": { + "value": { + "type": "dropdown", + "data": { + "dropdownOptionId": 1 + } + } + } + }, + "dropdown-multi-2": { + "description": "Example response on a field with a dropdown-multi value.", + "value": { + "value": { + "type": "dropdown-multi", "data": [ { - "firstName": "Jane", - "lastName": "Doe", - "emailAddresses": [ - "jane.doe@acme.co", - "janedoe@gmail.com" - ], - "id": 1, - "type": "internal", - "fields": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - }, - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - } - ], - "primaryEmailAddress": "jane.doe@acme.co" + "dropdownOptionId": 1 }, { - "firstName": "Jane", - "lastName": "Doe", - "emailAddresses": [ - "jane.doe@acme.co", - "janedoe@gmail.com" - ], - "id": 1, - "type": "internal", - "fields": [ - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - }, - { - "enrichmentSource": "affinity-data", - "name": "Location", - "id": "affinity-data-location", - "type": "enriched", - "value": { - "data": { - "continent": "North America", - "country": "United States", - "streetAddress": "170 Columbus Ave", - "city": "San Francisco", - "state": "California" - }, - "type": "location" - } - } - ], - "primaryEmailAddress": "jane.doe@acme.co" + "dropdownOptionId": 2 + } + ] + } + } + }, + "filterable-text-2": { + "description": "Example response on a field with a filterable-text value.", + "value": { + "value": { + "type": "filterable-text", + "data": "A text value" + } + } + }, + "filterable-text-multi-2": { + "description": "Example response on a field with a filterable-text-multi value.", + "value": { + "value": { + "type": "filterable-text-multi", + "data": [ + "A text value", + "Another text value" + ] + } + } + }, + "location-2": { + "description": "Example response on a field with a location value.", + "value": { + "value": { + "type": "location", + "data": { + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + "country": "United States", + "continent": "North America" + } + } + } + }, + "location-multi-2": { + "description": "Example response on a field with a location-multi value.", + "value": { + "value": { + "type": "location-multi", + "data": [ + { + "streetAddress": "1 Main Street", + "city": "San Francisco", + "state": "California", + "country": "United States", + "continent": "North America" + }, + { + "streetAddress": "1600 Pennsylvania Avenue NW", + "city": "Washington", + "state": "DC", + "country": "United States", + "continent": "North America" } ] } - ] - } - }, - "responses": { - "400": { - "description": "Bad Request", - "content": { - "application/json": { - "schema": { - "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" - } - } - } - } + } + }, + "number-2": { + "description": "Example response on a field with a number value.", + "value": { + "value": { + "type": "number", + "data": 100 + } + } + }, + "number-multi-2": { + "description": "Example response on a field with a number-multi value.", + "value": { + "value": { + "type": "number-multi", + "data": [ + 100, + 200, + 300 + ] + } + } + }, + "person-2": { + "description": "Example response on a field with a person value.", + "value": { + "value": { + "type": "person", + "data": { + "id": 1 + } + } + } + }, + "person-multi-2": { + "description": "Example response on a field with a person-multi value.", + "value": { + "value": { + "type": "person-multi", + "data": [ + { + "id": 1 }, - "required": [ - "errors" - ], - "additionalProperties": false + { + "id": 2 + } + ] + } + } + }, + "ranked-dropdown-2": { + "description": "Example response on a field with a ranked-dropdown value.", + "value": { + "value": { + "type": "ranked-dropdown", + "data": { + "dropdownOptionId": 1 } } - }, - "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" + } + }, + "text-2": { + "description": "Example response on a field with a text value.", + "value": { + "value": { + "type": "text", + "data": "Some new text" } } }, - "403": { - "description": "Forbidden", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AuthorizationErrors" + "company-list-2": { + "description": "Example response on a Company list.", + "value": { + "data": [ + { + "id": "affinity-data-description", + "name": "Description", + "type": "enriched", + "valueType": "text", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-industry", + "name": "Industry", + "type": "enriched", + "valueType": "filterable-text-multi", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-investment-stage", + "name": "Investment Stage", + "type": "enriched", + "valueType": "filterable-text", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-investors", + "name": "Investors", + "type": "enriched", + "valueType": "filterable-text-multi", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-last-funding-amount", + "name": "Last Funding Amount (USD)", + "type": "enriched", + "valueType": "number", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-last-funding-date", + "name": "Last Funding Date", + "type": "enriched", + "valueType": "datetime", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-linkedin-url", + "name": "LinkedIn URL", + "type": "enriched", + "valueType": "text", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-location", + "name": "Location", + "type": "enriched", + "valueType": "location", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-number-of-employees", + "name": "Number of Employees", + "type": "enriched", + "valueType": "number", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-total-funding-amount", + "name": "Total Funding Amount (USD)", + "type": "enriched", + "valueType": "number", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-year-founded", + "name": "Year Founded", + "type": "enriched", + "valueType": "number", + "enrichmentSource": "affinity-data" + }, + { + "id": "field-1", + "name": "Custom global field", + "type": "global", + "valueType": "text", + "enrichmentSource": null + }, + { + "id": "field-2", + "name": "Custom list field", + "type": "list", + "valueType": "text", + "enrichmentSource": null + }, + { + "id": "first-chat-message", + "name": "First Chat Message", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "first-email", + "name": "First Email", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "first-event", + "name": "First Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-chat-message", + "name": "Last Chat Message", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-contact", + "name": "Last Contact", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-email", + "name": "Last Email", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-event", + "name": "Last Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "next-event", + "name": "Next Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "source-of-introduction", + "name": "Source of Introduction", + "type": "relationship-intelligence", + "valueType": "person", + "enrichmentSource": null } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/1/fields?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/1/fields?cursor=ICAgICAgIGFmdGVyOjo6NA" } - }, - "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" + } + }, + "person-list-2": { + "description": "Example response on a Person list.", + "value": { + "data": [ + { + "id": "affinity-data-current-job-title", + "name": "Current Job Title", + "type": "enriched", + "valueType": "filterable-text", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-current-organization", + "name": "Current Organization", + "type": "enriched", + "valueType": "company", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-industry", + "name": "Industry", + "type": "enriched", + "valueType": "filterable-text-multi", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-job-titles", + "name": "Job Titles", + "type": "enriched", + "valueType": "filterable-text-multi", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-location", + "name": "Location", + "type": "enriched", + "valueType": "location", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-linkedin-url", + "name": "LinkedIn URL", + "type": "enriched", + "valueType": "text", + "enrichmentSource": "affinity-data" + }, + { + "id": "affinity-data-phone-number", + "name": "Phone Number", + "type": "enriched", + "valueType": "filterable-text-multi", + "enrichmentSource": "affinity-data" + }, + { + "id": "companies", + "name": "Organizations", + "type": "list", + "valueType": "company-multi", + "enrichmentSource": null + }, + { + "id": "field-1", + "name": "Custom global field", + "type": "global", + "valueType": "text", + "enrichmentSource": null + }, + { + "id": "field-2", + "name": "Custom list field", + "type": "list", + "valueType": "text", + "enrichmentSource": null + }, + { + "id": "first-chat-message", + "name": "First Chat Message", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "first-email", + "name": "First Email", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "first-event", + "name": "First Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-chat-message", + "name": "Last Chat Message", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-contact", + "name": "Last Contact", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-email", + "name": "Last Email", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-event", + "name": "Last Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "next-event", + "name": "Next Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "source-of-introduction", + "name": "Source of Introduction", + "type": "relationship-intelligence", + "valueType": "person", + "enrichmentSource": null + } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/2/fields?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/2/fields?cursor=ICAgICAgIGFmdGVyOjo6NA" } } }, - "404": { - "description": "Not Found", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotFoundErrors" + "opportunity-list-2": { + "description": "Example response on an Opportunity list.", + "value": { + "data": [ + { + "id": "companies", + "name": "Organizations", + "type": "list", + "valueType": "company-multi", + "enrichmentSource": null + }, + { + "id": "field-2", + "name": "Custom list field", + "type": "list", + "valueType": "text", + "enrichmentSource": null + }, + { + "id": "first-chat-message", + "name": "First Chat Message", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "first-email", + "name": "First Email", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "first-event", + "name": "First Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-chat-message", + "name": "Last Chat Message", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-contact", + "name": "Last Contact", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-email", + "name": "Last Email", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "last-event", + "name": "Last Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "next-event", + "name": "Next Event", + "type": "relationship-intelligence", + "valueType": "interaction", + "enrichmentSource": null + }, + { + "id": "persons", + "name": "People", + "type": "list", + "valueType": "person-multi", + "enrichmentSource": null } + ], + "pagination": { + "prevUrl": "https://api.affinity.co/v2/lists/3/fields?cursor=ICAgICAgYmVmb3JlOjo6Nw", + "nextUrl": "https://api.affinity.co/v2/lists/3/fields?cursor=ICAgICAgIGFmdGVyOjo6NA" } - }, - "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" + } + }, + "merges-list": { + "x-stability-level": "beta", + "summary": "List of person merges", + "description": "Example response showing multiple person merges with different statuses", + "value": { + "data": [ + { + "id": 12, + "status": "success", + "taskId": "789e0123-e45b-67c8-d901-234567890123", + "startedAt": "2025-06-03T10:30:00Z", + "primaryPersonId": 12345, + "duplicatePersonId": 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", + "primaryPersonId": 54321, + "duplicatePersonId": 98765, + "completedAt": "2025-06-03T09:16:30Z", + "errorMessage": "Primary person not found" + } + ], + "pagination": { + "nextUrl": "https://api.affinity.co/v2/persons/merge?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==", + "prevUrl": null } } }, - "default": { - "description": "Errors", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Errors" + "merge-persons": { + "x-stability-level": "beta", + "summary": "Merge two person profiles", + "description": "Example request to merge a duplicate person profile into a primary person profile. The primary person (ID 12345) will be kept and all data from the duplicate person (ID 67890) will be merged into it.", + "value": { + "primaryPersonId": 12345, + "duplicatePersonId": 67890 + } + }, + "merge-initiated": { + "x-stability-level": "beta", + "summary": "Merge task initiated", + "description": "Response when a person 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/person-merges/123e4567-e89b-12d3-a456-426614174000" + } + }, + "succeeded-merge": { + "x-stability-level": "beta", + "summary": "Succeeded person merge", + "description": "Example of a successful person merge", + "value": { + "id": 12345, + "status": "success", + "taskId": "890e0123-f45g-67h8-i901-234567890123", + "startedAt": "2025-06-03T10:30:00Z", + "primaryPersonId": 12345, + "duplicatePersonId": 67890, + "completedAt": "2025-06-03T10:32:15Z", + "errorMessage": null + } + }, + "failed-merge": { + "x-stability-level": "beta", + "summary": "Failed person merge", + "description": "Example of a failed person merge with error details", + "value": { + "id": 67890, + "status": "failed", + "taskId": "789e0123-e45b-67c8-d901-234567890123", + "startedAt": "2025-06-03T09:15:00Z", + "primaryPersonId": 54321, + "duplicatePersonId": 98765, + "completedAt": "2025-06-03T09:16:30Z", + "errorMessage": "Primary person not found" + } + }, + "in-progress-merge": { + "x-stability-level": "beta", + "summary": "In-progress person merge", + "description": "Example of a person merge currently being processed", + "value": { + "id": 98765, + "status": "in-progress", + "taskId": "456e7890-e12b-34c5-d678-901234567890", + "startedAt": "2025-06-03T11:45:00Z", + "primaryPersonId": 24680, + "duplicatePersonId": 13579, + "completedAt": null, + "errorMessage": null + } + }, + "tasks-list": { + "x-stability-level": "beta", + "summary": "List of person merge tasks", + "description": "Example response showing multiple person 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/person-merges?cursor=eyJpZCI6NDU2ZTc4OTAtZTEyYi0zNGM1LWQ2NzgtOTAxMjM0NTY3ODkwfQ==", + "prevUrl": null } - }, - "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" + } + }, + "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 + } + } + }, + "task-success": { + "x-stability-level": "beta", + "summary": "Merge task suceeded", + "description": "Example response showing a merge task that has been successfully completed.", + "value": { + "id": "789e0123-f45g-67h8-i901-234567890123", + "status": "success", + "resultsSummary": { + "total": 1, + "inProgress": 0, + "success": 1, + "failed": 0 + } + } + }, + "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 } } } diff --git a/spec/v2_spec.patch b/spec/v2_spec.patch index c8c58b2..9486888 100644 --- a/spec/v2_spec.patch +++ b/spec/v2_spec.patch @@ -1,8 +1,8 @@ diff --git a/spec/v2_spec.json b/spec/v2_spec.json -index cb89551..01987d9 100644 +index 4657617..2c160e5 100644 --- a/spec/v2_spec.json +++ b/spec/v2_spec.json -@@ -2377,7 +2377,6 @@ +@@ -3753,7 +3753,6 @@ "emailAddress": { "description": "The user's email address", "type": "string", @@ -10,7 +10,23 @@ index cb89551..01987d9 100644 "examples": [ "john.smith@contoso.com" ] -@@ -2551,7 +2550,6 @@ +@@ -3943,7 +3942,6 @@ + "string", + "null" + ], +- "format": "email", + "examples": [ + "jane.doe@acme.co" + ] +@@ -3978,7 +3976,6 @@ + "emailAddress": { + "description": "The email address of the participant", + "type": "string", +- "format": "email", + "examples": [ + "jane.doe@gmail.com" + ] +@@ -4110,7 +4107,6 @@ "string", "null" ], @@ -18,12 +34,11 @@ index cb89551..01987d9 100644 "examples": [ "acme.co" ] -@@ -2798,6 +2796,18 @@ - "type" +@@ -4358,6 +4354,19 @@ ], "additionalProperties": false -+ }, -+ "LinkedInEntry": { + }, ++ "LinkedInEntry": { + "title": "LinkedInEntry", + "type": "object", + "properties": { @@ -33,11 +48,13 @@ index cb89551..01987d9 100644 + "text": { + "type": "string" + } -+ } - }, ++ }, ++ "additionalProperties": false ++ }, "TextsValue": { "title": "TextsValue", -@@ -2810,13 +2820,23 @@ + "type": "object", +@@ -4369,13 +4378,23 @@ }, "data": { "description": "The value for many strings", @@ -49,34 +66,26 @@ index cb89551..01987d9 100644 - "type": "string" - } + "oneOf":[ -+ { -+ "type": "array", -+ "items": { -+ "$ref":"#/components/schemas/LinkedInEntry" -+ } -+ }, -+ { -+ "type": "array", -+ "items": { -+ "type": "string" -+ } -+ }, -+ { -+ "type": "null" ++ { ++ "type": "array", ++ "items": { ++ "$ref":"#/components/schemas/LinkedInEntry" + } ++ }, ++ { ++ "type": "array", ++ "items": { ++ "type": "string" ++ } ++ }, ++ { ++ "type": "null" ++ } + ] } }, "required": [ -@@ -2905,7 +2925,6 @@ - "string", - "null" - ], -- "format": "email", - "examples": [ - "jane.doe@acme.co" - ] -@@ -3004,7 +3023,6 @@ +@@ -4496,7 +4515,6 @@ "string", "null" ], @@ -84,7 +93,7 @@ index cb89551..01987d9 100644 "examples": [ "john.smith@contoso.com" ] -@@ -3716,7 +3734,6 @@ +@@ -5208,7 +5226,6 @@ "string", "null" ], @@ -92,35 +101,7 @@ index cb89551..01987d9 100644 "examples": [ "acme.co" ] -@@ -3725,8 +3742,7 @@ - "description": "All of the company's domains", - "type": "array", - "items": { -- "type": "string", -- "format": "hostname" -+ "type": "string" - }, - "examples": [ - [ -@@ -3813,7 +3829,7 @@ - "string", - "null" - ], -- "format": "url", -+ "format": "uri", - "examples": [ - "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw" - ] -@@ -3824,7 +3840,7 @@ - "string", - "null" - ], -- "format": "url", -+ "format": "uri", - "examples": [ - "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA" - ] -@@ -4807,7 +4823,6 @@ +@@ -6305,7 +6322,6 @@ "string", "null" ], @@ -128,7 +109,7 @@ index cb89551..01987d9 100644 "examples": [ "jane.doe@acme.co" ] -@@ -4816,8 +4831,7 @@ +@@ -6314,8 +6330,7 @@ "description": "All of the person's email addresses", "type": "array", "items": {