Skip to content

Developer docs

Agent Platform API

Give an AI agent scoped, bearer-key access to one tenant's services, availability, bookings, customers, and CRM — over REST or MCP.

What this is

The Mawidi Agent Platform lets an external AI agent — a voice assistant, a chat concierge, a coding or orchestration agent, or anything else that can make HTTPS calls — read and manage one tenant's data on that tenant's behalf. Every call is authenticated with a bearer API key minted from the tenant's dashboard. There is no cookie or session authority on this surface, and no CORS headers are ever emitted — the credential is a header a browser never attaches on its own.

35 operationsacross 27 paths

Authentication

Every REST and MCP call carries the same bearer key. A missing, malformed, unknown, revoked, or expired key gets the same 401 response in every case, so the response alone never tells a caller which of those it was.

Header
Authorization: Bearer mwd_live_<key>
Base URL
https://mawidi.com/api/agent/v1
Local development
http://localhost:9000/api/agent/v1

Getting a key

Keys are minted from the dashboard, not from this API. Sign in as an organization owner or admin, create a named agent client, choose its scopes, and issue a key. The full key is shown exactly once, at creation — only a prefix is shown again afterward.

Open Agent access settings →

Scopes

A key's scopes are fixed at issuance and can only be narrowed or revoked afterward, never widened. Pick the narrowest set a client actually needs; a key missing a required scope gets 403 insufficient_scope.

ScopeUsed by
audit.readGET /audit/receipts
availability.readGET /availability
bookings.readGET /bookings, GET /bookings/{id}, GET /bookings/changes
bookings.read.orgGET /bookings, GET /bookings/{id}, GET /bookings/changes
bookings.writePOST /bookings, PATCH /bookings/{id}
business_hours.readGET /config/business-hours
business_hours.writePOST /config/business-hours
conversations.readGET /conversations
customers.readGET /customers/list
customers.writePOST /customers
knowledge.readGET /config/knowledge
knowledge.writePOST /config/knowledge
leads.deleteDELETE /leads/{id}
leads.readGET /leads, GET /leads/{id}, GET /leads/{id}/activities
leads.writePOST /leads, POST /leads/{id}/notes, POST /leads/{id}/stage, POST /leads/{id}/status
messages.sendPOST /conversations/{id}/replies
orders.readGET /orders
org_settings.readGET /config/settings
org_settings.writePOST /config/settings
payments.linkPOST /payments/links
payments.refundPOST /payments/refunds
pipeline.readGET /pipeline/stages
real_estate.readGET /properties
service_jobs.readGET /service-jobs
services.readGET /config/services, GET /services
services.writePOST /config/services
voice_agent.readGET /config/voice-agent

Operations

Every REST operation, grouped by resource. The full machine-readable contract, including request and response schemas, is the OpenAPI spec linked below.

+ = requires all of, / = requires any one of

Services

The tenant's bookable service catalogue.

MethodPathSummaryRequired scope
GET/servicesList bookable servicesservices.read

Availability

Open slot computation, sharing the exact grid the write path enforces.

MethodPathSummaryRequired scope
GET/availabilityGet open slots for one serviceavailability.read

Bookings

Create, read, list, reschedule, cancel, and poll changes to bookings.

MethodPathSummaryRequired scope
GET/bookingsList bookings in a date rangebookings.read / bookings.read.org
POST/bookingsCreate a bookingbookings.write
GET/bookings/{id}Get one bookingbookings.read / bookings.read.org
PATCH/bookings/{id}Reschedule or cancel a bookingbookings.write
GET/bookings/changesPull the booking change feedbookings.read / bookings.read.org

Customers

Enumeration-safe find-or-create by phone number, and the masked customer book.

MethodPathSummaryRequired scope
POST/customersFind or create a customer by phonecustomers.write
GET/customers/listList the customer bookcustomers.read

Orders

Order state and payment/fulfilment status. Never the tenant's Stripe handles.

MethodPathSummaryRequired scope
GET/ordersList ordersorders.read

Service Jobs

Field-service jobs, their trade and scheduled window. Never the service address.

MethodPathSummaryRequired scope
GET/service-jobsList service jobsservice_jobs.read

Real Estate

Property listings in both languages. Never access notes or coordinates.

MethodPathSummaryRequired scope
GET/propertiesList property listingsreal_estate.read

Conversations

Conversation thread headers. Never message bodies.

MethodPathSummaryRequired scope
GET/conversationsList conversation threadsconversations.read

Leads

The tenant's CRM leads and their activity log. Masked contact, no free text, no email.

MethodPathSummaryRequired scope
GET/leadsList leadsleads.read
POST/leadsCreate a leadleads.write
DELETE/leads/{id}Propose permanently deleting a leadleads.delete
GET/leads/{id}Get one leadleads.read
GET/leads/{id}/activitiesList one lead's activity headersleads.read
POST/leads/{id}/notesAdd a note to a leadleads.write
POST/leads/{id}/stageMove a lead to a pipeline stageleads.write
POST/leads/{id}/statusSet a lead's statusleads.write

Pipeline

Pipeline stage configuration — no customer data to mask.

MethodPathSummaryRequired scope
GET/pipeline/stagesList pipeline stage configurationpipeline.read

Config

Tenant configuration: service catalogue management, business hours, organization settings, the WhatsApp AI knowledge base, and a derived voice-agent summary. Every credential, billing, auth and retention field is withheld; no delete.

MethodPathSummaryRequired scope
GET/config/business-hoursList business hoursbusiness_hours.read
POST/config/business-hoursSet one weekday's business hoursbusiness_hours.write
GET/config/knowledgeList knowledge-base entriesknowledge.read
POST/config/knowledgeCreate or update a knowledge-base entryknowledge.write
GET/config/servicesList service configuration (management view)services.read
POST/config/servicesCreate or update a serviceservices.write
GET/config/settingsGet organization settingsorg_settings.read
POST/config/settingsUpdate organization settingsorg_settings.write
GET/config/voice-agentGet voice-agent configurationvoice_agent.read

Audit

This API client's own per-capability usage receipts, for reconciliation and audit export. Never another client's rows, never organization-wide. No SLA/uptime reporting.

MethodPathSummaryRequired scope
GET/audit/receiptsList this API client's own usage receiptsaudit.read

Messages

Replies to customers, proposed by the agent and sent only after the business owner approves each one. WhatsApp only, inside the customer's 24-hour window, never to a customer who opted out.

MethodPathSummaryRequired scope
POST/conversations/{id}/repliesPropose a WhatsApp reply (sent only after owner approval)messages.send

Payments

Refunds and payment links for a booking, on the business's own Stripe account. Every call waits for the owner's approval after an identity check; nothing moves until then.

MethodPathSummaryRequired scope
POST/payments/linksAsk for a payment link for a booking (owner approval required)payments.link
POST/payments/refundsAsk to refund a booking's or an order's payment (owner approval required)payments.refund

MCP endpoint

The same operations are also reachable as MCP tools over one JSON-RPC 2.0 endpoint, authenticated with the same bearer key. tools/list returns only the tools a key's scopes actually cover.

Endpoint
/api/agent/mcp