Developers

Build on your workspace

Lyfer Chat talks to other systems four ways: an MCP server for AI clients, webhooks out, a web address that starts an automation, and connectors that give the agent tools into your systems.

What's there

  • MCP server

    Streamable HTTP at https://app.lyfer.chat/api/mcp. ChatGPT and Claude sign in with OAuth 2.1; other clients use a workspace key.

  • Webhooks out

    Signed POSTs when a message arrives or is sent, when the agent queues something for a person, hands a chat over, or misses one.

  • Start an automation

    Each automation started by a webhook has its own secret address. Post JSON with the customer's phone number and fields to fill in.

  • Connectors

    Give the agent tools: your own MCP server, or one web request such as a Zapier, Make or n8n webhook. You decide which tools always ask first.

MCP

The server is at https://app.lyfer.chat/api/mcp: Streamable HTTP answered as plain JSON, with initialize, ping, tools/list and tools/call.

  • ChatGPT and the Claude apps discover sign-in from the server's metadata (RFC 9728 and RFC 8414), use the authorization code flow with PKCE, and get an access token for an hour and a refresh token for 60 days.
  • Claude Code, Codex and other clients send a workspace key: Authorization: Bearer apk_… An admin makes one under Agent → Connect, read only or able to act. Only its SHA-256 is stored.
  • The tools are the agent's own: chats, messages, memory, skills, follow-ups, the calendar and automations. A read-only connection gets only the ones that read.
  • What a client writes goes through the workspace's permission mode, as the agent's own work does.

Webhooks

An admin adds up to five webhook addresses under Agent → Connect and chooses the events: message.received, message.sent, agent.waiting, chat.handed_over and agent.missed.

  • Each delivery is signed: X-Lyfer-Signature: t=<unix time>,v1=<hex HMAC-SHA256 of "t.body"> with the webhook's whsec_ secret, shown once.
  • At least once, in order for each webhook. Retried after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours. Answer any 2xx within 10 seconds.
  • Deliveries are kept for 14 days, and an admin can see what was sent and what came back.

Starting an automation from your systems

An automation whose trigger is a webhook has its own address with a secret in it. Post JSON about a customer: Lyfer Chat finds their existing one-to-one chat by phone number, keeps up to ten fields you map as placeholders, and runs the automation. It never opens a chat with a stranger because another system said so.

A REST API

Lyfer Chat doesn't offer a public REST API yet. MCP and webhooks are the supported ways in and out. If you need something they don't cover, tell us what.

For AI agents reading this site

A plain-text summary of Lyfer Chat, with links to these pages, is at https://lyfer.chat/llms.txt.

Checking a webhook's signature (Node.js)

verify.js
const [, t, v1] = /^t=(\d+),v1=([0-9a-f]+)$/.exec(request.headers["x-lyfer-signature"]);
const expected = crypto.createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest("hex");
const ok = crypto.timingSafeEqual(Buffer.from(v1, "hex"), Buffer.from(expected, "hex"));