Query structured spec data via REST or MCP. Get exactly what your agent needs.
//api.affinity.co
/v2/auth/whoami
Returns metadata about the current user.
GET /v2/auth/whoami
/v2/companies
Paginate through Companies in Affinity. Returns basic information and non-list-specific field data on each Company. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/companies/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Companies will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the "Export All Organizations directory" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
| ids | query | optional | array | Company IDs |
| fieldIds | query | optional | array | Field IDs for which to return field data |
| fieldTypes | query | optional | array | Field Types for which to return field data |
GET /v2/companies
/v2/companies/fields
Returns metadata on non-list-specific Company Fields. Use the returned Field IDs to request field data from the GET `/v2/companies` and GET `/v2/companies/{id}` endpoints.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/companies/fields
/v2/companies/{id}
Returns basic information and non-list-specific field data on the requested Company. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/companies/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Companies will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the "Export All Organizations directory" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | Company ID |
| fieldIds | query | optional | array | Field IDs for which to return field data |
| fieldTypes | query | optional | array | Field Types for which to return field data |
GET /v2/companies/{id}
/v2/companies/{id}/list-entries
Paginate through the List Entries (AKA rows) for the given Company across all Lists. Each List Entry includes field data for the Company, including list-specific field data. Each List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom. Requires the "Export data from Lists" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | Company ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/companies/{id}/list-entries
/v2/companies/{id}/lists
Returns metadata for all the Lists on which the given Company appears.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | Company ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/companies/{id}/lists
/v2/lists
Returns metadata on Lists.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/lists
/v2/lists/{listId}
Returns metadata on a single List.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| listId | path | required | integer | List ID |
GET /v2/lists/{listId}
/v2/lists/{listId}/fields
Returns metadata on the Fields available on a single List. Use the returned Field IDs to request field data from the GET `/v2/lists/{listId}/list-entries` endpoint.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| listId | path | required | integer | List ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/lists/{listId}/fields
/v2/lists/{listId}/list-entries
Paginate through the List Entries (AKA rows) on a given List. Returns basic information and field data, including list-specific field data, on each Company, Person, or Opportunity on the List. List Entries also include metadata about their creation, i.e., when they were added to the List and by whom. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/lists/{listId}/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, List Entries will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the "Export data from Lists" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| listId | path | required | integer | List ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
| fieldIds | query | optional | array | Field IDs for which to return field data |
| fieldTypes | query | optional | array | Field Types for which to return field data |
GET /v2/lists/{listId}/list-entries
/v2/lists/{listId}/saved-views
Returns metadata on the Saved Views on a List.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| listId | path | required | integer | List ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/lists/{listId}/saved-views
/v2/lists/{listId}/saved-views/{viewId}
Returns metadata on a single Saved View.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| listId | path | required | integer | List ID |
| viewId | path | required | integer | Saved view ID |
GET /v2/lists/{listId}/saved-views/{viewId}
/v2/lists/{listId}/saved-views/{viewId}/list-entries
Paginate through the List Entries (AKA rows) on a given Saved View. Use this endpoint when you need to filter entities or only want **some** field data to be returned: This endpoint respects the filters set on a Saved View via web app, and only returns field data corresponding to the columns that have been pulled into the Saved View via web app. Though this endpoint respects the Saved View's filters and column/Field selection, it does not yet preserve sort order. This endpoint also only supports **sheet-type Saved Views**, and not board- or dashboard-type Saved Views. See the [Data Model](https://developer.affinity.co/) section for more information about Saved Views. Requires the "Export data from Lists" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| listId | path | required | integer | List ID |
| viewId | path | required | integer | Saved view ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/lists/{listId}/saved-views/{viewId}/list-entries
/v2/opportunities
Paginate through Opportunities in Affinity. Returns basic information but **not** field data on each Opportunity. To access field data on Opportunities, use the `/lists/{list_id}/list-entries` or the `/v2/lists/{list_id}/saved-views/{view_id}/list-entries` GET endpoint. Requires the "Export data from Lists" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
| ids | query | optional | array | Opportunity IDs |
GET /v2/opportunities
/v2/opportunities/{id}
Returns basic information but **not** field data on the requested Opportunity. To access field data on Opportunities, use the `/lists/{list_id}/list-entries` or the `/v2/lists/{list_id}/saved-views/{view_id}/list-entries` GET endpoint. Requires the "Export data from Lists" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | Opportunity ID |
GET /v2/opportunities/{id}
/v2/persons
Paginate through Persons in Affinity. Returns basic information and non-list-specific field data on each Person. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/persons/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Persons will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the "Export All People directory" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
| ids | query | optional | array | People IDs |
| fieldIds | query | optional | array | Field IDs for which to return field data |
| fieldTypes | query | optional | array | Field Types for which to return field data |
GET /v2/persons
/v2/persons/fields
Returns metadata on non-list-specific Person Fields. Use the returned Field IDs to request field data from the GET `/v2/persons` and GET `/v2/persons/{id}` endpoints.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/persons/fields
/v2/persons/{id}
Returns basic information and non-list-specific field data on the requested Person. To retrieve field data, you must use either the `fieldIds` or the `fieldTypes` parameter to specify the Fields for which you want data returned. These Field IDs and Types can be found using the GET `/v2/persons/fields` endpoint. When no `fieldIds` or `fieldTypes` are provided, Persons will be returned without any field data attached. To supply multiple `fieldIds` or `fieldTypes` parameters, generate a query string that looks like this: `?fieldIds=field-1234&fieldIds=affinity-data-location` or `?fieldTypes=enriched&fieldTypes=global`. Requires the "Export All People directory" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | Person ID |
| fieldIds | query | optional | array | Field IDs for which to return field data |
| fieldTypes | query | optional | array | Field Types for which to return field data |
GET /v2/persons/{id}
/v2/persons/{id}/list-entries
Paginate through the List Entries (AKA rows) for the given Person across all Lists. Each List Entry includes field data for the Person, including list-specific field data. Each List Entry also includes metadata about its creation, i.e., when it was added to the List and by whom. Requires the "Export data from Lists" [permission](https://developer.affinity.co/).
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | Persons ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/persons/{id}/list-entries
/v2/persons/{id}/lists
Returns metadata for all the Lists on which the given Person appears.
| Name | In | Required | Type | Description |
|---|---|---|---|---|
| id | path | required | integer | Persons ID |
| cursor | query | optional | string | Cursor for the next or previous page |
| limit | query | optional | integer | Number of items to include in the page |
GET /v2/persons/{id}/lists
Attendee
{
"type": "object",
"properties": {
"person": {
"$ref": "#/components/schemas/PersonData",
"nullable": true
},
"emailAddress": {
"type": "string",
"format": "email",
"example": "john.smith@contoso.com",
"nullable": true,
"description": "The email addresses of the attendee"
}
}
}
AuthenticationError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "authentication",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
AuthorizationError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "authorization",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
ChatMessage
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The chat message's unique identifier"
},
"type": {
"enum": [
"call",
"email",
"meeting",
"chat-message"
],
"type": "string",
"example": "meeting",
"nullable": true,
"description": "The type of interaction"
},
"sentAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The time the chat message was sent"
},
"direction": {
"enum": [
"received",
"sent"
],
"type": "string",
"example": "outbound",
"nullable": true,
"description": "The direction of the chat message"
},
"participants": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PersonData"
},
"nullable": true,
"description": "The participants of the chat"
},
"manualCreator": {
"$ref": "#/components/schemas/PersonData",
"nullable": true
}
}
}
CompaniesValue
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CompanyData"
},
"nullable": true,
"description": "The values for many companies"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
Company
{
"type": "object",
"example": {
"id": 1,
"name": "Acme",
"domain": "acme.co",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"domains": [
"acme.co"
],
"isGlobal": true
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The company's unique identifier"
},
"name": {
"type": "string",
"example": "Acme",
"nullable": true,
"description": "The company's name"
},
"domain": {
"type": "string",
"format": "hostname",
"example": "acme.co",
"nullable": true,
"description": "The company's primary domain"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Field"
},
"description": "The fields associated with the company"
},
"domains": {
"type": "array",
"items": {
"type": "string",
"format": "hostname"
},
"example": [
"acme.co"
],
"nullable": true,
"description": "All of the company's domains"
},
"isGlobal": {
"type": "boolean",
"example": true,
"nullable": true,
"description": "Whether or not the company is org specific"
}
},
"description": "Company model"
}
CompanyData
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The company's unique identifier"
},
"name": {
"type": "string",
"example": "Acme",
"nullable": true,
"description": "The company's name"
},
"domain": {
"type": "string",
"format": "hostname",
"example": "acme.co",
"nullable": true,
"description": "The company's primary domain"
}
}
}
CompanyListEntry
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The list entry's unique identifier"
},
"type": {
"enum": [
"company",
"opportunity",
"person"
],
"type": "string",
"example": "company",
"nullable": true,
"description": "The entity type for this list entry"
},
"entity": {
"$ref": "#/components/schemas/Company",
"nullable": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The date that the list entry was created"
},
"creatorId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that created this list entry"
}
}
}
CompanyPaged
{
"type": "object",
"example": {
"data": [
{
"id": 1,
"name": "Acme",
"domain": "acme.co",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"domains": [
"acme.co"
],
"isGlobal": true
},
{
"id": 1,
"name": "Acme",
"domain": "acme.co",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"domains": [
"acme.co"
],
"isGlobal": true
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Company"
},
"description": "A page of Company results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "CompanyPaged model"
}
CompanyValue
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/CompanyData",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
CompanyWithListEntries
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The company's unique identifier"
},
"name": {
"type": "string",
"example": "Acme",
"nullable": true,
"description": "The company's name"
},
"domain": {
"type": "string",
"format": "hostname",
"example": "acme.co",
"nullable": true,
"description": "The company's primary domain"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Field"
},
"description": "The fields associated with the company"
},
"domains": {
"type": "array",
"items": {
"type": "string",
"format": "hostname"
},
"example": [
"acme.co"
],
"nullable": true,
"description": "All of the company's domains"
},
"isGlobal": {
"type": "boolean",
"example": true,
"nullable": true,
"description": "Whether or not the company is org specific"
},
"listEntries": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ListEntry"
},
"nullable": true,
"description": "The list entries that this company is connected to"
}
}
}
CompanyWithListEntriesPaged
{
"type": "object",
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/CompanyWithListEntries"
},
"description": "A page of CompanyWithListEntries results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
}
}
ConflictError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "conflict",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
DateValue
{
"type": "object",
"properties": {
"data": {
"type": "string",
"format": "date-time",
"nullable": true,
"description": "The value for a date"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
Dropdown
{
"type": "object",
"properties": {
"text": {
"type": "string",
"example": "first",
"nullable": true,
"description": "Dropdown item text"
},
"dropdownOptionId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "Dropdown item's unique identifier"
}
}
}
DropdownValue
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Dropdown",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
DropdownsValue
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Dropdown"
},
"nullable": true,
"description": "The value for many dropdown items"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
Email
{
"type": "object",
"properties": {
"cc": {
"$ref": "#/components/schemas/Attendee",
"nullable": true
},
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The email's unique identifier"
},
"to": {
"$ref": "#/components/schemas/Attendee",
"nullable": true
},
"from": {
"$ref": "#/components/schemas/Attendee",
"nullable": true
},
"type": {
"enum": [
"call",
"email",
"meeting",
"chat-message"
],
"type": "string",
"example": "meeting",
"nullable": true,
"description": "The type of interaction"
},
"sentAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The time the email was sent"
},
"subject": {
"type": "string",
"example": "Acme Upsell $10k",
"nullable": true,
"description": "The subject of the email"
}
}
}
EmptyMessageBodyError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "empty-message-body",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
Error
{
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/AuthenticationError"
},
{
"$ref": "#/components/schemas/AuthorizationError"
},
{
"$ref": "#/components/schemas/ConflictError"
},
{
"$ref": "#/components/schemas/MethodNotAllowedError"
},
{
"$ref": "#/components/schemas/NotFoundError"
},
{
"$ref": "#/components/schemas/ServerError"
},
{
"$ref": "#/components/schemas/ValidationError"
},
{
"$ref": "#/components/schemas/EmptyMessageBodyError"
},
{
"$ref": "#/components/schemas/InvalidAcceptHeaderError"
},
{
"$ref": "#/components/schemas/InvalidMessageBodyError"
},
{
"$ref": "#/components/schemas/InvalidVersionHeaderError"
},
{
"$ref": "#/components/schemas/TooManyMultipartFilesError"
},
{
"$ref": "#/components/schemas/RateLimitError"
},
{
"$ref": "#/components/schemas/GenericError"
}
],
"properties": {
"code": {
"type": "string",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
},
"discriminator": {
"mapping": {
"error": "#/components/schemas/GenericError",
"server": "#/components/schemas/ServerError",
"conflict": "#/components/schemas/ConflictError",
"not-found": "#/components/schemas/NotFoundError",
"rate-limit": "#/components/schemas/RateLimitError",
"validation": "#/components/schemas/ValidationError",
"authorization": "#/components/schemas/AuthorizationError",
"authentication": "#/components/schemas/AuthenticationError",
"empty-message-body": "#/components/schemas/EmptyMessageBodyError",
"method-not-allowed": "#/components/schemas/MethodNotAllowedError",
"invalid-message-body": "#/components/schemas/InvalidMessageBodyError",
"invalid-accept-header": "#/components/schemas/InvalidAcceptHeaderError",
"invalid-version-header": "#/components/schemas/InvalidVersionHeaderError",
"too-many-multipart-files": "#/components/schemas/TooManyMultipartFilesError"
},
"propertyName": "code"
}
}
Errors
{
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Error"
},
"nullable": true,
"description": "Errors"
}
}
}
Field
{
"type": "object",
"example": {
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
"properties": {
"id": {
"type": "string",
"example": "affinity-data-location",
"nullable": true,
"description": "The field's unique identifier"
},
"name": {
"type": "string",
"example": "Location",
"nullable": true,
"description": "The field's name"
},
"type": {
"enum": [
"enriched",
"global",
"list",
"relationship-intelligence"
],
"type": "string",
"example": "enriched",
"nullable": true,
"description": "The field's type"
},
"value": {
"$ref": "#/components/schemas/FieldValue",
"nullable": true
},
"enrichmentSource": {
"enum": [
"affinity-data",
"dealroom"
],
"type": "string",
"example": "affinity-data",
"nullable": true,
"description": "The source of the data in this Field (if it is enriched)"
}
}
}
FieldMetadata
{
"type": "object",
"example": {
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"valueType": "location",
"enrichmentSource": "affinity-data"
},
"properties": {
"id": {
"type": "string",
"example": "affinity-data-location",
"nullable": true,
"description": "The field's unique identifier"
},
"name": {
"type": "string",
"example": "Location",
"nullable": true,
"description": "The field's name"
},
"type": {
"enum": [
"enriched",
"global",
"list",
"relationship-intelligence"
],
"type": "string",
"example": "enriched",
"nullable": true,
"description": "The field's type"
},
"valueType": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of the data in this Field"
},
"enrichmentSource": {
"enum": [
"affinity-data",
"dealroom"
],
"type": "string",
"example": "affinity-data",
"nullable": true,
"description": "The source of the data in this Field (if it is enriched)"
}
}
}
FieldMetadataPaged
{
"type": "object",
"example": {
"data": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"valueType": "location",
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"valueType": "location",
"enrichmentSource": "affinity-data"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/FieldMetadata"
},
"description": "A page of FieldMetadata results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "FieldMetadataPaged model"
}
FieldValue
{
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/PersonValue"
},
{
"$ref": "#/components/schemas/PersonsValue"
},
{
"$ref": "#/components/schemas/CompanyValue"
},
{
"$ref": "#/components/schemas/CompaniesValue"
},
{
"$ref": "#/components/schemas/TextValue"
},
{
"$ref": "#/components/schemas/TextsValue"
},
{
"$ref": "#/components/schemas/LocationValue"
},
{
"$ref": "#/components/schemas/LocationsValue"
},
{
"$ref": "#/components/schemas/FloatValue"
},
{
"$ref": "#/components/schemas/FloatsValue"
},
{
"$ref": "#/components/schemas/DateValue"
},
{
"$ref": "#/components/schemas/TextValue"
},
{
"$ref": "#/components/schemas/RankedDropdownValue"
},
{
"$ref": "#/components/schemas/DropdownValue"
},
{
"$ref": "#/components/schemas/DropdownsValue"
},
{
"$ref": "#/components/schemas/FormulaValue"
},
{
"$ref": "#/components/schemas/InteractionValue"
}
],
"example": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"properties": {
"data": {
"$ref": "#/components/schemas/Location",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
},
"discriminator": {
"mapping": {
"text": "#/components/schemas/TextValue",
"number": "#/components/schemas/FloatValue",
"person": "#/components/schemas/PersonValue",
"company": "#/components/schemas/CompanyValue",
"datetime": "#/components/schemas/DateValue",
"dropdown": "#/components/schemas/DropdownValue",
"location": "#/components/schemas/LocationValue",
"interaction": "#/components/schemas/InteractionValue",
"number-multi": "#/components/schemas/FloatsValue",
"person-multi": "#/components/schemas/PersonsValue",
"company-multi": "#/components/schemas/CompaniesValue",
"dropdown-multi": "#/components/schemas/DropdownsValue",
"formula-number": "#/components/schemas/FormulaValue",
"location-multi": "#/components/schemas/LocationsValue",
"filterable-text": "#/components/schemas/TextValue",
"ranked-dropdown": "#/components/schemas/RankedDropdownValue",
"filterable-text-multi": "#/components/schemas/TextsValue"
},
"propertyName": "type"
}
}
FloatValue
{
"type": "object",
"properties": {
"data": {
"type": "number",
"format": "float",
"nullable": true,
"description": "The value for a number"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
FloatsValue
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "number",
"format": "float"
},
"nullable": true,
"description": "The value for many numbers"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
FormulaNumber
{
"type": "object",
"properties": {
"calculatedValue": {
"type": "number",
"format": "float",
"nullable": true,
"description": "Calculated value"
}
}
}
FormulaValue
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/FormulaNumber",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
GenericError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
Grant
{
"type": "object",
"example": {
"type": "api-key",
"scopes": [
"api"
],
"createdAt": "2023-01-01 00:00:00.000000000 Z"
},
"properties": {
"type": {
"enum": [
"api-key"
],
"type": "string",
"example": "api-key",
"nullable": true,
"description": "The type of grant used to authenticate"
},
"scopes": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"api"
],
"nullable": true,
"description": "The scopes available to the current grant"
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "When the grant was created"
}
}
}
Interaction
{
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/ChatMessage"
},
{
"$ref": "#/components/schemas/Email"
},
{
"$ref": "#/components/schemas/Meeting"
},
{
"$ref": "#/components/schemas/PhoneCall"
}
],
"properties": {
"type": {
"enum": [
"call",
"email",
"meeting",
"chat-message"
],
"type": "string",
"example": "meeting",
"nullable": true,
"description": "The type of interaction"
}
},
"discriminator": {
"mapping": {
"call": "#/components/schemas/PhoneCall",
"email": "#/components/schemas/Email",
"meeting": "#/components/schemas/Meeting",
"chat-message": "#/components/schemas/ChatMessage"
},
"propertyName": "type"
}
}
InteractionValue
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Interaction",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
InvalidAcceptHeaderError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "invalid-accept-header",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
InvalidMessageBodyError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "invalid-message-body",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
InvalidVersionHeaderError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "invalid-version-header",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
List
{
"type": "object",
"example": {
"id": 1,
"name": "All companies",
"ownerId": 1,
"isPublic": false,
"creatorId": 1
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The unique identifier for the list"
},
"name": {
"type": "string",
"example": "All companies",
"nullable": true,
"description": "The name of the list"
},
"ownerId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that owns this list"
},
"isPublic": {
"type": "boolean",
"example": false,
"nullable": true,
"description": "Whether or not the list is public"
},
"creatorId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that created this list"
}
}
}
ListEntry
{
"type": "object",
"example": {
"id": 1,
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"listId": 1,
"createdAt": "2023-01-01 00:00:00.000000000 Z",
"creatorId": 1
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The list entry's unique identifier"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Field"
},
"nullable": true,
"description": "The fields associated with the list entry"
},
"listId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the list that this list entry belongs to"
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The date that the list entry was created"
},
"creatorId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that created this list entry"
}
}
}
ListEntryPaged
{
"type": "object",
"example": {
"data": [
{
"id": 1,
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"listId": 1,
"createdAt": "2023-01-01 00:00:00.000000000 Z",
"creatorId": 1
},
{
"id": 1,
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"listId": 1,
"createdAt": "2023-01-01 00:00:00.000000000 Z",
"creatorId": 1
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ListEntry"
},
"description": "A page of ListEntry results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "ListEntryPaged model"
}
ListEntryWithEntity
{
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/CompanyListEntry"
},
{
"$ref": "#/components/schemas/OpportunityListEntry"
},
{
"$ref": "#/components/schemas/PersonListEntry"
}
],
"example": {
"id": 1,
"type": "company",
"entity": {
"id": 1,
"name": "Acme",
"domain": "acme.co",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"domains": [
"acme.co"
],
"isGlobal": true
},
"createdAt": "2023-01-01 00:00:00.000000000 Z",
"creatorId": 1
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The list entry's unique identifier"
},
"type": {
"enum": [
"company",
"opportunity",
"person"
],
"type": "string",
"example": "company",
"nullable": true,
"description": "The entity type for this list entry"
},
"entity": {
"$ref": "#/components/schemas/Company",
"nullable": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The date that the list entry was created"
},
"creatorId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that created this list entry"
}
},
"discriminator": {
"mapping": {
"person": "#/components/schemas/PersonListEntry",
"company": "#/components/schemas/CompanyListEntry",
"opportunity": "#/components/schemas/OpportunityListEntry"
},
"propertyName": "type"
}
}
ListEntryWithEntityPaged
{
"type": "object",
"example": {
"data": [
{
"id": 1,
"type": "company",
"entity": {
"id": 1,
"name": "Acme",
"domain": "acme.co",
"fields": [
{
"id": "affinity-data-location",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"domains": [
"acme.co"
],
"isGlobal": true
},
"createdAt": "2023-01-01 00:00:00.000000000 Z",
"creatorId": 1
},
{
"id": 1,
"type": "company",
"entity": {
"id": 1,
"name": "Acme",
"domain": "acme.co",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"domains": [
"acme.co"
],
"isGlobal": true
},
"createdAt": "2023-01-01 00:00:00.000000000 Z",
"creatorId": 1
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ListEntryWithEntity"
},
"nullable": true,
"description": "A page of ListEntryWithEntity results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "ListEntryWithEntityPaged model"
}
ListPaged
{
"type": "object",
"example": {
"data": [
{
"id": 1,
"name": "All companies",
"ownerId": 1,
"isPublic": false,
"creatorId": 1
},
{
"id": 1,
"name": "All companies",
"ownerId": 1,
"isPublic": false,
"creatorId": 1
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/List"
},
"description": "A page of List results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "ListPaged model"
}
ListWithType
{
"type": "object",
"example": {
"id": 1,
"name": "All companies",
"type": "company",
"ownerId": 1,
"isPublic": false,
"creatorId": 1
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The unique identifier for the list"
},
"name": {
"type": "string",
"example": "All companies",
"nullable": true,
"description": "The name of the list"
},
"type": {
"enum": [
"company",
"opportunity",
"person"
],
"type": "string",
"example": "company",
"nullable": true,
"description": "The entity type for this list"
},
"ownerId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that owns this list"
},
"isPublic": {
"type": "boolean",
"example": false,
"nullable": true,
"description": "Whether or not the list is public"
},
"creatorId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that created this list"
}
},
"description": "ListWithType model"
}
ListWithTypePaged
{
"type": "object",
"example": {
"data": [
{
"id": 1,
"name": "All companies",
"type": "company",
"ownerId": 1,
"isPublic": false,
"creatorId": 1
},
{
"id": 1,
"name": "All companies",
"type": "company",
"ownerId": 1,
"isPublic": false,
"creatorId": 1
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ListWithType"
},
"description": "A page of ListWithType results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "ListWithTypePaged model"
}
Location
{
"type": "object",
"example": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"properties": {
"city": {
"type": "string",
"example": "San Francisco",
"nullable": true,
"description": "City"
},
"state": {
"type": "string",
"example": "California",
"nullable": true,
"description": "State"
},
"country": {
"type": "string",
"example": "United States",
"nullable": true,
"description": "Country"
},
"continent": {
"type": "string",
"example": "North America",
"nullable": true,
"description": "Continent"
},
"streetAddress": {
"type": "string",
"example": "170 Columbus Ave",
"nullable": true,
"description": "Street address"
}
}
}
LocationValue
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/Location",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
LocationsValue
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Location"
},
"nullable": true,
"description": "The values for many locations"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
Meeting
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The meeting's unique identifier"
},
"type": {
"enum": [
"call",
"email",
"meeting",
"chat-message"
],
"type": "string",
"example": "meeting",
"nullable": true,
"description": "The type of interaction"
},
"title": {
"type": "string",
"example": "Acme Upsell $10k",
"nullable": true,
"description": "The meeting's title"
},
"allDay": {
"type": "boolean",
"example": false,
"nullable": true,
"description": "Whether the meeting is an all-day event"
},
"endTime": {
"type": "string",
"format": "date-time",
"example": "2023-02-03 05:00:00.000000000 Z",
"nullable": true,
"description": "The meeting end time"
},
"attendees": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Attendee"
},
"nullable": true,
"description": "People attending the meeting"
},
"startTime": {
"type": "string",
"format": "date-time",
"example": "2023-02-03 04:00:00.000000000 Z",
"nullable": true,
"description": "The meeting start time"
}
}
}
MethodNotAllowedError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "method-not-allowed",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
NotFoundError
{
"type": "object",
"example": {
"code": "not-found",
"message": "🚨 Error! Sound the alarm! 🚨"
},
"properties": {
"code": {
"type": "string",
"example": "not-found",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
NotFoundErrors
{
"type": "object",
"example": {
"errors": [
{
"code": "not-found",
"message": "🚨 Error! Sound the alarm! 🚨"
},
{
"code": "not-found",
"message": "🚨 Error! Sound the alarm! 🚨"
}
]
},
"properties": {
"errors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotFoundError"
},
"nullable": true,
"description": "NotFoundError errors"
}
},
"description": "NotFoundErrors model"
}
Opportunity
{
"type": "object",
"example": {
"id": 1,
"name": "Acme Upsell $10k",
"listId": 1
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The unique identifier for the opportunity"
},
"name": {
"type": "string",
"example": "Acme Upsell $10k",
"nullable": true,
"description": "The name of the opportunity"
},
"listId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the list that the opportunity belongs to"
}
},
"description": "Opportunity model"
}
OpportunityListEntry
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The list entry's unique identifier"
},
"type": {
"enum": [
"company",
"opportunity",
"person"
],
"type": "string",
"example": "company",
"nullable": true,
"description": "The entity type for this list entry"
},
"entity": {
"$ref": "#/components/schemas/OpportunityWithFields",
"nullable": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The date that the list entry was created"
},
"creatorId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that created this list entry"
}
}
}
OpportunityPaged
{
"type": "object",
"example": {
"data": [
{
"id": 1,
"name": "Acme Upsell $10k",
"listId": 1
},
{
"id": 1,
"name": "Acme Upsell $10k",
"listId": 1
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Opportunity"
},
"description": "A page of Opportunity results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "OpportunityPaged model"
}
OpportunityWithFields
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The unique identifier for the opportunity"
},
"name": {
"type": "string",
"example": "Acme Upsell $10k",
"nullable": true,
"description": "The name of the opportunity"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Field"
},
"description": "The fields associated with the opportunity"
},
"listId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the list that the opportunity belongs to"
}
}
}
Pagination
{
"type": "object",
"example": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
},
"properties": {
"nextUrl": {
"type": "string",
"format": "url",
"example": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"nullable": true,
"description": "URL for the next page"
},
"prevUrl": {
"type": "string",
"format": "url",
"example": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw",
"nullable": true,
"description": "URL for the previous page"
}
}
}
Person
{
"type": "object",
"example": {
"id": 1,
"type": "internal",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"lastName": "Doe",
"firstName": "Jane",
"emailAddresses": [
"jane.doe@acme.co",
"janedoe@gmail.com"
],
"primaryEmailAddress": "jane.doe@acme.co"
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The persons's unique identifier"
},
"type": {
"enum": [
"internal",
"external"
],
"type": "string",
"example": "internal",
"nullable": true,
"description": "The person's type"
},
"fields": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Field"
},
"description": "The fields associated with the person"
},
"lastName": {
"type": "string",
"example": "Doe",
"nullable": true,
"description": "The person's last name"
},
"firstName": {
"type": "string",
"example": "Jane",
"nullable": true,
"description": "The person's first name"
},
"emailAddresses": {
"type": "array",
"items": {
"type": "string",
"format": "email"
},
"example": [
"jane.doe@acme.co",
"janedoe@gmail.com"
],
"nullable": true,
"description": "All of the person's email addresses"
},
"primaryEmailAddress": {
"type": "string",
"format": "email",
"example": "jane.doe@acme.co",
"nullable": true,
"description": "The person's primary email address"
}
},
"description": "Person model"
}
PersonData
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The persons's unique identifier"
},
"type": {
"enum": [
"internal",
"external",
"collaborator"
],
"type": "string",
"example": "internal",
"nullable": true,
"description": "The person's type"
},
"lastName": {
"type": "string",
"example": "Doe",
"nullable": true,
"description": "The person's last name"
},
"firstName": {
"type": "string",
"example": "Jane",
"nullable": true,
"description": "The person's first name"
},
"primaryEmailAddress": {
"type": "string",
"format": "email",
"example": "jane.doe@acme.co",
"nullable": true,
"description": "The person's primary email address"
}
}
}
PersonListEntry
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The list entry's unique identifier"
},
"type": {
"enum": [
"company",
"opportunity",
"person"
],
"type": "string",
"example": "company",
"nullable": true,
"description": "The entity type for this list entry"
},
"entity": {
"$ref": "#/components/schemas/Person",
"nullable": true
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The date that the list entry was created"
},
"creatorId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The ID of the user that created this list entry"
}
}
}
PersonPaged
{
"type": "object",
"example": {
"data": [
{
"id": 1,
"type": "internal",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"lastName": "Doe",
"firstName": "Jane",
"emailAddresses": [
"jane.doe@acme.co",
"janedoe@gmail.com"
],
"primaryEmailAddress": "jane.doe@acme.co"
},
{
"id": 1,
"type": "internal",
"fields": [
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
},
{
"id": "affinity-data-locationX",
"name": "Location",
"type": "enriched",
"value": {
"data": {
"city": "San Francisco",
"state": "California",
"country": "United States",
"continent": "North America",
"streetAddress": "170 Columbus Ave"
},
"type": "location"
},
"enrichmentSource": "affinity-data"
}
],
"lastName": "Doe",
"firstName": "Jane",
"emailAddresses": [
"jane.doe@acme.co",
"janedoe@gmail.com"
],
"primaryEmailAddress": "jane.doe@acme.co"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Person"
},
"description": "A page of Person results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "PersonPaged model"
}
PersonValue
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/PersonData",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
PersonsValue
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PersonData"
},
"nullable": true,
"description": "The values for many persons"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
PhoneCall
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The phon_call's unique identifier"
},
"type": {
"enum": [
"call",
"email",
"meeting",
"chat-message"
],
"type": "string",
"example": "meeting",
"nullable": true,
"description": "The type of interaction"
},
"attendees": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Attendee"
},
"nullable": true,
"description": "People attending the call"
},
"startTime": {
"type": "string",
"format": "date-time",
"example": "2023-02-03 04:00:00.000000000 Z",
"nullable": true,
"description": "The call start time"
}
}
}
RankedDropdown
{
"type": "object",
"properties": {
"rank": {
"type": "integer",
"format": "int64",
"example": 0,
"nullable": true,
"description": "Dropdown item rank"
},
"text": {
"type": "string",
"example": "first",
"nullable": true,
"description": "Dropdown item text"
},
"color": {
"type": "string",
"example": "white",
"nullable": true,
"description": "Dropdown item color"
},
"dropdownOptionId": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "Dropdown item's unique identifier"
}
}
}
RankedDropdownValue
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/RankedDropdown",
"nullable": true
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
RateLimitError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "rate-limit",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
SavedView
{
"type": "object",
"example": {
"id": 28,
"name": "my interesting companies",
"type": "sheet",
"createdAt": "2023-01-01 00:00:00.000000000 Z"
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 28,
"nullable": true,
"description": "The saved view's unique identifier"
},
"name": {
"type": "string",
"example": "my interesting companies",
"nullable": true,
"description": "The saved view's name"
},
"type": {
"enum": [
"sheet",
"board",
"dashboard"
],
"type": "string",
"example": "sheet",
"nullable": true,
"description": "The type for this saved view"
},
"createdAt": {
"type": "string",
"format": "date-time",
"example": "2023-01-01 00:00:00.000000000 Z",
"nullable": true,
"description": "The date that the saved view was created"
}
},
"description": "SavedView model"
}
SavedViewPaged
{
"type": "object",
"example": {
"data": [
{
"id": 28,
"name": "my interesting companies",
"type": "sheet",
"createdAt": "2023-01-01 00:00:00.000000000 Z"
},
{
"id": 28,
"name": "my interesting companies",
"type": "sheet",
"createdAt": "2023-01-01 00:00:00.000000000 Z"
}
],
"pagination": {
"nextUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgIGFmdGVyOjo6NA",
"prevUrl": "https://api.affinity.co/v2/foo?cursor=ICAgICAgYmVmb3JlOjo6Nw"
}
},
"required": [
"data",
"pagination"
],
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/SavedView"
},
"description": "A page of SavedView results"
},
"pagination": {
"$ref": "#/components/schemas/Pagination"
}
},
"description": "SavedViewPaged model"
}
ServerError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "server",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
Tenant
{
"type": "object",
"example": {
"id": 1,
"name": "Contoso Ltd.",
"subdomain": "contoso"
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The tenant's unique identifier"
},
"name": {
"type": "string",
"example": "Contoso Ltd.",
"nullable": true,
"description": "The name of the tenant"
},
"subdomain": {
"type": "string",
"format": "hostname",
"example": "contoso",
"nullable": true,
"description": "The tenant's subdomain under affinity.co"
}
}
}
TextValue
{
"type": "object",
"properties": {
"data": {
"type": "string",
"nullable": true,
"description": "The value for a string"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
TextsValue
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "string"
},
"nullable": true,
"description": "The value for many strings"
},
"type": {
"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"
],
"type": "string",
"example": "location",
"nullable": true,
"description": "The type of value"
}
}
}
TooManyMultipartFilesError
{
"type": "object",
"properties": {
"code": {
"type": "string",
"example": "too-many-multipart-files",
"nullable": true,
"description": "Error code"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
User
{
"type": "object",
"example": {
"id": 1,
"lastName": "Smith",
"firstName": "John",
"emailAddress": "john.smith@contoso.com"
},
"properties": {
"id": {
"type": "integer",
"format": "int64",
"example": 1,
"nullable": true,
"description": "The user's unique identifier"
},
"lastName": {
"type": "string",
"example": "Smith",
"nullable": true,
"description": "The user's last name"
},
"firstName": {
"type": "string",
"example": "John",
"nullable": true,
"description": "The user's first name"
},
"emailAddress": {
"type": "string",
"format": "email",
"example": "john.smith@contoso.com",
"nullable": true,
"description": "The user's email address"
}
}
}
ValidationError
{
"type": "object",
"example": {
"code": "validation",
"param": "limit",
"message": "🚨 Error! Sound the alarm! 🚨"
},
"properties": {
"code": {
"type": "string",
"example": "validation",
"nullable": true,
"description": "Error code"
},
"param": {
"type": "string",
"example": "limit",
"nullable": true,
"description": "Param the error refers to"
},
"message": {
"type": "string",
"example": "🚨 Error! Sound the alarm! 🚨",
"nullable": true,
"description": "Error message"
}
}
}
ValidationErrors
{
"type": "object",
"example": {
"errors": [
{
"code": "validation",
"param": "limit",
"message": "🚨 Error! Sound the alarm! 🚨"
},
{
"code": "validation",
"param": "limit",
"message": "🚨 Error! Sound the alarm! 🚨"
}
]
},
"properties": {
"errors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"nullable": true,
"description": "ValidationError errors"
}
},
"description": "ValidationErrors model"
}
WhoAmI
{
"type": "object",
"example": {
"user": {
"id": 1,
"lastName": "Smith",
"firstName": "John",
"emailAddress": "john.smith@contoso.com"
},
"grant": {
"type": "api-key",
"scopes": [
"api"
],
"createdAt": "2023-01-01 00:00:00.000000000 Z"
},
"tenant": {
"id": 1,
"name": "Contoso Ltd.",
"subdomain": "contoso"
}
},
"properties": {
"user": {
"$ref": "#/components/schemas/User",
"nullable": true
},
"grant": {
"$ref": "#/components/schemas/Grant",
"nullable": true
},
"tenant": {
"$ref": "#/components/schemas/Tenant",
"nullable": true
}
},
"description": "WhoAmI model"
}