Contacts
Generated at build time from packages/core/src/operations/contacts.ts. Every operation below isPOST /v1/ops/{name} over HTTP, env.API.invoke(actor, name, input) over RPC, and, when staff may call it, an MCP tool. See the API overview for authentication and errors.
contacts.list
List or search contacts
List contacts, optionally for one account or matching a name, email or phone number. Each row includes the account name.
Input (object)
| Field | Type | Description |
|---|---|---|
accountId | string | Record id (UUID)min length 1, max length 64 |
query | string | Matches name, email, mobile or phonemax length 200 |
limit | integer | Maximum rows to return (default 50, max 500)default 50, min 1, max 500 |
offset | integer | Rows to skip, for pagingdefault 0, min 0, max 9007199254740991 |
Output (object)
| Field | Type | Description |
|---|---|---|
itemsrequired | object[] | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
firstNamerequired | string | |
lastNamerequired | string | |
rolerequired | string | null | Job title or role at the customer, for example Plant manager |
emailrequired | string | null | |
mobilerequired | string | null | |
phonerequired | string | null | |
preferredChannelrequired | "email" | "phone" | "text" | |
isPrimaryrequired | boolean | |
hubspotContactIdrequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string | |
totalrequired | integer | Total rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991 |
limitrequired | integer | min -9007199254740991, max 9007199254740991 |
offsetrequired | integer | min -9007199254740991, max 9007199254740991 |
Example request
curl https://api.cemco.app/v1/ops/contacts.list \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"query": {
"description": "Matches name, email, mobile or phone",
"type": "string",
"maxLength": 200
},
"limit": {
"default": 50,
"description": "Maximum rows to return (default 50, max 500)",
"type": "integer",
"minimum": 1,
"maximum": 500
},
"offset": {
"default": 0,
"description": "Rows to skip, for paging",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"role": {
"description": "Job title or role at the customer, for example Plant manager",
"type": [
"string",
"null"
]
},
"email": {
"type": [
"string",
"null"
]
},
"mobile": {
"type": [
"string",
"null"
]
},
"phone": {
"type": [
"string",
"null"
]
},
"preferredChannel": {
"type": "string",
"enum": [
"email",
"phone",
"text"
]
},
"isPrimary": {
"type": "boolean"
},
"hubspotContactId": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"accountName": {
"type": "string"
}
},
"required": [
"id",
"accountId",
"firstName",
"lastName",
"role",
"email",
"mobile",
"phone",
"preferredChannel",
"isPrimary",
"hubspotContactId",
"notes",
"createdAt",
"updatedAt",
"accountName"
],
"additionalProperties": false
}
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991,
"description": "Total rows matching the filters, ignoring limit and offset"
},
"limit": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"offset": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
}
},
"required": [
"items",
"total",
"limit",
"offset"
],
"additionalProperties": false
}
}
contacts.get
Get a contact
Read one contact by id with role, email, phone numbers, preferred channel and the account name.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
firstNamerequired | string | |
lastNamerequired | string | |
rolerequired | string | null | Job title or role at the customer, for example Plant manager |
emailrequired | string | null | |
mobilerequired | string | null | |
phonerequired | string | null | |
preferredChannelrequired | "email" | "phone" | "text" | |
isPrimaryrequired | boolean | |
hubspotContactIdrequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
accountNamerequired | string |
Example request
curl https://api.cemco.app/v1/ops/contacts.get \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"id"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"role": {
"description": "Job title or role at the customer, for example Plant manager",
"type": [
"string",
"null"
]
},
"email": {
"type": [
"string",
"null"
]
},
"mobile": {
"type": [
"string",
"null"
]
},
"phone": {
"type": [
"string",
"null"
]
},
"preferredChannel": {
"type": "string",
"enum": [
"email",
"phone",
"text"
]
},
"isPrimary": {
"type": "boolean"
},
"hubspotContactId": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"accountName": {
"type": "string"
}
},
"required": [
"id",
"accountId",
"firstName",
"lastName",
"role",
"email",
"mobile",
"phone",
"preferredChannel",
"isPrimary",
"hubspotContactId",
"notes",
"createdAt",
"updatedAt",
"accountName"
],
"additionalProperties": false
}
}
contacts.create
Add a contact to an account
Create a contact on an account. Fails with a conflict error naming the existing contact if another contact already uses the same email (case-insensitive).
Input (object)
| Field | Type | Description |
|---|---|---|
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
firstNamerequired | string | min length 1, max length 100 |
lastName | string | default "", max length 100 |
role | string | null | Job title or role, for example Plant managermax length 100 |
email | string (email) | null | Unique across all contacts, compared case-insensitivelymax length 254 |
mobile | string | null | max length 40 |
phone | string | null | max length 40 |
preferredChannel | "email" | "phone" | "text" | How this person prefers to be reacheddefault "email" |
isPrimary | boolean | Primary contact for the account; setting it clears the flag on the othersdefault false |
hubspotContactId | string | null | max length 60 |
notes | string | null | max length 20000 |
Output (object)
| Field | Type | Description |
|---|---|---|
contactrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
firstNamerequired | string | |
lastNamerequired | string | |
rolerequired | string | null | Job title or role at the customer, for example Plant manager |
emailrequired | string | null | |
mobilerequired | string | null | |
phonerequired | string | null | |
preferredChannelrequired | "email" | "phone" | "text" | |
isPrimaryrequired | boolean | |
hubspotContactIdrequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/contacts.create \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"accountId":"00000000-0000-4000-8000-000000000000","firstName":"example"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"firstName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"lastName": {
"default": "",
"type": "string",
"maxLength": 100
},
"role": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
],
"description": "Job title or role, for example Plant manager"
},
"email": {
"anyOf": [
{
"type": "string",
"maxLength": 254,
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
{
"type": "null"
}
],
"description": "Unique across all contacts, compared case-insensitively"
},
"mobile": {
"anyOf": [
{
"type": "string",
"maxLength": 40
},
{
"type": "null"
}
]
},
"phone": {
"anyOf": [
{
"type": "string",
"maxLength": 40
},
{
"type": "null"
}
]
},
"preferredChannel": {
"default": "email",
"type": "string",
"enum": [
"email",
"phone",
"text"
],
"description": "How this person prefers to be reached"
},
"isPrimary": {
"default": false,
"type": "boolean",
"description": "Primary contact for the account; setting it clears the flag on the others"
},
"hubspotContactId": {
"anyOf": [
{
"type": "string",
"maxLength": 60
},
{
"type": "null"
}
]
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
}
},
"required": [
"accountId",
"firstName"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"contact": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"role": {
"description": "Job title or role at the customer, for example Plant manager",
"type": [
"string",
"null"
]
},
"email": {
"type": [
"string",
"null"
]
},
"mobile": {
"type": [
"string",
"null"
]
},
"phone": {
"type": [
"string",
"null"
]
},
"preferredChannel": {
"type": "string",
"enum": [
"email",
"phone",
"text"
]
},
"isPrimary": {
"type": "boolean"
},
"hubspotContactId": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
}
},
"required": [
"id",
"accountId",
"firstName",
"lastName",
"role",
"email",
"mobile",
"phone",
"preferredChannel",
"isPrimary",
"hubspotContactId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"contact"
],
"additionalProperties": false
}
}
contacts.update
Update a contact
Change fields on a contact; only the fields you send are changed. Changing the email re-runs the duplicate check. Send accountId to move the contact to another account.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountId | string | Record id (UUID)min length 1, max length 64 |
firstName | string | min length 1, max length 100 |
lastName | string | max length 100 |
role | string | null | Job title or role, for example Plant managermax length 100 |
email | string (email) | null | Unique across all contacts, compared case-insensitivelymax length 254 |
mobile | string | null | max length 40 |
phone | string | null | max length 40 |
preferredChannel | "email" | "phone" | "text" | How this person prefers to be reached |
isPrimary | boolean | Primary contact for the account; setting it clears the flag on the others |
hubspotContactId | string | null | max length 60 |
notes | string | null | max length 20000 |
Output (object)
| Field | Type | Description |
|---|---|---|
contactrequired | object | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
accountIdrequired | string | Record id (UUID)min length 1, max length 64 |
firstNamerequired | string | |
lastNamerequired | string | |
rolerequired | string | null | Job title or role at the customer, for example Plant manager |
emailrequired | string | null | |
mobilerequired | string | null | |
phonerequired | string | null | |
preferredChannelrequired | "email" | "phone" | "text" | |
isPrimaryrequired | boolean | |
hubspotContactIdrequired | string | null | |
notesrequired | string | null | |
createdAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
updatedAtrequired | string (date-time) | UTC timestamp, ISO 8601 with Z |
Example request
curl https://api.cemco.app/v1/ops/contacts.update \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"firstName": {
"type": "string",
"minLength": 1,
"maxLength": 100
},
"lastName": {
"type": "string",
"maxLength": 100
},
"role": {
"anyOf": [
{
"type": "string",
"maxLength": 100
},
{
"type": "null"
}
],
"description": "Job title or role, for example Plant manager"
},
"email": {
"anyOf": [
{
"type": "string",
"maxLength": 254,
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
{
"type": "null"
}
],
"description": "Unique across all contacts, compared case-insensitively"
},
"mobile": {
"anyOf": [
{
"type": "string",
"maxLength": 40
},
{
"type": "null"
}
]
},
"phone": {
"anyOf": [
{
"type": "string",
"maxLength": 40
},
{
"type": "null"
}
]
},
"preferredChannel": {
"type": "string",
"enum": [
"email",
"phone",
"text"
],
"description": "How this person prefers to be reached"
},
"isPrimary": {
"type": "boolean",
"description": "Primary contact for the account; setting it clears the flag on the others"
},
"hubspotContactId": {
"anyOf": [
{
"type": "string",
"maxLength": 60
},
{
"type": "null"
}
]
},
"notes": {
"anyOf": [
{
"type": "string",
"maxLength": 20000
},
{
"type": "null"
}
]
}
},
"required": [
"id"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"contact": {
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"accountId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"role": {
"description": "Job title or role at the customer, for example Plant manager",
"type": [
"string",
"null"
]
},
"email": {
"type": [
"string",
"null"
]
},
"mobile": {
"type": [
"string",
"null"
]
},
"phone": {
"type": [
"string",
"null"
]
},
"preferredChannel": {
"type": "string",
"enum": [
"email",
"phone",
"text"
]
},
"isPrimary": {
"type": "boolean"
},
"hubspotContactId": {
"type": [
"string",
"null"
]
},
"notes": {
"type": [
"string",
"null"
]
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
"description": "UTC timestamp, ISO 8601 with Z"
}
},
"required": [
"id",
"accountId",
"firstName",
"lastName",
"role",
"email",
"mobile",
"phone",
"preferredChannel",
"isPrimary",
"hubspotContactId",
"notes",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"required": [
"contact"
],
"additionalProperties": false
}
}
contacts.delete
Delete a contact
Remove a contact. Activities, tickets and orders that mention the contact are kept and simply lose the link. Fails with a conflict if the contact has a portal login; remove the portal user first.
Input (object)
| Field | Type | Description |
|---|---|---|
idrequired | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
okrequired | true | |
idrequired | string | Record id (UUID)min length 1, max length 64 |
Example request
curl https://api.cemco.app/v1/ops/contacts.delete \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{"id":"00000000-0000-4000-8000-000000000000"}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"id"
]
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"const": true
},
"id": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
},
"required": [
"ok",
"id"
],
"additionalProperties": false
}
}
contacts.google_sync
Sync contacts with Google Contacts now
Two-way sync between CRM contacts and one staff user's Google Contacts (the caller by default). Pulls changes made in Google to linked contacts (name, email, phones, job title) into the CRM, links Google contacts that share an email with a CRM contact, then pushes new and changed CRM contacts to Google. Contacts deleted in Google are unlinked, never deleted from the CRM. Returns connected false, and changes nothing, until the user connects Google Contacts. Runs every 15 minutes on its own.
Input (object)
| Field | Type | Description |
|---|---|---|
userId | string | Staff user to sync; defaults to the caller. Admins only for someone else.min length 1, max length 64 |
maxPush | integer | Most CRM contacts to push in this rundefault 200, min 1, max 500 |
Output (object)
| Field | Type | Description |
|---|---|---|
connectedrequired | boolean | False when the user has not connected Google Contacts; nothing was changed |
pushedrequired | integer | Google contacts created or updated from CRM contactsmin -9007199254740991, max 9007199254740991 |
pulledrequired | integer | CRM contacts updated from changes made in Googlemin -9007199254740991, max 9007199254740991 |
linkedrequired | integer | Existing Google contacts matched to CRM contacts by emailmin -9007199254740991, max 9007199254740991 |
removedrequired | integer | Links dropped because the contact was deleted in Google (the CRM contact is kept)min -9007199254740991, max 9007199254740991 |
remainingrequired | integer | CRM contacts still waiting to be pushed; the next run continuesmin -9007199254740991, max 9007199254740991 |
errorsrequired | object[] | |
contactIdrequired | string | null | Record id (UUID)min length 1, max length 64 |
errorrequired | string |
Example request
curl https://api.cemco.app/v1/ops/contacts.google_sync \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"userId": {
"description": "Staff user to sync; defaults to the caller. Admins only for someone else.",
"type": "string",
"minLength": 1,
"maxLength": 64
},
"maxPush": {
"default": 200,
"description": "Most CRM contacts to push in this run",
"type": "integer",
"minimum": 1,
"maximum": 500
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"connected": {
"type": "boolean",
"description": "False when the user has not connected Google Contacts; nothing was changed"
},
"pushed": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Google contacts created or updated from CRM contacts"
},
"pulled": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "CRM contacts updated from changes made in Google"
},
"linked": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Existing Google contacts matched to CRM contacts by email"
},
"removed": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "Links dropped because the contact was deleted in Google (the CRM contact is kept)"
},
"remaining": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "CRM contacts still waiting to be pushed; the next run continues"
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"contactId": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
},
{
"type": "null"
}
]
},
"error": {
"type": "string"
}
},
"required": [
"contactId",
"error"
],
"additionalProperties": false
}
}
},
"required": [
"connected",
"pushed",
"pulled",
"linked",
"removed",
"remaining",
"errors"
],
"additionalProperties": false
}
}
contacts.google_sync_state
Google Contacts sync status
Whether the caller (or a given staff user) has Google Contacts connected, how many contacts are linked, when sync last ran and the last error.
Input (object)
| Field | Type | Description |
|---|---|---|
userId | string | Record id (UUID)min length 1, max length 64 |
Output (object)
| Field | Type | Description |
|---|---|---|
connectedrequired | boolean | |
linkedCountrequired | integer | min -9007199254740991, max 9007199254740991 |
removedCountrequired | integer | min -9007199254740991, max 9007199254740991 |
waitingCountrequired | integer | CRM contacts new or changed since they were last pushedmin -9007199254740991, max 9007199254740991 |
lastSyncedAtrequired | string | null | |
lastErrorrequired | string | null |
Example request
curl https://api.cemco.app/v1/ops/contacts.google_sync_state \
-H "x-api-key: $CEMCO_API_KEY" \
-H "content-type: application/json" \
-d '{}'
JSON Schema
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"userId": {
"type": "string",
"minLength": 1,
"maxLength": 64,
"description": "Record id (UUID)"
}
}
},
"output": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"connected": {
"type": "boolean"
},
"linkedCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"removedCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"waitingCount": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991,
"description": "CRM contacts new or changed since they were last pushed"
},
"lastSyncedAt": {
"type": [
"string",
"null"
]
},
"lastError": {
"type": [
"string",
"null"
]
}
},
"required": [
"connected",
"linkedCount",
"removedCount",
"waitingCount",
"lastSyncedAt",
"lastError"
],
"additionalProperties": false
}
}