Contacts router
An overview of the Contacts router
Procedures
The contacts router has the following procedures:
Get contact by id
Returns a contact by id.
- Access:
@member
// Client componentsconst { data } = api.contacts.byId.useQuery({id: '',workspaceId: '',})// Server componentsconst data = await api.contacts.byId({id: '',workspaceId: '',})
List contacts by type
List all contacts by type.
- Access:
@member
// Client componentsconst { data } = api.contacts.listByType.useQuery({type: '',workspaceId: '',})// Server componentsconst data = await api.contacts.listByType({type: '',workspaceId: '',})
Create a contact
Create a new contact in the workspace.
- Access:
@member
// Client componentsconst { data } = api.contacts.create.useMutation()// Server componentsconst data = await api.contacts.create()
Update a contact
Update a contact.
- Access:
@member
// Client componentsconst { data } = api.contacts.update.useMutation()// Server componentsconst data = await api.contacts.update()
List contact activity
Returns the latest activity of a contact.
- Access:
@member
// Client componentsconst { data } = api.contacts.activitiesById.useQuery({id: '',workspaceId: '',})// Server componentsconst data = await api.contacts.activitiesById({id: '',workspaceId: '',})
Add a comment to a contact
Add a comment to a contact.
- Access:
@member
// Client componentsconst { mutate } = api.contacts.addComment.useMutation()mutate({input: {id: '',workspaceId: '',comment: '',},})// Server componentsconst data = await api.contacts.addComment({input: {id: '',workspaceId: '',comment: '',},})
Remove a comment
Remove a comment from a contact.
- Access:
@member
// Client componentsconst { mutate } = api.contacts.removeComment.useMutation()mutate({input: {workspaceId: '',commentId: '',},})// Server componentsconst data = await api.contacts.removeComment({input: {workspaceId: '',commentId: '',},})
Update tags
Update the tags of a contact. Removes any tags not included in the list.
- Access:
@member
// Client componentsconst { mutate } = api.contacts.updateTags.useMutation()mutate({input: {id: '',workspaceId: '',tags: [],},})// Server componentsconst data = await api.contacts.updateTags({input: {id: '',workspaceId: '',tags: [],},})
Was this helpful?