object 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"
}
object 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"
}
object 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"
    }
  }
}
object 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"
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
}
object 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"
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
    }
  }
}
object 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"
}
object 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"
}