{"openapi":"3.1.0","info":{"title":"Memir API","version":"1"},"paths":{"/api/v1/leads":{"get":{"tags":["leads"],"summary":"List leads","description":"The CRM's leads, filtered, searched and sorted as on the CRM page.\n\nA filter that takes several values is repeated: `?status=qualified&status=negotiation`.\nPage with `skip` and `limit` (at most 100); `total` counts every match.","operationId":"list_leads_api_v1_leads_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"description":"Free text","title":"Q"},"description":"Free text"},{"name":"status","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^(new|contacted|discarded|qualified|negotiation|customer|lost|c_[0-9a-f]{8}|discarded:(no_reply|not_interested|do_not_contact|other))$"},"maxItems":100,"description":"Pipeline status, or discarded:<no_reply|not_interested|do_not_contact|other>","title":"Status"},"description":"Pipeline status, or discarded:<no_reply|not_interested|do_not_contact|other>"},{"name":"industry","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"Sector, as written on the lead","title":"Industry"},"description":"Sector, as written on the lead"},{"name":"city","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"title":"City"}},{"name":"country","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"ISO 3166-1 alpha-2 code","title":"Country"},"description":"ISO 3166-1 alpha-2 code"},{"name":"employees","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"Size band, e.g. \"11-50\"","title":"Employees"},"description":"Size band, e.g. \"11-50\""},{"name":"revenue_verdict","in":"query","required":false,"schema":{"type":"array","items":{"anyOf":[{"enum":["ok","between","not_found"],"type":"string"},{"const":"none","type":"string"}]},"maxItems":4,"description":"Verified revenue status. Use 'none' for unchecked leads.","title":"Revenue Verdict"},"description":"Verified revenue status. Use 'none' for unchecked leads."},{"name":"source","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"Where the lead came from","title":"Source"},"description":"Where the lead came from"},{"name":"owner_user_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":36},"maxItems":100,"description":"Assigned colleague's user id","title":"Owner User Id"},"description":"Assigned colleague's user id"},{"name":"last_contact","in":"query","required":false,"schema":{"type":"array","items":{"enum":["never","7d","30d","older"],"type":"string"},"maxItems":100,"description":"When it was last written to","title":"Last Contact"},"description":"When it was last written to"},{"name":"activity","in":"query","required":false,"schema":{"type":"array","items":{"enum":["replied","failed","draft","overdue","today","queued","scheduled","proposals","stale","none"],"type":"string"},"maxItems":100,"description":"Mail state: a reply, a draft waiting, a failed send","title":"Activity"},"description":"Mail state: a reply, a draft waiting, a failed send"},{"name":"segment","in":"query","required":false,"schema":{"anyOf":[{"enum":["mine","planned","memir","new","idle"],"type":"string"},{"type":"null"}],"description":"Whose move it is","title":"Segment"},"description":"Whose move it is"},{"name":"reach","in":"query","required":false,"schema":{"type":"array","items":{"enum":["email","phone","contact","linkedin"],"type":"string"},"maxItems":100,"description":"How it can be reached","title":"Reach"},"description":"How it can be reached"},{"name":"field","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"A company field's value as \"<field_id>:<option_id|true|false|__none__>\"","title":"Field"},"description":"A company field's value as \"<field_id>:<option_id|true|false|__none__>\""},{"name":"created_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or after this day","title":"Created From"},"description":"Created on or after this day"},{"name":"created_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or before this day","title":"Created To"},"description":"Created on or before this day"},{"name":"period_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"First day of a period: every lead still in play, plus the won, lost and discarded ones that moved in it. Goes with period_to","title":"Period From"},"description":"First day of a period: every lead still in play, plus the won, lost and discarded ones that moved in it. Goes with period_to"},{"name":"period_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Last day of the period, included","title":"Period To"},"description":"Last day of the period, included"},{"name":"mine","in":"query","required":false,"schema":{"type":"boolean","description":"Only leads assigned to me","default":false,"title":"Mine"},"description":"Only leads assigned to me"},{"name":"list_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"One contact list's members, in the CRM or not","title":"List Id"},"description":"One contact list's members, in the CRM or not"},{"name":"searches","in":"query","required":false,"schema":{"type":"boolean","description":"What my customer searches found: members of my lists an automation fills","default":false,"title":"Searches"},"description":"What my customer searches found: members of my lists an automation fills"},{"name":"sort","in":"query","required":false,"schema":{"enum":["created_at","name","industry","location","employees","status","owner","next_action_at","last_contact_at","pipeline_value"],"type":"string","description":"Column to sort by","default":"created_at","title":"Sort"},"description":"Column to sort by"},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Order"}},{"name":"open_deals_first","in":"query","required":false,"schema":{"type":"boolean","description":"Leads holding an open quote first, then the sort","default":false,"title":"Open Deals First"},"description":"Leads holding an open quote first, then the sort"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Items to skip","default":0,"title":"Skip"},"description":"Items to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max items to return","default":50,"title":"Limit"},"description":"Max items to return"}],"responses":{"200":{"description":"One page of the CRM and how many leads match in all","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadList"},"example":{"items":[{"id":"3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91","organization_id":"8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e","name":"Officine Ferri Srl","domain":"officineferri.it","industry":"Metalworking","city":"Bergamo","country":"IT","status":"qualified","owner_user_id":"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f","owner":"Giulia Ferri","source":"api","next_action":"Send the quote for 500 flanges","open_deals":1,"pipeline_value":"12500.00","contacts":[{"id":"5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b","name":"Luca Bianchi","role":"Purchasing manager","email":"luca.bianchi@officineferri.it"}],"created_at":"2026-10-07T09:30:00+02:00"}],"total":1}}}},"401":{"description":"The X-API-Key header is missing, or the key is wrong, revoked or expired","content":{"application/json":{"example":{"error":{"code":"AUTHENTICATION_ERROR","message":"Invalid API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The key has no read access, or its owner no longer belongs to an organization, or it is suspended","content":{"application/json":{"example":{"error":{"code":"AUTHORIZATION_ERROR","message":"This key has no read access. Create a key with read access."}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Over 60 requests a minute for this key, or too many wrong keys from this address","content":{"application/json":{"example":{"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded for this API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["leads"],"summary":"Add a lead","description":"Add a company to the CRM, with its people in `contacts`. Lands on the lead already there.\n\nMemir looks for the company by `domain`, then for a person by a contact's `email`, then\nfor the same name when website and city do not differ. Not found: a new lead, assigned to\nthe key's owner, and the answer is **201**. Found: blank fields are filled in, new people\nwith an address on the company's domain are added (the others are written in the notes),\nand the answer is **200**. Nothing already written is overwritten.\n\n`fields` sets the organization's company fields, each named by its label (any case) or id:\n`{\"Esporta\": true, \"Certificazioni\": [\"ISO 9001\", \"IATF 16949\"]}`. A choice takes an option's\nlabel or id, a yes/no `true` or `false`, a date `YYYY-MM-DD`. On a lead already there only\nthe fields still empty are written, and one a person emptied stays empty. A field, option or value that does not fit answers\n**422** `VALIDATION_ERROR`, naming it and what it takes, and nothing is saved.\n\nStage, owner and follow-ups are not taken here, so a form's body can be forwarded as it is:\nset them with `PATCH`. Needs a key with write access.\n\nWith `message`, the lead is marked as having written in: the message is appended to its\nnotes, its follow-ups stop, its next action becomes \"Ha scritto\", and a lead that was only\nin a list moves into the CRM.\n\nCall it from your server, never from the browser: the key would be public.","operationId":"add_lead_api_v1_leads_post","security":[{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadSubmit"}}}},"responses":{"201":{"description":"A new lead was created in the CRM","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadRead"},"example":{"id":"3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91","organization_id":"8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e","name":"Officine Ferri Srl","domain":"officineferri.it","industry":"Metalworking","city":"Bergamo","country":"IT","status":"qualified","owner_user_id":"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f","owner":"Giulia Ferri","source":"api","next_action":"Send the quote for 500 flanges","open_deals":1,"pipeline_value":"12500.00","contacts":[{"id":"5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b","name":"Luca Bianchi","role":"Purchasing manager","email":"luca.bianchi@officineferri.it"}],"created_at":"2026-10-07T09:30:00+02:00"}}}},"200":{"description":"The company or a person was already there: that lead was filled in","content":{"application/json":{"example":{"id":"3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91","organization_id":"8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e","name":"Officine Ferri Srl","domain":"officineferri.it","industry":"Metalworking","city":"Bergamo","country":"IT","status":"qualified","owner_user_id":"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f","owner":"Giulia Ferri","source":"api","next_action":"Send the quote for 500 flanges","open_deals":1,"pipeline_value":"12500.00","contacts":[{"id":"5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b","name":"Luca Bianchi","role":"Purchasing manager","email":"luca.bianchi@officineferri.it"}],"created_at":"2026-10-07T09:30:00+02:00"},"schema":{"$ref":"#/components/schemas/LeadRead"}}}},"401":{"description":"The X-API-Key header is missing, or the key is wrong, revoked or expired","content":{"application/json":{"example":{"error":{"code":"AUTHENTICATION_ERROR","message":"Invalid API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The key has no write access, or its owner no longer belongs to an organization, or it is suspended","content":{"application/json":{"example":{"error":{"code":"AUTHORIZATION_ERROR","message":"This key has no write access. Create a key with write access."}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Over 60 requests a minute for this key, or too many wrong keys from this address","content":{"application/json":{"example":{"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded for this API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/summary":{"get":{"tags":["leads"],"summary":"Pipeline summary","description":"Open deals, pipeline value and win rates over the leads the filters match.\n\nTakes the same filters as the list; `list_id`, `skip`, `limit` and the sort are ignored.","operationId":"pipeline_summary_api_v1_leads_summary_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"description":"Free text","title":"Q"},"description":"Free text"},{"name":"status","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^(new|contacted|discarded|qualified|negotiation|customer|lost|c_[0-9a-f]{8}|discarded:(no_reply|not_interested|do_not_contact|other))$"},"maxItems":100,"description":"Pipeline status, or discarded:<no_reply|not_interested|do_not_contact|other>","title":"Status"},"description":"Pipeline status, or discarded:<no_reply|not_interested|do_not_contact|other>"},{"name":"industry","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"Sector, as written on the lead","title":"Industry"},"description":"Sector, as written on the lead"},{"name":"city","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"title":"City"}},{"name":"country","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"ISO 3166-1 alpha-2 code","title":"Country"},"description":"ISO 3166-1 alpha-2 code"},{"name":"employees","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"Size band, e.g. \"11-50\"","title":"Employees"},"description":"Size band, e.g. \"11-50\""},{"name":"revenue_verdict","in":"query","required":false,"schema":{"type":"array","items":{"anyOf":[{"enum":["ok","between","not_found"],"type":"string"},{"const":"none","type":"string"}]},"maxItems":4,"description":"Verified revenue status. Use 'none' for unchecked leads.","title":"Revenue Verdict"},"description":"Verified revenue status. Use 'none' for unchecked leads."},{"name":"source","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"Where the lead came from","title":"Source"},"description":"Where the lead came from"},{"name":"owner_user_id","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":36},"maxItems":100,"description":"Assigned colleague's user id","title":"Owner User Id"},"description":"Assigned colleague's user id"},{"name":"last_contact","in":"query","required":false,"schema":{"type":"array","items":{"enum":["never","7d","30d","older"],"type":"string"},"maxItems":100,"description":"When it was last written to","title":"Last Contact"},"description":"When it was last written to"},{"name":"activity","in":"query","required":false,"schema":{"type":"array","items":{"enum":["replied","failed","draft","overdue","today","queued","scheduled","proposals","stale","none"],"type":"string"},"maxItems":100,"description":"Mail state: a reply, a draft waiting, a failed send","title":"Activity"},"description":"Mail state: a reply, a draft waiting, a failed send"},{"name":"segment","in":"query","required":false,"schema":{"anyOf":[{"enum":["mine","planned","memir","new","idle"],"type":"string"},{"type":"null"}],"description":"Whose move it is","title":"Segment"},"description":"Whose move it is"},{"name":"reach","in":"query","required":false,"schema":{"type":"array","items":{"enum":["email","phone","contact","linkedin"],"type":"string"},"maxItems":100,"description":"How it can be reached","title":"Reach"},"description":"How it can be reached"},{"name":"field","in":"query","required":false,"schema":{"type":"array","items":{"type":"string","maxLength":128},"maxItems":100,"description":"A company field's value as \"<field_id>:<option_id|true|false|__none__>\"","title":"Field"},"description":"A company field's value as \"<field_id>:<option_id|true|false|__none__>\""},{"name":"created_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or after this day","title":"Created From"},"description":"Created on or after this day"},{"name":"created_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Created on or before this day","title":"Created To"},"description":"Created on or before this day"},{"name":"period_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"First day of a period: every lead still in play, plus the won, lost and discarded ones that moved in it. Goes with period_to","title":"Period From"},"description":"First day of a period: every lead still in play, plus the won, lost and discarded ones that moved in it. Goes with period_to"},{"name":"period_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Last day of the period, included","title":"Period To"},"description":"Last day of the period, included"},{"name":"mine","in":"query","required":false,"schema":{"type":"boolean","description":"Only leads assigned to me","default":false,"title":"Mine"},"description":"Only leads assigned to me"},{"name":"list_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"One contact list's members, in the CRM or not","title":"List Id"},"description":"One contact list's members, in the CRM or not"},{"name":"searches","in":"query","required":false,"schema":{"type":"boolean","description":"What my customer searches found: members of my lists an automation fills","default":false,"title":"Searches"},"description":"What my customer searches found: members of my lists an automation fills"},{"name":"sort","in":"query","required":false,"schema":{"enum":["created_at","name","industry","location","employees","status","owner","next_action_at","last_contact_at","pipeline_value"],"type":"string","description":"Column to sort by","default":"created_at","title":"Sort"},"description":"Column to sort by"},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Order"}},{"name":"open_deals_first","in":"query","required":false,"schema":{"type":"boolean","description":"Leads holding an open quote first, then the sort","default":false,"title":"Open Deals First"},"description":"Leads holding an open quote first, then the sort"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Items to skip","default":0,"title":"Skip"},"description":"Items to skip"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max items to return","default":50,"title":"Limit"},"description":"Max items to return"}],"responses":{"200":{"description":"Open deals, their value and win rates","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadPipelineSummary"},"example":{"open_deals":4,"pipeline_value":"48200.00","weighted_value":"19280.00","stages":{"contacted":12,"qualified":6,"negotiation":4,"customer":9},"win_rates":{"qualified":0.25,"negotiation":0.4}}}}},"401":{"description":"The X-API-Key header is missing, or the key is wrong, revoked or expired","content":{"application/json":{"example":{"error":{"code":"AUTHENTICATION_ERROR","message":"Invalid API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The key has no read access, or its owner no longer belongs to an organization, or it is suspended","content":{"application/json":{"example":{"error":{"code":"AUTHORIZATION_ERROR","message":"This key has no read access. Create a key with read access."}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Over 60 requests a minute for this key, or too many wrong keys from this address","content":{"application/json":{"example":{"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded for this API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/leads/{lead_id}":{"get":{"tags":["leads"],"summary":"Get a lead","description":"One lead of your organization, with its contacts.","operationId":"get_lead_api_v1_leads__lead_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"200":{"description":"The lead","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadRead"},"example":{"id":"3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91","organization_id":"8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e","name":"Officine Ferri Srl","domain":"officineferri.it","industry":"Metalworking","city":"Bergamo","country":"IT","status":"qualified","owner_user_id":"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f","owner":"Giulia Ferri","source":"api","next_action":"Send the quote for 500 flanges","open_deals":1,"pipeline_value":"12500.00","contacts":[{"id":"5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b","name":"Luca Bianchi","role":"Purchasing manager","email":"luca.bianchi@officineferri.it"}],"created_at":"2026-10-07T09:30:00+02:00"}}}},"404":{"description":"No lead with this id in your organization","content":{"application/json":{"example":{"error":{"code":"NOT_FOUND","message":"Lead not found"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"The X-API-Key header is missing, or the key is wrong, revoked or expired","content":{"application/json":{"example":{"error":{"code":"AUTHENTICATION_ERROR","message":"Invalid API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The key has no read access, or its owner no longer belongs to an organization, or it is suspended","content":{"application/json":{"example":{"error":{"code":"AUTHORIZATION_ERROR","message":"This key has no read access. Create a key with read access."}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Over 60 requests a minute for this key, or too many wrong keys from this address","content":{"application/json":{"example":{"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded for this API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["leads"],"summary":"Update a lead","description":"Change only the fields you send; the others stay as they are.\n\n`contacts`, when sent, replaces the whole list of people. `fields` changes only the company\nfields it names, as in `POST`, over any value; `null` or `\"\"` empties one. Writing a field\nanswers a proposal Memir left on it: the same value accepts it, another dismisses it.","operationId":"update_lead_api_v1_leads__lead_id__patch","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadUpdate"}}}},"responses":{"200":{"description":"The lead, updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadRead"},"example":{"id":"3f6c1b8e-2a4d-4f7e-9c1a-5b8d2e7f0a91","organization_id":"8a2e4c6d-1b3f-4a5c-9e7d-0f1a2b3c4d5e","name":"Officine Ferri Srl","domain":"officineferri.it","industry":"Metalworking","city":"Bergamo","country":"IT","status":"qualified","owner_user_id":"c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f","owner":"Giulia Ferri","source":"api","next_action":"Send the quote for 500 flanges","open_deals":1,"pipeline_value":"12500.00","contacts":[{"id":"5e4d3c2b-1a0f-4e9d-8c7b-6a5f4e3d2c1b","name":"Luca Bianchi","role":"Purchasing manager","email":"luca.bianchi@officineferri.it"}],"created_at":"2026-10-07T09:30:00+02:00"}}}},"400":{"description":"The pipeline refuses this status for this lead","content":{"application/json":{"example":{"error":{"code":"BAD_REQUEST","message":"Memir has already written to this lead, so it cannot go back to New."}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"No lead with this id in your organization","content":{"application/json":{"example":{"error":{"code":"NOT_FOUND","message":"Lead not found"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Another lead of your organization already has this domain","content":{"application/json":{"example":{"error":{"code":"ALREADY_EXISTS","message":"A lead with this domain already exists"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"The X-API-Key header is missing, or the key is wrong, revoked or expired","content":{"application/json":{"example":{"error":{"code":"AUTHENTICATION_ERROR","message":"Invalid API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The key has no write access, or its owner no longer belongs to an organization, or it is suspended","content":{"application/json":{"example":{"error":{"code":"AUTHORIZATION_ERROR","message":"This key has no write access. Create a key with write access."}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Over 60 requests a minute for this key, or too many wrong keys from this address","content":{"application/json":{"example":{"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded for this API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["leads"],"summary":"Delete a lead","description":"Delete a lead and its contacts. Only a key with write access, of an owner or admin, can.\n\nDeleting twice is not an error: a lead already gone answers **204** as well.","operationId":"delete_lead_api_v1_leads__lead_id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Lead Id"}}],"responses":{"204":{"description":"The lead is gone, or was never there"},"400":{"description":"Documents (quotes, orders, invoices) are linked to the lead","content":{"application/json":{"example":{"error":{"code":"BAD_REQUEST","message":"Officine Ferri Srl has 2 document(s) linked to it."}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"The X-API-Key header is missing, or the key is wrong, revoked or expired","content":{"application/json":{"example":{"error":{"code":"AUTHENTICATION_ERROR","message":"Invalid API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"The key's owner is not an owner or admin of the organization, or the key has no write access","content":{"application/json":{"example":{"error":{"code":"AUTHORIZATION_ERROR","message":"Only owners and admins can delete a lead"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Over 60 requests a minute for this key, or too many wrong keys from this address","content":{"application/json":{"example":{"error":{"code":"RATE_LIMIT_EXCEEDED","message":"Rate limit exceeded for this API key"}},"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiError":{"properties":{"error":{"$ref":"#/components/schemas/ApiErrorBody"}},"type":"object","required":["error"],"title":"ApiError","description":"The body of every error the app raises (`api/exception_handlers.py`); 422 is FastAPI's own."},"ApiErrorBody":{"properties":{"code":{"type":"string","title":"Code","description":"Stable machine code, e.g. \"AUTHENTICATION_ERROR\""},"message":{"type":"string","title":"Message"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"}},"type":"object","required":["code","message"],"title":"ApiErrorBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LeadContactCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"role":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Role"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"linkedin_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Linkedin Url"},"source":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source"},"source_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Source Url"}},"type":"object","required":["name"],"title":"LeadContactCreate","description":"A person at the company. Only the name is required — the rest trickles in."},"LeadContactRead":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"role":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Role"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"linkedin_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Linkedin Url"},"source":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source"},"source_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Source Url"},"id":{"type":"string","format":"uuid","title":"Id"},"tried_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Tried At"}},"type":"object","required":["name","id"],"title":"LeadContactRead"},"LeadFieldValueRead":{"properties":{"field_id":{"type":"string","format":"uuid","title":"Field Id"},"value":{"anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Value"},"author":{"type":"string","enum":["user","memir","api"],"title":"Author"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"set_at":{"type":"string","format":"date-time","title":"Set At"}},"type":"object","required":["field_id","value","author","set_at"],"title":"LeadFieldValueRead","description":"One field's value on a lead: options as ids, a date as ``YYYY-MM-DD``."},"LeadList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/LeadRead"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"LeadList"},"LeadPipelineSummary":{"properties":{"open_deals":{"type":"integer","title":"Open Deals"},"pipeline_value":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Pipeline Value"},"weighted_value":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Weighted Value","description":"Open value times the In trattativa win rate; none without a record"},"stages":{"additionalProperties":{"type":"integer"},"type":"object","title":"Stages","description":"Leads per CRM stage"},"stage_values":{"additionalProperties":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},"type":"object","title":"Stage Values","description":"Open quotes' EUR value per CRM stage; absent when none"},"win_rates":{"additionalProperties":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"object","title":"Win Rates","description":"Share of closed leads from each stage that were won"}},"type":"object","required":["open_deals","pipeline_value"],"title":"LeadPipelineSummary","description":"The CRM's KPI row: what is open, what it is worth, and how often each stage has closed."},"LeadProposalRead":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field","description":"A lead column, or a contact's email/phone"},"field_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Field Id","description":"A company field"},"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contact Id"},"value":{"anyOf":[{"type":"string"},{"type":"boolean"},{"type":"number"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Value"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","value","created_at"],"title":"LeadProposalRead","description":"A value Memir found where someone else's stands, waiting for Accetta or Scarta."},"LeadRead":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"name":{"type":"string","title":"Name"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"employees":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employees"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"linkedin_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linkedin Url"},"has_logo":{"type":"boolean","title":"Has Logo","default":false},"ateco":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ateco"},"ateco_match":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ateco Match"},"revenue_verdict":{"anyOf":[{"type":"string","enum":["ok","between","not_found"]},{"type":"null"}],"title":"Revenue Verdict"},"vat_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vat Number"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"status":{"type":"string","pattern":"^(new|contacted|discarded|qualified|negotiation|customer|lost|c_[0-9a-f]{8})$","title":"Status"},"owner_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner User Id"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"last_contact_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Contact At"},"follow_ups":{"type":"integer","title":"Follow Ups","default":0},"next_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action At"},"next_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Action"},"next_action_kind":{"anyOf":[{"type":"string","enum":["email","call","meeting","task"]},{"type":"null"}],"title":"Next Action Kind"},"replied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Replied At"},"last_agent_action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Last Agent Action"},"crm_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Crm At"},"pending_draft_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Pending Draft Id"},"pending_draft_state":{"anyOf":[{"type":"string","enum":["review","queued","failed"]},{"type":"null"}],"title":"Pending Draft State"},"pending_draft_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pending Draft At"},"next_step":{"type":"integer","title":"Next Step","default":1},"open_deals":{"type":"integer","title":"Open Deals","description":"Quotes out and unanswered","default":0},"pipeline_value":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Pipeline Value","description":"Open quotes in EUR, net of VAT","default":"0"},"last_won_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Won At"},"suggested_action":{"anyOf":[{"type":"string","enum":["reply","prepare_offer","chase_offer","propose_reorder"]},{"type":"null"}],"title":"Suggested Action"},"stage_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Stage Since","description":"Last stage change; null before 24 Oct 2026"},"suppressed_emails":{"items":{"type":"string"},"type":"array","title":"Suppressed Emails","description":"Its addresses on the do-not-contact list"},"suppressed_phones":{"items":{"type":"string"},"type":"array","title":"Suppressed Phones","description":"Its numbers on the do-not-contact list, as stored on it"},"discard_reason":{"anyOf":[{"type":"string","enum":["no_reply","not_interested","do_not_contact"]},{"type":"null"}],"title":"Discard Reason","description":"Why it is discarded; null when discarded by hand or not at all"},"company_blocked":{"type":"boolean","title":"Company Blocked","description":"Its domain or VAT number is a blocked company's","default":false},"suggested_lost_reason":{"anyOf":[{"type":"string","enum":["price","delivery_time","competitor","no_budget","no_response","other"]},{"type":"null"}],"title":"Suggested Lost Reason","description":"Why its latest reply said no, as Memir read it"},"contacts":{"items":{"$ref":"#/components/schemas/LeadContactRead"},"type":"array","title":"Contacts"},"fields":{"items":{"$ref":"#/components/schemas/LeadFieldValueRead"},"type":"array","title":"Fields","description":"Its company fields, one entry per field that has a value"},"sources":{"items":{"$ref":"#/components/schemas/LeadSourceRead"},"type":"array","title":"Sources","description":"Who wrote its columns, where known"},"proposals":{"items":{"$ref":"#/components/schemas/LeadProposalRead"},"type":"array","title":"Proposals","description":"Values Memir proposes beside a person's"}},"type":"object","required":["created_at","id","organization_id","name","status"],"title":"LeadRead"},"LeadSourceRead":{"properties":{"field":{"type":"string","title":"Field"},"contact_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contact Id","description":"Set on a contact's email/phone a person accepted from Memir"},"author":{"type":"string","enum":["user","memir","import","api"],"title":"Author"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"set_at":{"type":"string","format":"date-time","title":"Set At"}},"type":"object","required":["field","author","set_at"],"title":"LeadSourceRead","description":"Who wrote a column's current value; a column with no entry has an unknown author."},"LeadSubmit":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"domain":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Domain"},"industry":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Industry"},"employees":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Employees","description":"Band, e.g. \"11-50\""},"city":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"City"},"country":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Country","description":"ISO 3166-1 alpha-2"},"linkedin_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Linkedin Url"},"ateco":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Ateco","description":"ATECO 2025 code"},"vat_number":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Vat Number","description":"P.IVA / VAT id"},"address":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address"},"postal_code":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Postal Code"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email","description":"Generic company inbox, e.g. info@"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone","description":"Company switchboard"},"source":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source","description":"Where it came from"},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Notes"},"contacts":{"items":{"$ref":"#/components/schemas/LeadContactCreate"},"type":"array","maxItems":20,"title":"Contacts","description":"The people: objects with `name` and optionally role, email, phone"},"message":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Message","description":"What the person wrote. Appended, dated, to the notes, and the lead is marked as having written in: its follow-ups stop."},"page_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Page Url","description":"The page the request came from"},"fields":{"anyOf":[{"additionalProperties":true,"type":"object","maxProperties":50},{"type":"null"}],"title":"Fields","description":"Company fields by label or id, e.g. `{\"Esporta\": true, \"Certificazioni\": [\"ISO 9001\"]}`. Options by label or id, a date as YYYY-MM-DD. Written only where the lead has no value yet"}},"type":"object","required":["name"],"title":"LeadSubmit","description":"A lead from another system: one Memir already has gains it, otherwise it is created.\n\nNo stage, owner or follow-up count: a form's body forwarded as-is must not set them.","examples":[{"city":"Bergamo","contacts":[{"email":"giulia.ferri@officineferri.it","name":"Giulia Ferri","phone":"+39 035 123 4567","role":"Responsabile acquisti"}],"domain":"officineferri.it","message":"Buongiorno, vorrei un preventivo per 500 flange in acciaio inox.","name":"Officine Ferri Srl","page_url":"https://www.example.it/contatti"}]},"LeadUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"domain":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Domain"},"industry":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Industry"},"employees":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Employees"},"city":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"City"},"country":{"anyOf":[{"type":"string","maxLength":2},{"type":"null"}],"title":"Country"},"linkedin_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Linkedin Url"},"ateco":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Ateco"},"ateco_match":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ateco Match"},"vat_number":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Vat Number"},"address":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Address"},"postal_code":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Postal Code"},"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"status":{"anyOf":[{"type":"string","pattern":"^(new|contacted|discarded|qualified|negotiation|customer|lost|c_[0-9a-f]{8})$"},{"type":"null"}],"title":"Status"},"source":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Source"},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Notes"},"contacts":{"anyOf":[{"items":{"$ref":"#/components/schemas/LeadContactCreate"},"type":"array","maxItems":20},{"type":"null"}],"title":"Contacts"},"next_action":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Next Action","description":"What to do next with this company, as the CRM shows it"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Action At","description":"On a lead already contacted, a future date holds Memir's next email back until then"},"next_action_kind":{"anyOf":[{"type":"string","enum":["email","call","meeting","task"]},{"type":"null"}],"title":"Next Action Kind","description":"Who acts: `email` is Memir's move, `call`, `meeting` and `task` a person's"},"lost_reason":{"anyOf":[{"type":"string","enum":["price","delivery_time","competitor","no_budget","no_response","other"]},{"type":"null"}],"title":"Lost Reason","description":"Why the deal is off; only with status `lost`, and optional there"},"lost_reason_text":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Lost Reason Text","description":"What happened: required with lost_reason `other`, and only there"},"fields":{"anyOf":[{"additionalProperties":true,"type":"object","maxProperties":50},{"type":"null"}],"title":"Fields","description":"Company fields by label or id, e.g. `{\"Esporta\": true, \"Certificazioni\": [\"ISO 9001\"]}`. Only the fields named change; null or \"\" empties one"}},"type":"object","title":"LeadUpdate","examples":[{"notes":"Quote sent on 7 October.","status":"negotiation"}]},"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"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"tags":[{"name":"leads","description":"Read and keep the CRM's companies in step with your systems"}]}