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.

GET/api/v1/risks/{risk}/data/contacts

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

GET
/api/v1/risks/{risk}/data/contacts
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",
"suffix": "Jr", "title": "CEO", "is_employee": true, "contact_for": [ "inspections" ], "linkedin": null, "image": "https:\/\/app.wunderite.com\/proxy\/media\/avatar\/7dd7990c-cb3d-4fdf-9441-8b357549ab01", "notes": null }, "meta": { "created": "2024-04-19T18:57:05+00:00", "updated": "2024-04-22T13:53:13+00:00", "has_wunderite_access": "Yes" }, "relations": { "emails": [ { "object": "contact_email", "uuid": "b04793cc-e50c-46e5-adc7-f6f0539d8ba0", "data": { "email": "[email protected]", "type": "work" }, "meta": { "created": "2024-07-11T12:36:21+00:00", "updated": "2024-07-11T12:36:21+00:00" } } ], "phones": [ { "object": "contact_phone", "uuid": "cf24315b-94a0-41fa-9788-cf27415922a3", "data": { "phone": "5554208080", "extension": null, "type": "work" }, "meta": { "created": "2024-04-19T18:57:05+00:00", "updated": "2024-04-19T18:57:05+00:00" } } ] } }, { "object": "contact", "uuid": "c659ff46-968a-40a6-9f18-3f9f48704451", "data": { "primary": false, "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 }, "meta": { "created": "2024-04-19T18:57:02+00:00", "updated": "2024-04-19T18:57:02+00:00", "has_wunderite_access": "Invited" }, "relations": { "emails": [ { "object": "contact_email", "uuid": "d5ed78e4-8964-4957-8f26-ac97fe7a95c2", "data": { "email": "[email protected]", "type": "work" }, "meta": { "created": "2024-07-11T12:38:45+00:00", "updated": "2024-07-11T12:38:45+00:00" } } ], "phones": [ { "object": "contact_phone", "uuid": "79f89f51-0aec-4349-b495-9a9ecb59b8d1", "data": { "phone": "5555678901", "extension": null, "type": "work" }, "meta": { "created": "2024-04-19T18:57:02+00:00", "updated": "2024-04-19T18:57:02+00:00" } } ] } } ], "path": "https:\/\/app.wunderite.com\/api\/v1\/risks\/d10e34bb-4420-47de-ba9f-42a4a3f34b0e\/data\/contacts", "per_page": 50, "next_cursor": null, "next_page_url": null, "prev_cursor": null, "prev_page_url": null }

POST/api/v1/risks/{risk}/data/contacts

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 to other.

  • 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 to other.

Caveats

Primary

  • Only one contact can have primary set to true 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 is false or has no value.
  • Creating a contact with primary set to true will automatically set the previous primary contact to false, if it exists.
  • Attempting to create many contacts with primary set to true in the same request will result in a validation error.

Request

POST
/api/v1/risks/{risk}/data/contacts
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",
"suffix": "Jr", "title": "CEO", "is_employee": true, "contact_for": [ "accounting", "claims" ], "linkedin": "https:\/\/www.linkedin.com\/in\/johndoe", "image": null, "notes": "These are notes" }, "meta": { "created": "2024-01-01T00:00:00+00:00", "updated": "2024-01-01T00:00:00+00:00", "has_wunderite_access": "No" }, "relations": { "emails": [], "phones": [] } } ] }

Request with sub resources

POST
/api/v1/risks/{risk}/data/contacts
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",
"suffix": "Jr", "title": "CEO", "is_employee": true, "contact_for": [ "accounting", "claims" ], "linkedin": "https:\/\/www.linkedin.com\/in\/johndoe", "image": null, "notes": "These are notes" }, "meta": { "created": "2024-01-01T00:00:00+00:00", "updated": "2024-01-01T00:00:00+00:00", "has_wunderite_access": "No" }, "relations": { "emails": [ { "object": "contact_email", "uuid": "5f00a17b-fd5e-4cd5-b312-e52748678934", "data": { "email": "[email protected]", "type": "work" }, "meta": { "created": "2024-01-01T00:00:00+00:00", "updated": "2024-01-01T00:00:00+00:00" } } ], "phones": [ { "object": "contact_phone", "uuid": "9663cdbf-2b31-426e-aa1c-ed704b345656", "data": { "phone": "555-555-5555", "extension": null, "type": "work" }, "meta": { "created": "2024-01-01T00:00:00+00:00", "updated": "2024-01-01T00:00:00+00:00" } } ] } } ] }

PATCH/api/v1/risks/{risk}/data

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 a PATCH request.

    This is especially useful when you want to synchronize the contact's emails and phones to only the objects provided in the request. Any emails or phones not provided in the request will be removed from the contact.

Caveats

Primary

  • Only one contact can have primary set to true in a risk profile.
  • Updating a contact with primary set to true will automatically set the previous primary contact to false, if it exists.
  • Attempting to update many contacts with primary set to true in the same request will result in a validation error.

Request

PATCH
/api/v1/risks/{risk}/data
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",
"title": "Lead Software Engineer", "is_employee": false, "contact_for": [], "linkedin": null, "image": null, "notes": null }, "profile_type": "commercial" } ] }

Request with sub resources

PATCH
/api/v1/risks/{risk}/data
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",
"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" } } ] }, "profile_type": "commercial" } ] }

DELETE/api/v1/risks/{risk}/data

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

DELETE
/api/v1/risks/{risk}/data
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"
        }
    ]
}