Contacts
Contacts are the people your team reaches out to about a company or private person, such as the accountant who fills in a KYC form. A contact need not appear in any register. Each entity can have one primary contact.
Reading contacts needs the entity_contacts:read permission;
creating, changing and deleting them needs
entity_contacts:write.
List the contacts on a company
Contacts are a field on company and privatePerson. The primary contact comes first, then the rest, oldest first:
query CompanyContacts {
company(where: { id: "<company_id>" }) {
contacts {
id
name
email
phone
isPrimary
lastUsedAt
linkedPerson {
id
name
}
}
}
}lastUsedAt is set when a form is sent to the contact, so a
contact that has not been used for a long time is easy to spot.
Create a contact
Use
companyContactCreate
or
privatePersonContactCreate.
Only name is required. The first contact on an entity always
becomes its primary contact, and makePrimary moves the flag
to a new one:
mutation CreateContact {
companyContactCreate(
where: {
company: "<company_id>"
name: "Accounts contact"
email: "<email>"
phone: "+47 2233 4455"
makePrimary: true
}
) {
success
contact {
id
isPrimary
}
}
}To tie the contact to a person Strise already knows, such as
one of the company's role holders, pass their id as
linkedPerson. Linking a contact does not give the person a
role in the company.
Update a contact
contactUpdate replaces every field: an optional field you leave out is cleared. Read the contact first and send back the fields you want to keep:
mutation UpdateContact {
contactUpdate(where: { id: "<contact_id>", name: "Accounts contact", email: "<new_email>" }) {
success
contact {
id
email
phone
}
}
}Change the primary contact or delete a contact
mutation SetPrimaryContact {
contactSetPrimary(where: { id: "<contact_id>" }) {
success
}
}mutation DeleteContact {
contactDelete(where: { id: "<contact_id>" })
}Deleting the primary contact leaves the entity with none.