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

  1. Create a temporary API key in Settings > AI > External Connections > API Keys.
  2. Pin leenops-mcp@2.0.4 in the client configuration.
  3. Verify /api/mcp/session.
  4. retrieve /api/mcp/tools/list?includeDenied=true&includeSchemas=true.
  5. Run a permitted read tool.
  6. Explain and run one reversible/disposable write.
  7. verify the result with a read.
  8. 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.

  1. List contacts with GET /api/v1/crm/contacts?page=1&limit=50.
  2. Continue while pagination.hasMore is true.
  3. Store the Leenops contact ID in the external system.
  4. Create only after searching by stable identifiers such as email.
  5. Use company_id or company_name; do not send an undocumented company field.
  6. Verify each write by reading the resulting contact.
  7. Define conflict ownership before implementing bidirectional updates.

See Contacts.

Create a project and task

Scopes: projects.write and issues.write.

  1. Create the project with POST /api/v1/projects.
  2. Save the returned project UUID.
  3. Create the task with POST /api/v1/issues.
  4. Set kind: "task" and the saved project_id.
  5. Verify with GET /api/v1/issues?kind=task&project_id=<uuid>.
  6. 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.

  1. For a trusted backend, create a key with tickets.write.
  2. POST name, email, subject, optional description, and optional type to /api/public/tickets.
  3. Let the key determine the workspace; do not expose the key in browser code.
  4. Store the returned public ticket reference.
  5. Use the public capability-token flow for customer tracking and replies.

See Support Developer API.

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.

  1. Grant only booking access.
  2. Retrieve tools with features=bookings.
  3. Read booking-link availability first.
  4. Create a disposable booking using the returned schema.
  5. Verify it appears in the booking list.
  6. 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

  1. Create a module-specific subscription in its settings UI or documented API.
  2. Save the one-time secret.
  3. Accept the raw request body.
  4. reject timestamps outside a five-minute replay window.
  5. Verify HMAC-SHA256 over <timestamp>.<raw-body>.
  6. Deduplicate on X-Leenops-Delivery-Id.
  7. Return 2xx within 10 seconds.
  8. Process longer work asynchronously.
  9. Use the test-delivery action.
  10. 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