Skip to content

Emails and reminders

Generated at build time from packages/core/src/operations/notifications.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.

notifications.outbox

List emails sent by the CRM

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

Emails the CRM has queued or sent: order status updates, portal invites, parts shipping notices, low-stock alerts and warranty reminders, with status queued, sent, failed or skipped (skipped means outbound email is not configured). Filter by account, template or status.

Input (object)

FieldTypeDescription
accountIdstringRecord id (UUID)min length 1, max length 64
template"order_stage_changed" | "portal_invite" | "quote_signed" | "service_request_received" | "ticket_status_changed" | "parts_order_shipped" | "low_stock_alert" | "warranty_expiring" | "check_in_due" | "opportunity_handed_to_sales" | "service_due" | "contract_renewal" | "accounts_not_contacted"
status"queued" | "sent" | "failed" | "skipped"
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
templaterequired"order_stage_changed" | "portal_invite" | "quote_signed" | "service_request_received" | "ticket_status_changed" | "parts_order_shipped" | "low_stock_alert" | "warranty_expiring" | "check_in_due" | "opportunity_handed_to_sales" | "service_due" | "contract_renewal" | "accounts_not_contacted"
toAddressrequiredstring
subjectrequiredstring
bodyTextrequiredstring
statusrequired"queued" | "sent" | "failed" | "skipped"
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
entityTyperequired"account" | "contact" | "site" | "order" | "product" | "machine" | "ticket" | "warranty_claim" | "part" | "parts_order" | "document" | "activity" | "task" | "check_in" | "opportunity" | "service_plan" | "service_contract" | "training_record" | "import_run" | "user" | "portal_invite" | "customer_user" | "calendar_feed" | "stock_movement" | "email" | null
entityIdrequiredstring | null
errorrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
sentAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
totalrequiredintegerTotal rows matching the filters, ignoring limit and offsetmin 0, max 9007199254740991
limitrequiredintegermin -9007199254740991, max 9007199254740991
offsetrequiredintegermin -9007199254740991, max 9007199254740991
emailConfiguredrequiredboolean
Example request
                curl https://api.cemco.app/v1/ops/notifications.outbox \
  -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)"
      },
      "template": {
        "type": "string",
        "enum": [
          "order_stage_changed",
          "portal_invite",
          "quote_signed",
          "service_request_received",
          "ticket_status_changed",
          "parts_order_shipped",
          "low_stock_alert",
          "warranty_expiring",
          "check_in_due",
          "opportunity_handed_to_sales",
          "service_due",
          "contract_renewal",
          "accounts_not_contacted"
        ]
      },
      "status": {
        "type": "string",
        "enum": [
          "queued",
          "sent",
          "failed",
          "skipped"
        ]
      },
      "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)"
            },
            "template": {
              "type": "string",
              "enum": [
                "order_stage_changed",
                "portal_invite",
                "quote_signed",
                "service_request_received",
                "ticket_status_changed",
                "parts_order_shipped",
                "low_stock_alert",
                "warranty_expiring",
                "check_in_due",
                "opportunity_handed_to_sales",
                "service_due",
                "contract_renewal",
                "accounts_not_contacted"
              ]
            },
            "toAddress": {
              "type": "string"
            },
            "subject": {
              "type": "string"
            },
            "bodyText": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "queued",
                "sent",
                "failed",
                "skipped"
              ]
            },
            "accountId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "entityType": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "account",
                    "contact",
                    "site",
                    "order",
                    "product",
                    "machine",
                    "ticket",
                    "warranty_claim",
                    "part",
                    "parts_order",
                    "document",
                    "activity",
                    "task",
                    "check_in",
                    "opportunity",
                    "service_plan",
                    "service_contract",
                    "training_record",
                    "import_run",
                    "user",
                    "portal_invite",
                    "customer_user",
                    "calendar_feed",
                    "stock_movement",
                    "email"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            },
            "entityId": {
              "type": [
                "string",
                "null"
              ]
            },
            "error": {
              "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"
            },
            "sentAt": {
              "anyOf": [
                {
                  "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"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "id",
            "template",
            "toAddress",
            "subject",
            "bodyText",
            "status",
            "accountId",
            "entityType",
            "entityId",
            "error",
            "createdAt",
            "sentAt"
          ],
          "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
      },
      "emailConfigured": {
        "type": "boolean"
      }
    },
    "required": [
      "items",
      "total",
      "limit",
      "offset",
      "emailConfigured"
    ],
    "additionalProperties": false
  }
}
            

notifications.retry

Retry a failed email

Kind
Write (audited)
Who
Staff: admin
MCP tool
notifications_retry

Queue a failed or skipped email for sending again.

Input (object)

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

Output (object)

FieldTypeDescription
emailrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
templaterequired"order_stage_changed" | "portal_invite" | "quote_signed" | "service_request_received" | "ticket_status_changed" | "parts_order_shipped" | "low_stock_alert" | "warranty_expiring" | "check_in_due" | "opportunity_handed_to_sales" | "service_due" | "contract_renewal" | "accounts_not_contacted"
toAddressrequiredstring
subjectrequiredstring
bodyTextrequiredstring
statusrequired"queued" | "sent" | "failed" | "skipped"
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
entityTyperequired"account" | "contact" | "site" | "order" | "product" | "machine" | "ticket" | "warranty_claim" | "part" | "parts_order" | "document" | "activity" | "task" | "check_in" | "opportunity" | "service_plan" | "service_contract" | "training_record" | "import_run" | "user" | "portal_invite" | "customer_user" | "calendar_feed" | "stock_movement" | "email" | null
entityIdrequiredstring | null
errorrequiredstring | null
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
sentAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/notifications.retry \
  -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": {
      "email": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          "template": {
            "type": "string",
            "enum": [
              "order_stage_changed",
              "portal_invite",
              "quote_signed",
              "service_request_received",
              "ticket_status_changed",
              "parts_order_shipped",
              "low_stock_alert",
              "warranty_expiring",
              "check_in_due",
              "opportunity_handed_to_sales",
              "service_due",
              "contract_renewal",
              "accounts_not_contacted"
            ]
          },
          "toAddress": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "bodyText": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "sent",
              "failed",
              "skipped"
            ]
          },
          "accountId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "entityType": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "account",
                  "contact",
                  "site",
                  "order",
                  "product",
                  "machine",
                  "ticket",
                  "warranty_claim",
                  "part",
                  "parts_order",
                  "document",
                  "activity",
                  "task",
                  "check_in",
                  "opportunity",
                  "service_plan",
                  "service_contract",
                  "training_record",
                  "import_run",
                  "user",
                  "portal_invite",
                  "customer_user",
                  "calendar_feed",
                  "stock_movement",
                  "email"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "entityId": {
            "type": [
              "string",
              "null"
            ]
          },
          "error": {
            "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"
          },
          "sentAt": {
            "anyOf": [
              {
                "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"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "template",
          "toAddress",
          "subject",
          "bodyText",
          "status",
          "accountId",
          "entityType",
          "entityId",
          "error",
          "createdAt",
          "sentAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "email"
    ],
    "additionalProperties": false
  }
}
            

notifications.run_daily

Run the daily reminders

Kind
Write (audited)
Who
Internal only (system)

Internal (cron): finds warranties entering the 60-day window, check-ins and preventive maintenance due, service contracts up for renewal, pre-season calls to schedule, expired portal invites, low stock and accounts not contacted in 90 days, and queues the matching emails and tasks. Safe to run more than once a day.

Input (object)

FieldTypeDescription
todaystring (date)

Output (object)

FieldTypeDescription
warrantyAlertsrequiredintegermin -9007199254740991, max 9007199254740991
checkInRemindersrequiredintegermin -9007199254740991, max 9007199254740991
serviceRemindersrequiredintegermin -9007199254740991, max 9007199254740991
lowStockAlertsrequiredintegermin -9007199254740991, max 9007199254740991
invitesExpiredrequiredintegermin -9007199254740991, max 9007199254740991
idempotencyKeysPurgedrequiredintegerIdempotency keys older than a week that were forgottenmin -9007199254740991, max 9007199254740991
preSeasonCallsrequiredintegerPre-season check-ins created for the coming seasonmin -9007199254740991, max 9007199254740991
contractRenewalsrequiredintegerService contract renewal reminders queuedmin -9007199254740991, max 9007199254740991
notContactedDigestsrequiredintegerWeekly digests of accounts not contacted in 90 days queuedmin -9007199254740991, max 9007199254740991
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "today": {
        "type": "string",
        "format": "date",
        "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])))$"
      }
    }
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "warrantyAlerts": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "checkInReminders": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "serviceReminders": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "lowStockAlerts": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "invitesExpired": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      },
      "idempotencyKeysPurged": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991,
        "description": "Idempotency keys older than a week that were forgotten"
      },
      "preSeasonCalls": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991,
        "description": "Pre-season check-ins created for the coming season"
      },
      "contractRenewals": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991,
        "description": "Service contract renewal reminders queued"
      },
      "notContactedDigests": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991,
        "description": "Weekly digests of accounts not contacted in 90 days queued"
      }
    },
    "required": [
      "warrantyAlerts",
      "checkInReminders",
      "serviceReminders",
      "lowStockAlerts",
      "invitesExpired",
      "idempotencyKeysPurged",
      "preSeasonCalls",
      "contractRenewals",
      "notContactedDigests"
    ],
    "additionalProperties": false
  }
}