Skip to content

Staff users, roles and API keys

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

users.me

Who am I

Kind
Read
Who
Staff: admin, editor, viewer; Customers (portal), scoped to their own account
MCP tool
users_me

The caller's own identity: name, email, role and, for portal users, their account. Also lists the operations the caller may use.

Input (empty object)

No input. Send {}.

Output (object)

FieldTypeDescription
kindrequired"staff" | "customer" | "agent" | "system"
userIdrequiredstring
emailrequiredstring
namerequiredstring
rolerequired"admin" | "editor" | "viewer" | "customer"
accountIdrequiredstring | nullRecord id (UUID)min length 1, max length 64
accountNamerequiredstring | null
allowedOperationsrequiredstring[]
Example request
                curl https://api.cemco.app/v1/ops/users.me \
  -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": {}
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "kind": {
        "type": "string",
        "enum": [
          "staff",
          "customer",
          "agent",
          "system"
        ]
      },
      "userId": {
        "type": "string"
      },
      "email": {
        "type": "string"
      },
      "name": {
        "type": "string"
      },
      "role": {
        "type": "string",
        "enum": [
          "admin",
          "editor",
          "viewer",
          "customer"
        ]
      },
      "accountId": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "description": "Record id (UUID)"
          },
          {
            "type": "null"
          }
        ]
      },
      "accountName": {
        "type": [
          "string",
          "null"
        ]
      },
      "allowedOperations": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "kind",
      "userId",
      "email",
      "name",
      "role",
      "accountId",
      "accountName",
      "allowedOperations"
    ],
    "additionalProperties": false
  }
}
            

users.list

List staff users

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

Cemco staff with access to the CRM, their roles (admin, editor, viewer) and when they were last seen.

Input (object)

FieldTypeDescription
includeInactivebooleandefault false

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstringRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
rolerequired"admin" | "editor" | "viewer"
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
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/users.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": {
      "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)"
            },
            "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"
            },
            "role": {
              "type": "string",
              "enum": [
                "admin",
                "editor",
                "viewer"
              ]
            },
            "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"
            },
            "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",
            "email",
            "name",
            "role",
            "active",
            "lastSeenAt",
            "createdAt",
            "updatedAt"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "items"
    ],
    "additionalProperties": false
  }
}
            

users.invite

Add a staff user

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

Give a Cemco colleague access before their first sign-in by adding their work email with a role. The email must be on the staff domain. They sign in with Google or an email code; no password is set here.

Input (object)

FieldTypeDescription
emailrequiredstring (email)max length 254
namerequiredstringmin length 1, max length 200
role"admin" | "editor" | "viewer"default "viewer"

Output (object)

FieldTypeDescription
userrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
rolerequired"admin" | "editor" | "viewer"
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
updatedAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
createdrequiredboolean
Example request
                curl https://api.cemco.app/v1/ops/users.invite \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"email":"name@example.com","name":"example"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "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
      },
      "role": {
        "default": "viewer",
        "type": "string",
        "enum": [
          "admin",
          "editor",
          "viewer"
        ]
      }
    },
    "required": [
      "email",
      "name"
    ]
  },
  "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)"
          },
          "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"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "editor",
              "viewer"
            ]
          },
          "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"
          },
          "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",
          "email",
          "name",
          "role",
          "active",
          "lastSeenAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "created": {
        "type": "boolean"
      }
    },
    "required": [
      "user",
      "created"
    ],
    "additionalProperties": false
  }
}
            

users.set_role

Change a staff user's role

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

Set a staff user's role to admin, editor or viewer. The last active admin cannot be demoted.

Input (object)

FieldTypeDescription
idrequiredstringRecord id (UUID)min length 1, max length 64
rolerequired"admin" | "editor" | "viewer"

Output (object)

FieldTypeDescription
userrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
rolerequired"admin" | "editor" | "viewer"
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
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/users.set_role \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"id":"00000000-0000-4000-8000-000000000000","role":"admin"}'
              
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)"
      },
      "role": {
        "type": "string",
        "enum": [
          "admin",
          "editor",
          "viewer"
        ]
      }
    },
    "required": [
      "id",
      "role"
    ]
  },
  "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)"
          },
          "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"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "editor",
              "viewer"
            ]
          },
          "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"
          },
          "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",
          "email",
          "name",
          "role",
          "active",
          "lastSeenAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "user"
    ],
    "additionalProperties": false
  }
}
            

users.set_active

Deactivate or reactivate a staff user

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

Turn a staff user's access off (signing them out everywhere) or back on. The last active admin cannot be deactivated. History and audit entries are kept.

Input (object)

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

Output (object)

FieldTypeDescription
userrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
rolerequired"admin" | "editor" | "viewer"
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
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/users.set_active \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"id":"00000000-0000-4000-8000-000000000000","active":true}'
              
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)"
      },
      "active": {
        "type": "boolean"
      }
    },
    "required": [
      "id",
      "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)"
          },
          "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"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "editor",
              "viewer"
            ]
          },
          "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"
          },
          "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",
          "email",
          "name",
          "role",
          "active",
          "lastSeenAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "user"
    ],
    "additionalProperties": false
  }
}
            

users.update_profile

Update my profile

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

Change the display name shown for the caller on records, the audit log and emails.

Input (object)

FieldTypeDescription
namerequiredstringmin length 1, max length 200

Output (object)

FieldTypeDescription
userrequiredobject
idrequiredstringRecord id (UUID)min length 1, max length 64
emailrequiredstring (email)max length 254
namerequiredstring
rolerequired"admin" | "editor" | "viewer"
activerequiredboolean
lastSeenAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
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/users.update_profile \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"example"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      }
    },
    "required": [
      "name"
    ]
  },
  "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)"
          },
          "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"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "editor",
              "viewer"
            ]
          },
          "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"
          },
          "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",
          "email",
          "name",
          "role",
          "active",
          "lastSeenAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "user"
    ],
    "additionalProperties": false
  }
}
            

users.list_api_keys

List API keys

Kind
Read
Who
Staff: admin
MCP tool
users_list_api_keys

API keys issued to agents and scripts, with the role each acts as. Secrets are never shown again after creation.

Input (empty object)

No input. Send {}.

Output (object)

FieldTypeDescription
itemsrequiredobject[]
idrequiredstring
namerequiredstring
prefixrequiredstring
rolerequired"admin" | "editor" | "viewer"
ownerEmailrequiredstring
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
lastUsedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
expiresAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
revokedrequiredboolean
Example request
                curl https://api.cemco.app/v1/ops/users.list_api_keys \
  -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": {}
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "items": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "prefix": {
              "type": "string"
            },
            "role": {
              "type": "string",
              "enum": [
                "admin",
                "editor",
                "viewer"
              ]
            },
            "ownerEmail": {
              "type": "string"
            },
            "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"
            },
            "lastUsedAt": {
              "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"
                }
              ]
            },
            "expiresAt": {
              "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"
                }
              ]
            },
            "revoked": {
              "type": "boolean"
            }
          },
          "required": [
            "id",
            "name",
            "prefix",
            "role",
            "ownerEmail",
            "createdAt",
            "lastUsedAt",
            "expiresAt",
            "revoked"
          ],
          "additionalProperties": false
        }
      }
    },
    "required": [
      "items"
    ],
    "additionalProperties": false
  }
}
            

users.create_api_key

Create an API key

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

Issue an API key for an agent or script that will act with the given staff role. The secret is returned once; store it safely.

Input (object)

FieldTypeDescription
namerequiredstringWhat the key is for, for example Email filing agentmin length 1, max length 100
role"admin" | "editor" | "viewer"default "editor"
expiresInDaysintegermin 1, max 3650

Output (object)

FieldTypeDescription
keyrequiredstringThe secret; shown only now
inforequiredobject
idrequiredstring
namerequiredstring
prefixrequiredstring
rolerequired"admin" | "editor" | "viewer"
ownerEmailrequiredstring
createdAtrequiredstring (date-time)UTC timestamp, ISO 8601 with Z
lastUsedAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
expiresAtrequiredstring (date-time) | nullUTC timestamp, ISO 8601 with Z
revokedrequiredboolean
Example request
                curl https://api.cemco.app/v1/ops/users.create_api_key \
  -H "x-api-key: $CEMCO_API_KEY" \
  -H "content-type: application/json" \
  -d '{"name":"example"}'
              
JSON Schema
              {
  "input": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100,
        "description": "What the key is for, for example Email filing agent"
      },
      "role": {
        "default": "editor",
        "type": "string",
        "enum": [
          "admin",
          "editor",
          "viewer"
        ]
      },
      "expiresInDays": {
        "type": "integer",
        "minimum": 1,
        "maximum": 3650
      }
    },
    "required": [
      "name"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "key": {
        "type": "string",
        "description": "The secret; shown only now"
      },
      "info": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "editor",
              "viewer"
            ]
          },
          "ownerEmail": {
            "type": "string"
          },
          "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"
          },
          "lastUsedAt": {
            "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"
              }
            ]
          },
          "expiresAt": {
            "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"
              }
            ]
          },
          "revoked": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "role",
          "ownerEmail",
          "createdAt",
          "lastUsedAt",
          "expiresAt",
          "revoked"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "key",
      "info"
    ],
    "additionalProperties": false
  }
}
            

users.revoke_api_key

Revoke an API key

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

Stop an API key working immediately. Anything still using the key gets an unauthorized error.

Input (object)

FieldTypeDescription
idrequiredstringmin length 1

Output (object)

FieldTypeDescription
okrequiredtrue
idrequiredstring
Example request
                curl https://api.cemco.app/v1/ops/users.revoke_api_key \
  -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
      }
    },
    "required": [
      "id"
    ]
  },
  "output": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "ok": {
        "type": "boolean",
        "const": true
      },
      "id": {
        "type": "string"
      }
    },
    "required": [
      "ok",
      "id"
    ],
    "additionalProperties": false
  }
}