Integration Recipes
Safe end-to-end recipes for common Leenops REST and MCP integrations.
These recipes show the integration sequence, not merely an isolated request. Use disposable records during testing.
Connect an AI assistant through MCP
- Create a temporary API key in Settings > AI > External Connections > API Keys.
- Pin
leenops-mcp@2.0.4in the client configuration. - Verify
/api/mcp/session. - retrieve
/api/mcp/tools/list?includeDenied=true&includeSchemas=true. - Run a permitted read tool.
- Explain and run one reversible/disposable write.
- verify the result with a read.
- remove the test record and revoke the key.
Full client configurations: MCP Server.
Synchronize CRM contacts
Recommended REST scope: contacts.read for export-only or contacts.write for synchronization.
- List contacts with
GET /api/v1/crm/contacts?page=1&limit=50. - Continue while
pagination.hasMoreis true. - Store the Leenops contact ID in the external system.
- Create only after searching by stable identifiers such as email.
- Use
company_idorcompany_name; do not send an undocumentedcompanyfield. - Verify each write by reading the resulting contact.
- Define conflict ownership before implementing bidirectional updates.
See Contacts.
Create a project and task
Scopes: projects.write and issues.write.
- Create the project with
POST /api/v1/projects. - Save the returned project UUID.
- Create the task with
POST /api/v1/issues. - Set
kind: "task"and the savedproject_id. - Verify with
GET /api/v1/issues?kind=task&project_id=<uuid>. - Delete test tasks before deleting the project.
Do not send target_date on projects or labels during task creation; those strict schemas reject unknown fields.
Create a support ticket from a form
Use the Support public API, not /api/v1/issues, for customer-facing intake.
- For a trusted backend, create a key with
tickets.write. - POST
name,email,subject, optionaldescription, and optionaltypeto/api/public/tickets. - Let the key determine the workspace; do not expose the key in browser code.
- Store the returned public ticket reference.
- Use the public capability-token flow for customer tracking and replies.
Create and manage a booking
For an AI integration, prefer the bookings MCP feature because its live tool schemas are complete for the deployed registry.
- Grant only booking access.
- Retrieve tools with
features=bookings. - Read booking-link availability first.
- Create a disposable booking using the returned schema.
- Verify it appears in the booking list.
- Cancel the test booking using the documented tool schema.
The REST booking routes exist, but remain matrix-only and should not be guessed from the route names.
Build a webhook receiver
- Create a module-specific subscription in its settings UI or documented API.
- Save the one-time secret.
- Accept the raw request body.
- reject timestamps outside a five-minute replay window.
- Verify HMAC-SHA256 over
<timestamp>.<raw-body>. - Deduplicate on
X-Leenops-Delivery-Id. - Return
2xxwithin 10 seconds. - Process longer work asynchronously.
- Use the test-delivery action.
- Account for daily production queue draining.
See Webhooks.
Production handoff checklist
- Dedicated key and owner recorded
- Minimal scopes
- Expiry/rotation plan
- Secret stored outside source control
- Read and write smoke tests recorded
- Cleanup completed
- Retry budget bounded
- Idempotency/deduplication implemented
- Monitoring excludes secrets
- Escalation contact:
support@leenops.com

