Skip to content

Relationships API

All endpoints require authentication and relationships tool permissions (view, update, or manage as noted).

GET /api/relationships/contacts/:id/relationship

Returns the contact’s relationship profile. Auto-creates a profile if none exists, pre-populating the phone number from the contact record. Also returns whether Twilio is connected.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:view

Response: { profile, twilio_connected }


PATCH /api/relationships/contacts/:id/relationship

Updates (or upserts) the contact’s relationship profile fields.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:update

Body fields (all optional):

FieldTypeDescription
communication_preferencestringPreferred communication channel
communication_notesstringNotes about communication
personal_notesstringPersonal notes
birthdaystringBirthday (MM-DD or full date)
birthday_yearnumberBirth year
home_addressstringHome address
interestsstring[]Array of interests (stored as JSON)
dietary_requirementsstringDietary requirements
preferred_namestringPreferred name
assistant_namestringAssistant’s name
assistant_emailstringAssistant’s email
phone_numberstringPhone number
whatsapp_numberstringWhatsApp number
twilio_opt_inbooleanOpted in to Twilio messaging

Response: { profile }


GET /api/relationships/contacts/:id/life-events

Returns all life events for a contact, ordered by event date descending.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:view

Response: { events }


POST /api/relationships/contacts/:id/life-events

Creates a life event for a contact. Automatically creates an auto-action if auto_action_enabled is not false.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:update

Body:

FieldTypeRequiredDescription
event_typestringYesEvent type (e.g. birthday, anniversary)
titlestringYesEvent title
event_datestringNoEvent date (ISO)
recurs_annuallybooleanNoWhether event recurs each year
descriptionstringNoEvent description
auto_action_enabledbooleanNoCreate auto-action (default: true)
auto_action_days_beforenumberNoDays before event to trigger action
company_idstringNoAssociated company ID

Response: { event } (201)


PATCH /api/relationships/contacts/:id/life-events/:eventId

Permission: relationships:update

Body fields (all optional): event_type, event_date, recurs_annually, title, description, auto_action_enabled, auto_action_days_before

Response: { event }


DELETE /api/relationships/contacts/:id/life-events/:eventId

Permission: relationships:manage

Response: { ok: true }


GET /api/relationships/relationship-actions

Returns relationship actions scoped by access level:

  • Executive/Head: all actions
  • Manager: own + squad members’ actions
  • Others: own actions only

Permission: relationships:view

Response: { actions }

Each action includes joined first_name, last_name, contact_email, company_name, and assigned_to_name.


GET /api/relationships/contacts/:id/relationship-actions

Returns actions for a specific contact.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:view

Response: { actions }


POST /api/relationships/contacts/:id/relationship-actions

Creates a manual relationship action for a contact. Also mirrors the action to the action centre.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:update

Body:

FieldTypeRequiredDescription
titlestringYesAction title
action_typestringYesAction type (e.g. gift, whatsapp, call, linkedin, card)
descriptionstringNoAction description
assigned_to_user_idstringNoAssigned user (default: current user)
due_datestringNoDue date (ISO)
message_bodystringNoPre-drafted message body
company_idstringNoAssociated company ID

Response: { action } (201)


PATCH /api/relationships/relationship-actions/:id

Updates the status of a relationship action. Syncs completion to the action centre.

Path parameters:

ParamTypeDescription
idstringAction ID

Permission: relationships:update

Body:

FieldTypeRequiredDescription
statusstringYesNew status: done or dismissed

Response: { action }


GET /api/relationships/contacts/:id/messages

Returns all messages for a contact, ordered by most recent first.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:view

Response: { messages }


POST /api/relationships/contacts/:id/messages

Sends an SMS, WhatsApp, or MMS message to a contact via Twilio. Requires the contact to have opted in (twilio_opt_in) and a valid phone number.

Path parameters:

ParamTypeDescription
idstringContact ID

Permission: relationships:update

Body:

FieldTypeRequiredDescription
channelstringYessms, whatsapp, or mms
bodystringYesMessage text
media_urlstringNoMedia URL (MMS only)
auto_action_idstringNoLink to auto-action (marks it done on send)

Response: { message } (201)

Error responses:

  • 403 — Contact has not opted in
  • 400 — No phone number on record
  • 500 — Twilio not configured
  • 503 — Twilio is disabled

GET /api/relationships/companies/:id/partners

Returns partners for a client company. The company must have a client_profiles record.

Path parameters:

ParamTypeDescription
idstringCompany ID

Permission: relationships:view

Response: { partners }


POST /api/relationships/companies/:id/partners

Path parameters:

ParamTypeDescription
idstringCompany ID

Permission: relationships:update

Body:

FieldTypeRequiredDescription
partner_company_namestringYesPartner company name
partner_contact_namestringNoPartner contact name
partner_contact_emailstringNoPartner contact email
relationship_typestringNoRelationship type
estimated_deal_sizenumberNoEstimated deal size
notesstringNoNotes
contact_idstringNoLinked contact ID

Response: { partner } (201)


PATCH /api/relationships/companies/:id/partners/:partnerId

Permission: relationships:update

Body fields (all optional): partner_company_name, partner_contact_name, partner_contact_email, relationship_type, estimated_deal_size, notes, contact_id

Response: { partner }


DELETE /api/relationships/companies/:id/partners/:partnerId

Permission: relationships:manage

Response: { ok: true }


GET /api/relationships/clients/:companyId/relationship-summary

Returns a comprehensive relationship summary for a client company including contacts with communication preferences, upcoming events (next 90 days + recurring), pending actions, partners, and recent messages (last 10).

Path parameters:

ParamTypeDescription
companyIdstringCompany ID

Permission: relationships:view

Response: { contacts, events, actions, partners, messages }