# CRM

## CRM sync status

> Get CRM connector status — contact, company, and deal counts, sync health, last sync time. Parallel to /fhir/status.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmStatusResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"connector_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connector Type"},"data_source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Source Id"},"contact_count":{"type":"integer","title":"Contact Count","default":0},"company_count":{"type":"integer","title":"Company Count","default":0},"deal_count":{"type":"integer","title":"Deal Count","default":0},"last_sync_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync At"},"last_sync_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync Status"},"sync_healthy":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sync Healthy"},"sync_failure_count":{"type":"integer","title":"Sync Failure Count","default":0}},"type":"object","required":["configured"],"title":"CrmStatusResponse"}}},"paths":{"/v1/{workspace_id}/crm/status":{"get":{"tags":["CRM"],"summary":"CRM sync status","description":"Get CRM connector status — contact, company, and deal counts, sync health, last sync time. Parallel to /fhir/status.","operationId":"crm-status","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmStatusResponse"}}}}}}}}}
```

## Search CRM contacts

> Search contacts from CRM sources. Filter by name, email, or phone. CRM source is auto-detected from workspace data source config. Paginated — use offset for subsequent pages.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmContactSearchResponse":{"properties":{"contacts":{"items":{"$ref":"#/components/schemas/CrmContactResponse"},"type":"array","title":"Contacts"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["contacts","total"],"title":"CrmContactSearchResponse"},"CrmContactResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"hubspot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"lifecycle_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle Stage"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"event_count":{"type":"integer","title":"Event Count","default":0},"confidence":{"type":"number","title":"Confidence","default":1},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["entity_id"],"title":"CrmContactResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/crm/contacts":{"get":{"tags":["CRM"],"summary":"Search CRM contacts","description":"Search contacts from CRM sources. Filter by name, email, or phone. CRM source is auto-detected from workspace data source config. Paginated — use offset for subsequent pages.","operationId":"crm-contact-search","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Q"},"description":"Search by name"},{"name":"email","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by email","title":"Email"},"description":"Search by email"},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by phone","title":"Phone"},"description":"Search by phone"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmContactSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get CRM contact

> Get a single CRM contact with full projected state including clinical data, operational fields, external IDs, and any cross-source merged entities (same\_as links).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmContactDetailResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"hubspot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"lifecycle_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle Stage"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"event_count":{"type":"integer","title":"Event Count","default":0},"confidence":{"type":"number","title":"Confidence","default":1},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"clinical":{"additionalProperties":true,"type":"object","title":"Clinical"},"operational":{"additionalProperties":true,"type":"object","title":"Operational"},"external_ids":{"additionalProperties":true,"type":"object","title":"External Ids"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"merged_with":{"items":{"$ref":"#/components/schemas/CrmContactResponse"},"type":"array","title":"Merged With"}},"type":"object","required":["entity_id"],"title":"CrmContactDetailResponse","description":"Single contact with full clinical state + merged entities."},"CrmContactResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"hubspot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Id"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"lifecycle_stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle Stage"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"event_count":{"type":"integer","title":"Event Count","default":0},"confidence":{"type":"number","title":"Confidence","default":1},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["entity_id"],"title":"CrmContactResponse"}}},"paths":{"/v1/{workspace_id}/crm/contacts/{contact_id}":{"get":{"tags":["CRM"],"summary":"Get CRM contact","description":"Get a single CRM contact with full projected state including clinical data, operational fields, external IDs, and any cross-source merged entities (same_as links).","operationId":"crm-contact-detail","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmContactDetailResponse"}}}},"404":{"description":"Contact not found."},"422":{"description":"Invalid contact ID format."}}}}}}
```

## Contact activity timeline

> Activity timeline for a CRM contact — calls, meetings, notes, emails, syncs. Includes direction (inbound/outbound) and source system attribution. Paginated.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmActivityTimelineResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"activities":{"items":{"$ref":"#/components/schemas/CrmActivityItem"},"type":"array","title":"Activities"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false}},"type":"object","required":["entity_id","activities","total"],"title":"CrmActivityTimelineResponse"},"CrmActivityItem":{"properties":{"id":{"type":"string","title":"Id"},"activity_type":{"type":"string","title":"Activity Type"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"source":{"type":"string","title":"Source","default":"unknown"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"confidence":{"type":"number","title":"Confidence","default":1},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At"}},"type":"object","required":["id","activity_type"],"title":"CrmActivityItem"}}},"paths":{"/v1/{workspace_id}/crm/contacts/{contact_id}/timeline":{"get":{"tags":["CRM"],"summary":"Contact activity timeline","description":"Activity timeline for a CRM contact — calls, meetings, notes, emails, syncs. Includes direction (inbound/outbound) and source system attribution. Paginated.","operationId":"crm-contact-timeline","parameters":[{"name":"contact_id","in":"path","required":true,"schema":{"type":"string","title":"Contact Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmActivityTimelineResponse"}}}},"404":{"description":"Contact not found."},"422":{"description":"Invalid contact ID format."}}}}}}
```

## Search CRM companies

> Search companies from CRM sources. Filter by name. Paginated.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmCompanySearchResponse":{"properties":{"companies":{"items":{"$ref":"#/components/schemas/CrmCompanyResponse"},"type":"array","title":"Companies"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["companies","total"],"title":"CrmCompanySearchResponse"},"CrmCompanyResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"hubspot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["entity_id"],"title":"CrmCompanyResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/crm/companies":{"get":{"tags":["CRM"],"summary":"Search CRM companies","description":"Search companies from CRM sources. Filter by name. Paginated.","operationId":"crm-company-search","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Q"},"description":"Search by name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCompanySearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get CRM company

> Get a single CRM company with full state.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmCompanyResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"hubspot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["entity_id"],"title":"CrmCompanyResponse"}}},"paths":{"/v1/{workspace_id}/crm/companies/{company_id}":{"get":{"tags":["CRM"],"summary":"Get CRM company","description":"Get a single CRM company with full state.","operationId":"crm-company-detail","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmCompanyResponse"}}}},"404":{"description":"Company not found."},"422":{"description":"Invalid company ID format."}}}}}}
```

## Deal pipeline aggregation

> Deals grouped by pipeline stage with aggregate value per stage. Powers the deal pipeline funnel chart.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}}},"paths":{"/v1/{workspace_id}/crm/deals/pipeline":{"get":{"tags":["CRM"],"summary":"Deal pipeline aggregation","description":"Deals grouped by pipeline stage with aggregate value per stage. Powers the deal pipeline funnel chart.","operationId":"crm-deal-pipeline","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Crm-Deal-Pipeline"}}}}}}}}}
```

## Search CRM deals

> Search deals from CRM sources. Paginated.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmDealSearchResponse":{"properties":{"deals":{"items":{"$ref":"#/components/schemas/CrmDealResponse"},"type":"array","title":"Deals"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["deals","total"],"title":"CrmDealSearchResponse"},"CrmDealResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"hubspot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"close_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Date"},"pipeline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline"},"deal_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Type"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["entity_id"],"title":"CrmDealResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}},"paths":{"/v1/{workspace_id}/crm/deals":{"get":{"tags":["CRM"],"summary":"Search CRM deals","description":"Search deals from CRM sources. Paginated.","operationId":"crm-deal-search","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Q"},"description":"Search by name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDealSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get CRM deal

> Get a single CRM deal with full state.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}},"schemas":{"CrmDealResponse":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"hubspot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hubspot Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"stage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"close_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Date"},"pipeline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pipeline"},"deal_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deal Type"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["entity_id"],"title":"CrmDealResponse"}}},"paths":{"/v1/{workspace_id}/crm/deals/{deal_id}":{"get":{"tags":["CRM"],"summary":"Get CRM deal","description":"Get a single CRM deal with full state.","operationId":"crm-deal-detail","parameters":[{"name":"deal_id","in":"path","required":true,"schema":{"type":"string","title":"Deal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmDealResponse"}}}},"404":{"description":"Deal not found."},"422":{"description":"Invalid deal ID format."}}}}}}
```
