SDK v1.9.0
Highlights
Accessing a company or person that was merged now raises a dedicated MergedEntityError (or CompanyMergedError/PersonMergedError) instead of a generic ValidationError. The exception provides structured source_id and target_id attributes, so you can programmatically follow merges without regex-parsing error messages. The CLI also surfaces this as a distinct entity_merged error type with structured JSON details.
What's New
MergedEntityError,CompanyMergedError,PersonMergedErrorexception classes — raised on 422 responses indicating an entity was merged into another- CLI:
entity_mergederror type withsourceId,targetId,entityTypein JSON error details (exit code 4)
Quick Install
SDK only:
pip install affinity-sdkSDK + CLI:
pipx install "affinity-sdk[cli]"MCP Server for Claude Desktop (easiest - MCPB bundle):
- Install CLI:
pipx install "affinity-sdk[cli]" - (Optional) Pre-configure API key:
xaffinity config setup-key- If skipped, Claude Desktop will prompt for your API key during install
- Install xaffinity MCP in Claude Desktop (download and double-click)
Other MCP clients (Cursor, Windsurf, VS Code, etc.) require manual configuration - see MCP docs.