Contacts
On this page, we'll dive into the different contact endpoints you can use to manage them programmatically.
The Contact object
Contact objects represent a single contact related to a commercial risk profile. Contacts contain the following properties and relationships:
Commercial-only Properties
These properties are available only for commercial risk profiles.- Name
primary
- Type
- bool
- Filterable
- Description
Whether the contact is the primary contact for the commercial risk profile
- Name
first_name
- Type
- string
- Filterable
- Sortable
- Description
The first name of the contact
- Name
last_name
- Type
- string
- Filterable
- Sortable
- Description
The last name of the contact
- Name
prefix
- Type
- nullable enum
- Sortable
- Description
The prefix of the contact's name
- Name
Mr
- Description
- Mr
- Name
Mrs
- Description
- Mrs
- Name
Ms
- Description
- Ms
- Name
Dr
- Description
- Dr
- Name
suffix
- Type
- nullable enum
- Sortable
- Description
The suffix of the contact's name
- Name
Sr
- Description
- Sr
- Name
Jr
- Description
- Jr
- Name
II
- Description
- II
- Name
III
- Description
- III
- Name
IV
- Description
- IV
- Name
JD
- Description
- JD
- Name
MD
- Description
- MD
- Name
PhD
- Description
- PhD
- Name
title
- Type
- nullable string
- Filterable
- Sortable
- Description
The title of the contact
- Name
is_employee
- Type
- bool
- Filterable
- Sortable
- Description
Whether the contact is an employee of the company
- Name
contact_for
- Type
- enum[]
- Filterable
- Description
The roles the contact is responsible for
- Name
accounting
- Description
- accounting
- Name
claims
- Description
- claims
- Name
inspections
- Description
- inspections
- Name
linkedin
- Type
- nullable string
- Description
The LinkedIn profile URL of the contact
- Name
image
- Type
- nullable string
- Description
The URL of the contact's profile image
- Name
notes
- Type
- nullable string
- Description
Any additional notes or comments about the contact
Meta
- Name
created
- Type
- timestamp
- Filterable
- Sortable
- Description
An ISO-8601 timestamp (UTC) indicating when the contact was created
- Name
updated
- Type
- timestamp
- Filterable
- Sortable
- Description
An ISO-8601 timestamp (UTC) indicating when the contact was last updated
- Name
has_wunderite_access
- Type
- string
- Description
A Yes / No / Invited value indicating whether the contact can access Wunderite as a customer collaborator on the commercial risk profile
Commercial-only Relations
Learn more about including relations.- Name
attachments
- Type
- Attachment[]
- Name
attachments.uploader
- Type
- User
- Description
The user who uploaded the attachment
- Name
emails
- Type
- Contact Email[]
- Name
phones
- Type
- Contact Phone[]
List all contacts
This endpoint allows you to retrieve a paginated list of all contacts related to the corresponding commercial risk profile.
Parameters
See the contact object for a list of all available filters and sorts.
Searchable
You can search for contacts by providing a search query in the filter[search]
parameter.
The search query will be matched against contact first and last names, email addresses, and phone numbers.
Additional Filters
- Name
uuid
- Type
- string
- Filterable
- Description
Filter contacts by UUID (comma-delimited list for many)
- Name
name
- Type
- string
- Filterable
- Description
Filter contacts by name (first name and last name)
- Name
contact_for
- Type
- enum|enum[]
- Filterable
- Description
Filter contacts by the role they have. Comma-delimited list or array of values can be used to filter by multiple roles.
- Name
emails.email
- Type
- string
- Filterable
- Description
Filter contacts by email address
- Name
phones.phone
- Type
- string
- Filterable
- Description
Filter contacts by phone number
Request
curl -X GET -G "https://app.wunderite.com/api/v1/risks/{risk}/data/contacts?include=emails,phones" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json"
Response
{ "data": [ { "object": "contact", "uuid": "101f162b-c6a7-4cf9-a745-b67a00b3b1c0", "data": { "primary": true, "first_name": "Richard", "last_name": "Hendricks", "prefix": "Mr",
Create contacts
This endpoint allows you to create new contacts in the corresponding commercial risk profile.
At least one contact object must be provided in the request body.
You can also create emails and phones in the same request if you provide the emails
and phones
properties.
Required properties
- Name
first_name
- Type
- string
- Description
The first name of the contact
- Name
last_name
- Type
- string
- Description
The last name of the contact
Optional properties
See all available properties in the contact properties section.
- Name
emails
- Type
- ContactEmail[]
- Description
An array of contact email objects that should be created with the contact.
If no
type
is provided in the contact email object, it will default toother
.
- Name
phones
- Type
- ContactPhone[]
- Description
An array of contact phone objects that should be created with the contact.
If no
type
is provided in the contact phone object, it will default toother
.
Caveats
Primary
- Only one contact can have
primary
set totrue
in a risk profile. - If a risk profile has no primary contact, we will automatically assign the first contact as the primary contact if
primary
isfalse
or has no value. - Creating a contact with
primary
set totrue
will automatically set the previousprimary
contact tofalse
, if it exists. - Attempting to create many contacts with
primary
set totrue
in the same request will result in a validation error.
Request
curl -X POST "https://app.wunderite.com/api/v1/risks/{risk}/data/contacts" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "contact",
"data": {
"primary": false,
"first_name": "John",
"last_name": "Doe",
"prefix": "Mr",
"suffix": "Jr",
"title": "CEO",
"is_employee": true,
"contact_for": [
"accounting",
"claims"
],
"linkedin": "https:\/\/www.linkedin.com\/in\/johndoe",
"notes": "These are notes"
}
}
]
}'
Response
{ "data": [ { "object": "contact", "uuid": "5d8e0b44-d531-49bc-adfd-3375a343bb97", "data": { "primary": false, "first_name": "John", "last_name": "Doe", "prefix": "Mr",
Request with sub resources
curl -X POST "https://app.wunderite.com/api/v1/risks/{risk}/data/contacts?include=emails,phones" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "contact",
"data": {
"primary": false,
"first_name": "John",
"last_name": "Doe",
"prefix": "Mr",
"suffix": "Jr",
"title": "CEO",
"is_employee": true,
"contact_for": [
"accounting",
"claims"
],
"linkedin": "https:\/\/www.linkedin.com\/in\/johndoe",
"notes": "These are notes",
"emails": [
{
"object": "contact_email",
"data": {
"email": "[email protected]",
"type": "work"
}
}
],
"phones": [
{
"object": "contact_phone",
"data": {
"phone": "555-555-5555",
"type": "work"
}
}
]
}
}
]
}'
Response
{ "data": [ { "object": "contact", "uuid": "75c253ea-9b95-4908-b296-a000ec4fac23", "data": { "primary": false, "first_name": "John", "last_name": "Doe", "prefix": "Mr",
Update contacts
This endpoint allows you to perform bulk updates on contacts.
- At least one contact object must be provided in the request body. Each object must contain at least one property from the contact properties section.
- Properties that are not provided will not be updated.
- To clear a property, provide a
null
value.
Optional properties
See all available properties in the contact properties section.
- Name
emails
- Type
- ContactEmail[]
- Description
An array of contact email objects that should be modified / created within the contact.
If a
uuid
is provided in an object in the array, the corresponding contact email object will be updated. Otherwise, a new contact email object will be created.
- Name
phones
- Type
- ContactPhone[]
- Description
An array of contact phone objects that should be modified / created within the contact.
If a
uuid
is provided in an object in the array, the corresponding contact phone object will be updated. Otherwise, a new contact phone object will be created.
Flags
Learn more about flags.
- Name
flags.sync
- Type
- bool
- Description
Defaults to
false
if not provided.Specify whether you want Wunderite to treat this request as a
PUT
request instead of aPATCH
request.This is especially useful when you want to synchronize the contact's
emails
andphones
to only the objects provided in the request. Anyemails
orphones
not provided in the request will be removed from the contact.
Caveats
Primary
- Only one contact can have
primary
set totrue
in a risk profile. - Updating a contact with
primary
set totrue
will automatically set the previousprimary
contact tofalse
, if it exists. - Attempting to update many contacts with
primary
set totrue
in the same request will result in a validation error.
Attempting to update a contact's primary
to false
will throw a validation error.
To remove the primary
flag from a contact, you must first update the other contact intended to have primary
set to true
.
Request
curl -X PATCH "https://app.wunderite.com/api/v1/risks/{risk}/data" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "contact",
"uuid": "c659ff46-968a-40a6-9f18-3f9f48704451",
"data": {
"first_name": "Bertram",
"last_name": "Gilfoyle",
"prefix": null,
"suffix": "JD",
"title": "Lead Software Engineer",
"is_employee": false,
"contact_for": [],
"linkedin": null,
"image": null,
"notes": null
}
}
]
}'
Response
{ "data": [ { "object": "contact", "uuid": "c659ff46-968a-40a6-9f18-3f9f48704451", "data": { "first_name": "Bertram", "last_name": "Gilfoyle", "prefix": null, "suffix": "JD",
Request with sub resources
curl -X PATCH "https://app.wunderite.com/api/v1/risks/{risk}/data" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "contact",
"uuid": "c659ff46-968a-40a6-9f18-3f9f48704451",
"data": {
"first_name": "Bertram",
"last_name": "Gilfoyle",
"prefix": null,
"suffix": "JD",
"title": "Lead Software Engineer",
"is_employee": false,
"contact_for": [],
"linkedin": null,
"image": null,
"notes": null,
"emails": [
{
"object": "contact_email",
"uuid": "d5ed78e4-8964-4957-8f26-ac97fe7a95c2",
"data": {
"email": "[email protected]",
"type": "work"
}
}
],
"phones": [
{
"object": "contact_phone",
"uuid": "79f89f51-0aec-4349-b495-9a9ecb59b8d1",
"data": {
"phone": "5555678901",
"extension": null,
"type": "work"
}
}
]
}
}
]
}'
Response
{ "data": [ { "object": "contact", "uuid": "c659ff46-968a-40a6-9f18-3f9f48704451", "data": { "first_name": "Bertram", "last_name": "Gilfoyle", "prefix": null, "suffix": "JD",
Delete contacts
This endpoint allows you to bulk delete risk data, including contacts.
At least one contact object must be provided in the request body to delete the corresponding contact.
Deleting a contact will also delete all of the emails and phones associated to it.
Deleting the primary contact will automatically assign the oldest contact as the primary contact.
Required properties
- Name
object
- Type
- string
- Description
The object type of the data to delete. Must be
contact
in this case.
- Name
uuid
- Type
- string
- Description
The UUID of the contact to delete
Request
curl -X DELETE "https://app.wunderite.com/api/v1/risks/{risk}/data" \
-H "Authorization: Bearer {token}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"data": [
{
"object": "contact",
"uuid": "c659ff46-968a-40a6-9f18-3f9f48704451"
}
]
}'
Response
{
"data": [
{
"object": "contact",
"uuid": "c659ff46-968a-40a6-9f18-3f9f48704451",
"profile_type": "commercial"
}
]
}