Skip to content

Contacts API

These contact APIs are for getting contact details associated with an assessment. Currently contacts are only associated with specific assessments - the same "person" may have different contact details for different assessments.

Contact type

The contact type is as follow:

typescript
type Contact {
  id: number
  assessmentId: number
  type: 'owner' | 'tenant' | 'property_mananger' | 'other'
  name: string
  firstName: string
  lastName: string
  phone: string
  email: string
  isPrimary: boolean
  externalType?: string
  externalId?: string
}

API

List

/assessment-contacts/list

Get an array of Contacts

Body

json
{
  "assessmentId": 123
}

Returns

An array of Contact.

json
[
  {
    "id": 3,
    "assessmentId": 123,
    "type": "owner",
    "firstName": "James",
    ...
  },
  ...
]

Add

/assessment-contact/add

Add a new contact to the assessment. The Contact does not need and id.

Body

json
{
  "assessmentId": 123,
  "contact": <Contact>
}

Returns

The created Contact.

json
{
  "id": 3,
  "assessmentId": 123,
  "type": "owner",
  "firstName": "James",
  ...
}

Update

/assessment-contact/update

Updates a contact on the assessment. The Contact that you send in requires an id and assessmentId and these must match a contact that exists.

Body

json
{
  // the ID of the assessment
  "assessmentId": 123,
  "contact": <Contact>
}

Returns

A single Contact object.

json
{
  "id": 3,
  "assessmentId": 123,
  "type": "owner",
  "firstName": "James",
  ...
}

Delete

/assessment-contact/delete

Deletes a contact from the assessment.

Body

json
{
  "assessmentId": 123,
  "contactId": 1
}

Returns

Indication that deletion was successful.

json
true | false