Skip to content

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

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
contacts_list

List contacts, optionally for one account or matching a name, email or phone number. Each row includes the account name.

Input (object)

FieldTypeDescription
accountIdstringRecord id (UUID)min length 1, max length 64
querystringMatches name, email, mobile or phonemax length 200
limitintegerMaximum rows to return (default 50, max 500)default 50, min 1, max 500
offsetintegerRows to skip, for pagingdefault 0, min 0, max 9007199254740991

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
firstNamerequiredstring
lastNamerequiredstring
rolerequiredstring | nullJob title or role at the customer, for example Plant manager
emailrequiredstring | null
mobilerequiredstring | null
phonerequiredstring | null
preferredChannelrequired"email" | "phone" | "text"
isPrimaryrequiredboolean
hubspotContactIdrequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
totalrequiredintegerTotal rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991
limitrequiredintegermin -9007199254740991, max 9007199254740991
offsetrequiredintegermin -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

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
contacts_get

Read one contact by id with role, email, phone numbers, preferred channel and the account name.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64

Output (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
firstNamerequiredstring
lastNamerequiredstring
rolerequiredstring | nullJob title or role at the customer, for example Plant manager
emailrequiredstring | null
mobilerequiredstring | null
phonerequiredstring | null
preferredChannelrequired"email" | "phone" | "text"
isPrimaryrequiredboolean
hubspotContactIdrequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
accountNamerequiredstring
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

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
contacts_create

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)

FieldTypeDescription
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
firstNamerequiredstringmin length 1, max length 100
lastNamestringdefault "", max length 100
rolestring | nullJob title or role, for example Plant managermax length 100
emailstring (email) | nullUnique across all contacts, compared case-insensitivelymax length 254
mobilestring | nullmax length 40
phonestring | nullmax length 40
preferredChannel"email" | "phone" | "text"How this person prefers to be reacheddefault "email"
isPrimarybooleanPrimary contact for the account; setting it clears the flag on the othersdefault false
hubspotContactIdstring | nullmax length 60
notesstring | nullmax length 20000

Output (object)

FieldTypeDescription
contactrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
firstNamerequiredstring
lastNamerequiredstring
rolerequiredstring | nullJob title or role at the customer, for example Plant manager
emailrequiredstring | null
mobilerequiredstring | null
phonerequiredstring | null
preferredChannelrequired"email" | "phone" | "text"
isPrimaryrequiredboolean
hubspotContactIdrequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (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

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
contacts_update

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)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdstringRecord id (UUID)min length 1, max length 64
firstNamestringmin length 1, max length 100
lastNamestringmax length 100
rolestring | nullJob title or role, for example Plant managermax length 100
emailstring (email) | nullUnique across all contacts, compared case-insensitivelymax length 254
mobilestring | nullmax length 40
phonestring | nullmax length 40
preferredChannel"email" | "phone" | "text"How this person prefers to be reached
isPrimarybooleanPrimary contact for the account; setting it clears the flag on the others
hubspotContactIdstring | nullmax length 60
notesstring | nullmax length 20000

Output (object)

FieldTypeDescription
contactrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
firstNamerequiredstring
lastNamerequiredstring
rolerequiredstring | nullJob title or role at the customer, for example Plant manager
emailrequiredstring | null
mobilerequiredstring | null
phonerequiredstring | null
preferredChannelrequired"email" | "phone" | "text"
isPrimaryrequiredboolean
hubspotContactIdrequiredstring | null
notesrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (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

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
contacts_delete

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)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64

Output (object)

FieldTypeDescription
okrequiredtrue
idrequiredstringRecord 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

Kind
Write (audited)
Who
Staff: admin, editor
MCP tool
contacts_google_sync

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)

FieldTypeDescription
userIdstringStaff user to sync; defaults to the caller. Admins only for someone else.min length 1, max length 64
maxPushintegerMost CRM contacts to push in this rundefault 200, min 1, max 500

Output (object)

FieldTypeDescription
connectedrequiredbooleanFalse when the user has not connected Google Contacts; nothing was changed
pushedrequiredintegerGoogle contacts created or updated from CRM contactsmin -9007199254740991, max 9007199254740991
pulledrequiredintegerCRM contacts updated from changes made in Googlemin -9007199254740991, max 9007199254740991
linkedrequiredintegerExisting Google contacts matched to CRM contacts by emailmin -9007199254740991, max 9007199254740991
removedrequiredintegerLinks dropped because the contact was deleted in Google (the CRM contact is kept)min -9007199254740991, max 9007199254740991
remainingrequiredintegerCRM contacts still waiting to be pushed; the next run continuesmin -9007199254740991, max 9007199254740991
errorsrequiredobject[]
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
errorrequiredstring
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

Kind
Read
Who
Staff: admin, editor, viewer
MCP tool
contacts_google_sync_state

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)

FieldTypeDescription
userIdstringRecord id (UUID)min length 1, max length 64

Output (object)

FieldTypeDescription
connectedrequiredboolean
linkedCountrequiredintegermin -9007199254740991, max 9007199254740991
removedCountrequiredintegermin -9007199254740991, max 9007199254740991
waitingCountrequiredintegerCRM contacts new or changed since they were last pushedmin -9007199254740991, max 9007199254740991
lastSyncedAtrequiredstring | null
lastErrorrequiredstring | 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
  }
}