Skip to content

Portal invites and portal users

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

portal_invites.create

Invite a customer to the portal

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

Invite a person at a customer to the portal. Emails them a link (valid 14 days) to set a password; once accepted their login is tied to this one account and they see only its orders, machines and documents. Give contactId to invite an existing contact, or an email and name. Inviting an email that already has a pending invite re-sends it.

Input (object)

FieldTypeDescription
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
contactIdstringRecord id (UUID)min length 1, max length 64
emailstring (email)max length 254
namestringmin length 1, max length 200
sendEmailbooleandefault true

Output (object)

FieldTypeDescription
inviterequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
statusrequired"pending" | "accepted" | "revoked" | "expired"
expiresAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
invitedByNamerequiredstring
acceptedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
inviteUrlrequiredstringLink the customer opens to accept; also emailed when sendEmail is true
emailQueuedrequiredboolean
resentrequiredboolean
Example request
                curl https://api.cemco.app/v1/ops/portal_invites.create \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"accountId":"00000000-0000-4000-8000-000000000000","contactId":"00000000-0000-4000-8000-000000000000"}'
              
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)"
      },
      "contactId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "email": {
        "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,}$"
      },
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "sendEmail": {
        "default": true,
        "type": "boolean"
      }
    },
    "required": [
      "accountId"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "invite": {
        "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)"
          },
          "accountName": {
            "type": "string"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "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,}$"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "revoked",
              "expired"
            ]
          },
          "expiresAt": {
            "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"
          },
          "invitedByName": {
            "type": "string"
          },
          "acceptedAt": {
            "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"
              }
            ]
          },
          "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"
          }
        },
        "required": [
          "id",
          "accountId",
          "accountName",
          "contactId",
          "email",
          "name",
          "status",
          "expiresAt",
          "invitedByName",
          "acceptedAt",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "inviteUrl": {
        "type": "string",
        "description": "Link the customer opens to accept; also emailed when sendEmail is true"
      },
      "emailQueued": {
        "type": "boolean"
      },
      "resent": {
        "type": "boolean"
      }
    },
    "required": [
      "invite",
      "inviteUrl",
      "emailQueued",
      "resent"
    ],
    "additionalProperties": false
  }
}
            

portal_invites.list

List portal invites

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

Portal invitations for one account or all accounts, with status pending, accepted, revoked or expired.

Input (object)

FieldTypeDescription
accountIdstringRecord id (UUID)min length 1, max length 64
status"pending" | "accepted" | "revoked" | "expired"

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
statusrequired"pending" | "accepted" | "revoked" | "expired"
expiresAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
invitedByNamerequiredstring
acceptedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/portal_invites.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)"
      },
      "status": {
        "type": "string",
        "enum": [
          "pending",
          "accepted",
          "revoked",
          "expired"
        ]
      }
    }
  },
  "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)"
            },
            "accountName": {
              "type": "string"
            },
            "contactId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "email": {
              "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,}$"
            },
            "name": {
              "type": "string"
            },
            "status": {
              "type": "string",
              "enum": [
                "pending",
                "accepted",
                "revoked",
                "expired"
              ]
            },
            "expiresAt": {
              "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"
            },
            "invitedByName": {
              "type": "string"
            },
            "acceptedAt": {
              "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"
                }
              ]
            },
            "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"
            }
          },
          "required": [
            "id",
            "accountId",
            "accountName",
            "contactId",
            "email",
            "name",
            "status",
            "expiresAt",
            "invitedByName",
            "acceptedAt",
            "createdAt"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "items"
    ],
    "additionalProperties": false
  }
}
            

portal_invites.revoke

Revoke a portal invite

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

Cancel a pending portal invitation so its link stops working.

Input (object)

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

Output (object)

FieldTypeDescription
inviterequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
statusrequired"pending" | "accepted" | "revoked" | "expired"
expiresAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
invitedByNamerequiredstring
acceptedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/portal_invites.revoke \
  -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": {
      "invite": {
        "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)"
          },
          "accountName": {
            "type": "string"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "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,}$"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "revoked",
              "expired"
            ]
          },
          "expiresAt": {
            "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"
          },
          "invitedByName": {
            "type": "string"
          },
          "acceptedAt": {
            "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"
              }
            ]
          },
          "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"
          }
        },
        "required": [
          "id",
          "accountId",
          "accountName",
          "contactId",
          "email",
          "name",
          "status",
          "expiresAt",
          "invitedByName",
          "acceptedAt",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "invite"
    ],
    "additionalProperties": false
  }
}
            

portal_invites.list_users

List portal users

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

Customer logins for one account or all accounts, with when each was last seen.

Input (object)

FieldTypeDescription
accountIdstringRecord id (UUID)min length 1, max length 64
includeInactivebooleandefault false

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/portal_invites.list_users \
  -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)"
      },
      "includeInactive": {
        "default": false,
        "type": "boolean"
      }
    }
  },
  "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)"
            },
            "accountName": {
              "type": "string"
            },
            "contactId": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64,
                  "description": "Record id (UUID)"
                },
                {
                  "type": "null"
                }
              ]
            },
            "email": {
              "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,}$"
            },
            "name": {
              "type": "string"
            },
            "active": {
              "type": "boolean"
            },
            "lastSeenAt": {
              "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"
                }
              ]
            },
            "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"
            }
          },
          "required": [
            "id",
            "accountId",
            "accountName",
            "contactId",
            "email",
            "name",
            "active",
            "lastSeenAt",
            "createdAt"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "items"
    ],
    "additionalProperties": false
  }
}
            

portal_invites.set_user_active

Turn a portal user's access off or on

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

Deactivate a customer's portal login (signing them out) or reactivate it.

Input (object)

FieldTypeDescription
customerUserIdrequiredstringRecord id (UUID)min length 1, max length 64
activerequiredboolean

Output (object)

FieldTypeDescription
userrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
Example request
                curl https://api.cemco.app/v1/ops/portal_invites.set_user_active \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"customerUserId":"00000000-0000-4000-8000-000000000000","active":true}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "customerUserId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "description": "Record id (UUID)"
      },
      "active": {
        "type": "boolean"
      }
    },
    "required": [
      "customerUserId",
      "active"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "user": {
        "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)"
          },
          "accountName": {
            "type": "string"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "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,}$"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "lastSeenAt": {
            "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"
              }
            ]
          },
          "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"
          }
        },
        "required": [
          "id",
          "accountId",
          "accountName",
          "contactId",
          "email",
          "name",
          "active",
          "lastSeenAt",
          "createdAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "user"
    ],
    "additionalProperties": false
  }
}
            

portal_invites.lookup

Look up an invite token

Kind
Read
Who
Internal only (system)

Internal: validates an invite token for the accept-invite page and returns who it is for.

Input (object)

FieldTypeDescription
tokenrequiredstringmin length 1, max length 200

Output (object)

FieldTypeDescription
validrequiredboolean
reasonrequired"ok" | "not_found" | "expired" | "revoked" | "accepted"
emailrequiredstring | null
namerequiredstring | null
accountNamerequiredstring | null
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "token": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      }
    },
    "required": [
      "token"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "valid": {
        "type": "boolean"
      },
      "reason": {
        "type": "string",
        "enum": [
          "ok",
          "not_found",
          "expired",
          "revoked",
          "accepted"
        ]
      },
      "email": {
        "type": [
          "string",
          "null"
        ]
      },
      "name": {
        "type": [
          "string",
          "null"
        ]
      },
      "accountName": {
        "type": [
          "string",
          "null"
        ]
      }
    },
    "required": [
      "valid",
      "reason",
      "email",
      "name",
      "accountName"
    ],
    "additionalProperties": false
  }
}
            

portal_invites.accept

Accept a portal invite

Kind
Write (audited)
Who
Internal only (system)

Internal: accepts an invite token. Creates the portal login in the auth service (with the chosen password), links it to the invite's account in customer_users and marks the invite accepted.

Input (object)

FieldTypeDescription
tokenrequiredstringmin length 1, max length 200
namestringmin length 1, max length 200
passwordstringOmit for magic-link-only sign-inmin length 10, max length 200

Output (object)

FieldTypeDescription
userrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
accountIdrequiredstringRecord id (UUID)min length 1, max length 64
accountNamerequiredstring
contactIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
emailrequiredstring
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "token": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "password": {
        "description": "Omit for magic-link-only sign-in",
        "type": "string",
        "minLength": 10,
        "maxLength": 200
      }
    },
    "required": [
      "token"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "user": {
        "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)"
          },
          "accountName": {
            "type": "string"
          },
          "contactId": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "description": "Record id (UUID)"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "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,}$"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean"
          },
          "lastSeenAt": {
            "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"
              }
            ]
          },
          "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"
          }
        },
        "required": [
          "id",
          "accountId",
          "accountName",
          "contactId",
          "email",
          "name",
          "active",
          "lastSeenAt",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "email": {
        "type": "string"
      }
    },
    "required": [
      "user",
      "email"
    ],
    "additionalProperties": false
  }
}