Contacts

Contacts are the people associated with your Accounts. Contacts can attend your Events, receive your communications, or even be a member of your staff.

Search

The following example fetches the first page of all Contacts whose last name is Smith:

Example

query {
  contacts(
    filters: [
      {field: lastName, operation: eq, value: "Smith"}
    ]
  ) {
    edges {
      node {
        id
        personalName {
          firstName
          lastName
        }
        emailAddress
      }
    }
  }
}

For the full range of available filters see the ContactField API Reference.

Create

The following example creates a new Contact for the specified Account and returns its id:

Example

mutation {
  contact{
    create(input:{
      accountId: "T3JnYW5pc2F0aW9uOjE="
      personalName:{
        firstName: "Jane"
        lastName: "Doe"
      }
    }) {
      contact{
        id
      }
      errors{
        label 
        message 
        value
      }
    }
  } 
}

For the full range of create parameters available, see the ContactCreateInput API Reference

Update

The following examples updates the specified Contact mobile phone number:

Example

mutation {
  contact{
    update(input:{
      contactId:"UGVyc29uOjE="
      phoneNumbers:[
        {usage: mobile, number: "+44 1632 123 456"}
      ]
    }) {
      contact{
        id
      }
      errors{
        label 
        message 
        value
      }
    }
  } 
}

For the full range of update parameters available, see the ContactUpdateInput API Reference

Delete

The following deletes the specified Contact:

Example

mutation {
  contact{
    delete(input:{
      contactId:"UGVyc29uOjE="
    }) {
      errors{
        label 
        message 
        value
      }
    }
  } 
}