{"path":"/crm","session":"Required. Send session and brand. Brand must match the session. Module CRM plus CRUD.","actions":{"create_person":"first_name, last_name. Writes a person on the session brand.","update_person":"person_id, first_name, last_name.","delete_person":"person_id. Also removes that person relation rows on this brand.","create_company":"name. Writes a company on the session brand.","update_company":"company_id, name.","delete_company":"company_id. Also removes relation rows for that company on this brand."},"note":"Relationship CRUD is /relation, not /crm.","examples":{"create_person":"const res = await fetch('/crm/', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'create_person', session: 'SESSION_ID', brand: 'BRANDCODE', first_name: 'Ada', last_name: 'Lovelace' }) }).then(r => r.json());","update_person":"const res = await fetch('/crm/', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'update_person', session: 'SESSION_ID', brand: 'BRANDCODE', person_id: 'PERSON_ID', first_name: 'Ada', last_name: 'Lovelace' }) }).then(r => r.json());","delete_person":"const res = await fetch('/crm/', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'delete_person', session: 'SESSION_ID', brand: 'BRANDCODE', person_id: 'PERSON_ID' }) }).then(r => r.json());","create_company":"const res = await fetch('/crm/', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'create_company', session: 'SESSION_ID', brand: 'BRANDCODE', name: 'Example LLC' }) }).then(r => r.json());","update_company":"const res = await fetch('/crm/', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'update_company', session: 'SESSION_ID', brand: 'BRANDCODE', company_id: 'COMPANY_ID', name: 'Example LLC' }) }).then(r => r.json());","delete_company":"const res = await fetch('/crm/', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ action: 'delete_company', session: 'SESSION_ID', brand: 'BRANDCODE', company_id: 'COMPANY_ID' }) }).then(r => r.json());"}}