# Customer.lite > Customer messaging automation for indie developers: customer and event APIs, event-driven workflows that send email, and MCP so your AI assistant can create and operate them. Connect an AI assistant to the MCP endpoint `https://dev.customerlite.io/mcp` (Streamable HTTP) with a project API key as a Bearer token. The same actions are REST endpoints under `https://dev.customerlite.io/api`, described by `https://dev.customerlite.io/api/openapi.json`. An action that can start sending email (its errors include `confirmation_invalid`) first answers `confirmation_required` with a `preview` of who would be sent what and a `confirmation` token, and changes nothing. Show the preview to the user and wait for their answer; only if they agree, call again with the same input and `confirmation` set to the token. A retry of a call that succeeded with the token returns its result again; a stale or foreign token answers `confirmation_invalid` (409) with a fresh preview and token. ## API actions - [customers.upsert](https://site.dev.customerlite.io/docs/api/reference/#customersupsert): Create a customer or update its email and attributes. REST `PUT /api/customers/{id}`, MCP tool `customers_upsert`. - [customers.get](https://site.dev.customerlite.io/docs/api/reference/#customersget): Get a customer by its external ID. REST `GET /api/customers/{id}`, MCP tool `customers_get`. - [customers.list](https://site.dev.customerlite.io/docs/api/reference/#customerslist): List the project's customers, the newest created first, a page at a time. Pass a page's `nextCursor` as `cursor` to read the next one; customers created meanwhile do not shift the pages. REST `GET /api/customers`, MCP tool `customers_list`. - [customers.unsubscribe](https://site.dev.customerlite.io/docs/api/reference/#customersunsubscribe): Unsubscribe a customer. Pending sends are rechecked and skipped. REST `POST /api/customers/{id}/unsubscribe`, MCP tool `customers_unsubscribe`. - [events.track](https://site.dev.customerlite.io/docs/api/reference/#eventstrack): Record an event for an existing customer and start the workflows it triggers. Clients that may retry must send an idempotency key; a replay returns the original event ID. REST `POST /api/events`, MCP tool `events_track`. - [events.list](https://site.dev.customerlite.io/docs/api/reference/#eventslist): List the project's events, or one customer's, the newest received first, a page at a time. Pass a page's `nextCursor` as `cursor` to read the next one. An event whose properties' JSON is longer than 2048 characters is listed without them, with `propertiesOmitted` true; no action reads them back yet. REST `GET /api/events`, MCP tool `events_list`. - [workflows.upsert](https://site.dev.customerlite.io/docs/api/reference/#workflowsupsert): Create a workflow, or save a new version of it. Saving does not change the live version: new runs keep starting on it until the workflow is activated again, and started runs keep their version. A send step's `from` is saved with its domain normalized (lower case, no trailing dot, IDNs as A-labels), so spellings of the same domain save as the same version; a `from` whose domain is not a domain name is a validation_error. The `name`, the trigger's `event`, and each send step's `subject` must be one line: a control character (including a line break) or a bidi embedding, override, or isolate in them is a validation_error. With `expectedLatestVersion`, a save that would write is refused with `conflict`, and the latest version in the error's `latestVersion`, unless the workflow's latest version is that one (0: the workflow does not exist yet), so a save based on an older version never replaces a newer one. Only a changed definition makes a new version: a rename alone does not, so the name is not guarded. A save that writes nothing (the same name and definition as the latest version) is answered with the workflow whatever it expects, so a retry of a save that was written is answered with it while no other save followed. REST `PUT /api/workflows/{id}`, MCP tool `workflows_upsert`. - [workflows.activate](https://site.dev.customerlite.io/docs/api/reference/#workflowsactivate): Make the workflow's latest version live, so its trigger starts runs on it. A draft workflow becomes active; on an active workflow this publishes the latest version, and runs already started keep their version. Does nothing if the latest version is already live. A version that sends email goes live only after a person approves it through a link that is not sent to the caller: the workflow is left unchanged and the pending approval is returned in `sendApproval`. Calling again for the same version returns the same approval and sends new links. A version whose send steps' `from` domains are not all verified sending domains of the workspace is refused with `sender_not_verified`, and one in a workspace without approvers with `no_approvers`; no approval is created. If a link could not be mailed to every approver, the call fails with `approval_delivery_failed`; calling again mails new links to those who did not get one. Sends start only on a confirmed call: called without `confirmation`, it changes nothing and answers `confirmation_required` with a `preview` of what would be sent and a token. Show the preview to the user, and only if they agree call again with the same input and `confirmation` set to the token before it expires; the result is then in `result`. A call that would start no sends runs at once and answers `done`. A retry with a used token returns the first result. REST `POST /api/workflows/{id}/activate`, MCP tool `workflows_activate`. - [workflows.list](https://site.dev.customerlite.io/docs/api/reference/#workflowslist): List the project's workflows, the most recently updated first, each with its latest version's trigger, whether it sends email, and the approval it awaits, if any. REST `GET /api/workflows`, MCP tool `workflows_list`. - [workflows.get](https://site.dev.customerlite.io/docs/api/reference/#workflowsget): Get a workflow with the definition of its latest version and the approval that version awaits, if any. The live version's definition is read with workflows.getVersion. REST `GET /api/workflows/{id}`, MCP tool `workflows_get`. - [workflows.listVersions](https://site.dev.customerlite.io/docs/api/reference/#workflowslistversions): List a workflow's saved versions, the newest first, without their definitions: each version's number, definition hash, whether it sends email, and when it was saved. REST `GET /api/workflows/{id}/versions`, MCP tool `workflows_listVersions`. - [workflows.getVersion](https://site.dev.customerlite.io/docs/api/reference/#workflowsgetversion): Get one saved version of a workflow with its definition. REST `GET /api/workflows/{id}/versions/{version}`, MCP tool `workflows_getVersion`. - [sendApprovals.get](https://site.dev.customerlite.io/docs/api/reference/#sendapprovalsget): Get a send approval: the workflow version it lets go live, its status, expiry, and who decided it. REST `GET /api/send-approvals/{id}`, MCP tool `sendApprovals_get`. - [messages.list](https://site.dev.customerlite.io/docs/api/reference/#messageslist): List a customer's messages with their send state and delivery result. REST `GET /api/messages`, MCP tool `messages_list`. - [messages.get](https://site.dev.customerlite.io/docs/api/reference/#messagesget): Get a message with its send state, delivery result, and step log. REST `GET /api/messages/{id}`, MCP tool `messages_get`. - [metrics.get](https://site.dev.customerlite.io/docs/api/reference/#metricsget): Delivery metrics for the project: billable emails, deliveries, bounces, complaints. REST `GET /api/metrics`, MCP tool `metrics_get`. - [workspaces.create](https://site.dev.customerlite.io/docs/api/reference/#workspacescreate): Create a workspace, with the caller as its admin. A user may create a limited number of workspaces. Clients that may retry should send an idempotency key; a replay with the same name returns the workspace the first call created. A replay with another name, or by a creator who is no longer a member of that workspace, answers conflict. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `POST /api/workspaces`, MCP tool `workspaces_create`. - [workspaces.list](https://site.dev.customerlite.io/docs/api/reference/#workspaceslist): List the workspaces the caller is a member of, with the caller's role in each. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `GET /api/workspaces`, MCP tool `workspaces_list`. - [workspaces.get](https://site.dev.customerlite.io/docs/api/reference/#workspacesget): Get the workspace the Customer-Lite-Workspace header selects; the caller must be a member of it. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `GET /api/workspace`, MCP tool `workspaces_get`. - [members.list](https://site.dev.customerlite.io/docs/api/reference/#memberslist): List the members of the workspace the Customer-Lite-Workspace header selects, oldest first, with their addresses and roles. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `GET /api/workspace/members`, MCP tool `members_list`. - [members.add](https://site.dev.customerlite.io/docs/api/reference/#membersadd): Add a user to the workspace the Customer-Lite-Workspace header selects, by the address they sign in with, with a role. The user must have signed in before; no invitation is sent. While anyone may sign in to the installation, it answers forbidden until invitations exist. Adding a member again with the same role returns them, so a retry succeeds; with another role it answers conflict. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `POST /api/workspace/members`, MCP tool `members_add`. - [members.setRole](https://site.dev.customerlite.io/docs/api/reference/#memberssetrole): Set the role of a member of the workspace the Customer-Lite-Workspace header selects. Demoting the workspace's last admin answers conflict: a workspace always keeps an admin. On a self-hosted installation, demoting an installation admin (a user whose address ADMIN_EMAILS lists) answers conflict too. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `PUT /api/workspace/members/{userId}/role`, MCP tool `members_setRole`. - [members.remove](https://site.dev.customerlite.io/docs/api/reference/#membersremove): Remove a member from the workspace the Customer-Lite-Workspace header selects; an admin may remove themselves. Removing the workspace's last admin answers conflict: a workspace always keeps an admin. Removing someone who is not a member answers not_found, so a retry after success does too. On a self-hosted installation, removing an installation admin (a user whose address ADMIN_EMAILS lists) answers conflict too. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `POST /api/workspace/members/{userId}/remove`, MCP tool `members_remove`. - [projects.create](https://site.dev.customerlite.io/docs/api/reference/#projectscreate): Create the project of the workspace the Customer-Lite-Workspace header selects. A workspace has one project for now, so a second answers conflict. Clients that may retry should send an idempotency key; a replay returns the project the first call created. An internal error may leave the project created; retry (with the same key, or without one, which answers conflict) to finish it. The project's ID is what a session names in the Customer-Lite-Project header to call the project actions. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `POST /api/workspace/projects`, MCP tool `projects_create`. - [projects.list](https://site.dev.customerlite.io/docs/api/reference/#projectslist): List the projects of the workspace the Customer-Lite-Workspace header selects, oldest first. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `GET /api/workspace/projects`, MCP tool `projects_list`. - [apiKeys.create](https://site.dev.customerlite.io/docs/api/reference/#apikeyscreate): Create a secret API key (cl_sk_) for the project the Customer-Lite-Project header selects. The key acts on that project with every API scope. Its plaintext is in this response only: it is stored hashed, and every other response shows its prefix and last four characters. Clients that may retry should send an idempotency key; since the plaintext cannot be shown again, a replay answers conflict and names the key the first call created, which the caller can revoke if the plaintext was lost. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `POST /api/api-keys`, MCP tool `apiKeys_create`. - [apiKeys.list](https://site.dev.customerlite.io/docs/api/reference/#apikeyslist): List the API keys of the project the Customer-Lite-Project header selects, revoked ones included, oldest first. Each shows its ID, prefix, and last four characters; never the key. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `GET /api/api-keys`, MCP tool `apiKeys_list`. - [apiKeys.revoke](https://site.dev.customerlite.io/docs/api/reference/#apikeysrevoke): Revoke an API key of the project the Customer-Lite-Project header selects: from the next request on, the key answers unauthorized. Revoking a revoked key returns it unchanged. An ID that names no key of this project answers not_found. Needs a signed-in user's session; an API key or an MCP connection gets forbidden. REST `POST /api/api-keys/{id}/revoke`, MCP tool `apiKeys_revoke`.