Dashboard
Real-time overview
Activity
Recent Requests
| Time | Type | Method | Path | Status | Duration |
|---|---|---|---|---|---|
| Waiting for requests... | |||||
Request Log
Full request/response history with payload details.
| Time | Type | Method | Path | Status | Duration | Size | |
|---|---|---|---|---|---|---|---|
| Loading... | |||||||
TCP / UDP Proxies
Stream-level proxies (TCP, UDP, TLS). Used for SIP/VoIP and other non-HTTP protocols. Each profile can listen on multiple transports and forward to a single upstream.
| Name | Status | Listeners | Upstream | Transport | |
|---|---|---|---|---|---|
| Loading... | |||||
Webhooks
Fan-out incoming payloads to multiple destination URLs.
| Name | Status | Port | Targets | Auth | In-Flight | |
|---|---|---|---|---|---|---|
| Loading... | ||||||
Destinations
Fan-out destinations configured for this webhook.
| On | Destination | Sends when | Retry | Test payload | |
|---|---|---|---|---|---|
| No destinations. | |||||
Chat Connectors
Bridge digital channels (WhatsApp, generic JSON) into contact center sessions and fan agent replies back out.
| Name | Status | Channel | Port | Replies To | Activity | |
|---|---|---|---|---|---|---|
| Loading... | ||||||
Integration guide: Docs → GoContact connector.
HTTP Proxies
Reverse proxies with auth injection — expose any HTTP upstream on a dedicated port with credentials hidden from clients.
| Name | Status | Port | Target URL | Auth Header | Access | Blocked Ext. | |
|---|---|---|---|---|---|---|---|
| Loading... | |||||||
Users
Every account: dashboard admins, proxy users, and LDAP-backed identities. Promote a user to admin via Edit.
| Name | Email / Username | Role | 2FA | Created | |
|---|---|---|---|---|---|
| Loading... | |||||
OAuth Clients
External applications (Supabase, etc.) that authenticate users via Midleman as the OAuth2/OIDC provider.
| Name | Client ID | Redirect URIs | Created | Access | |
|---|---|---|---|---|---|
| Loading... | |||||
OIDC endpoints, client settings and token payloads are in Docs → OAuth & OIDC.
Docs
Integration reference for this Midleman instance. Endpoints shown here are the live values of this installation.
No section matches your search.
OAuth & OIDC
Midleman is an OAuth 2.0 / OpenID Connect provider. Register the app under OAuth Clients, then configure it with the discovery URL.
Endpoints
———————Client settings
| Flow | Authorization code. Implicit and password grants are not supported. |
| PKCE | S256, required by default. Disable per client only for legacy apps that cannot send a code_challenge. |
| Client authentication | client_secret_post or client_secret_basic. The secret is shown once, when the client is created. |
| Scopes | openid profile email offline_access, space-separated. openid is always added. |
| User identifier | preferred_username (the login name). Use sub only for an opaque ID. Do not change it once users have signed in. |
| Redirect URI | Exact string match — no wildcards, no #fragment. The first one on a real host (not localhost) also provides the app logo on the sign-in screen. |
| Logout | /oauth/logout?client_id=…&post_logout_redirect_uri=… ends the session. The browser returns to post_logout_redirect_uri when it is on the same origin as a registered redirect URI, otherwise to the home of the first redirect URI on a real host. Nothing to configure. |
| Single sign-on | A user signed in to one client is signed in to every client they may use, until logout or session expiry. |
Example — Portainer
Authorization URL https://<issuer>/oauth/authorize Access token URL https://<issuer>/oauth/token Resource URL https://<issuer>/oauth/userinfo Logout URL https://<issuer>/oauth/logout Redirect URL https://<portainer-host>/ (no #!/home) User identifier preferred_username Scopes openid profile email Use PKCE on (Portainer 2.20+)
Tokens & payloads
What the token, userinfo and error responses look like.
Authorization-code exchange
{
"access_token": "<JWT>",
"id_token": "<JWT>",
"token_type": "Bearer",
"expires_in": 86400,
"scope": "openid profile email",
"refresh_token": "<opaque>"
}
access_token and id_token are the same RS256 JWT — verify it with the JWKS endpoint. Authorization codes are single-use, valid for 90 seconds and bound to the client, redirect URI and code challenge.
JWT claims
{
"iss": "<issuer>",
"sub": "<uuid-v5 derived from midleman_uid>",
"aud": "<client_id>",
"iat": 1730000000,
"exp": 1730086400,
"midleman_uid": 42,
"preferred_username": "jdoe",
"email": "jdoe@example.com", // with the "email" scope
"email_verified": true,
"name": "John Doe", // with the "profile" scope
"nonce": "<client-supplied>" // when the authorize request had one
}
Userinfo
{
"sub": "<uuid>",
"preferred_username": "jdoe",
"email": "jdoe@example.com",
"email_verified": true,
"name": "John Doe",
"midleman_uid": 42
}
Refresh
POST /oauth/token with grant_type=refresh_token returns the same shape with a new refresh_token. Refresh tokens are single-use and rotate on every call; reusing an old one revokes the whole token family. Changing a client's redirect URIs revokes all of its refresh tokens.
Errors
{
"error": "invalid_grant",
"error_description": "Authorization code expired or already used"
}
HTTP proxies
Each proxy listens on its own port and forwards every path to its target, injecting the configured auth header so upstream credentials never reach the client.
GET https://<host>:<proxy-port>/v1/messages → forwarded to <target-url>/v1/messages (+ Authorization: App <secret>)
Access modes
| Access key | API clients send the key in the X-Mid-Api-Key header (removed before forwarding). Browsers can open ?key=<key> once: Midleman strips it from the URL and keeps a cookie scoped to that proxy. |
| Login | Users sign in on the proxy's own /auth/login page with their Midleman or LDAP account and 2FA. |
| Public | Anyone who reaches the port can call it. Restrict with Allowed IPs and Rate limit. |
curl https://<host>:<proxy-port>/v1/status \ -H "X-Mid-Api-Key: <access-key>"
Responses from Midleman
401 | Missing or wrong access key / no login session. |
403 | Caller IP not allowed, or the path ends in a blocked extension. |
429 | Rate limit exceeded. |
502 | The target could not be reached. |
Other options
| CORS | Answers preflight requests and adds Access-Control-* headers only for the allowed origins. |
| Request log | Full, errors only or off per proxy. Traffic totals for the dashboard chart are counted in every mode. Failed requests can be resent from the request log. |
Webhooks
A webhook listens on its own port, accepts a payload once and delivers it to every enabled destination, with retries.
POST https://<host>:<webhook-port>/any/path
X-Forward-Token: <auth-token>
Content-Type: application/json
{ "event": "payment.completed", "order": { "id": 123, "total": 50 } }
# response
202 Accepted
Authentication
When the webhook has an auth token, send it in the X-Forward-Token header or as ?token=. A wrong or missing token gets 401. Allowed IPs can restrict callers further.
Meta (WhatsApp / Facebook / Instagram) verification
Set the callback URL to https://<host>:<webhook-port>/?token=<auth-token> and use the same value as Meta's Verify token. Midleman answers the hub.challenge handshake automatically.
Delivery
| Body template | Reshape the payload per destination with {{path.to.field}}, e.g. {"id": "{{order.id}}", "amount": {{order.total}}}. |
| Conditions | Each destination can filter on payload fields; several conditions combine with AND or OR. |
| Enable / disable | A destination can be paused without deleting it. |
| Failed deliveries | Go to the dead-letter queue, where they can be resent, dismissed or cancelled — one by one or all at once. |
| Retries | maxRetries, retryDelayMs, backoff (exponential or fixed). By default retries on 429, 502, 503, 504; retry until success retries any non-2xx. |
Five9 connector
Links a digital channel to a Five9 Digital Engagement conversation. The conversation is created on the first message and reused until it ends; agent replies arrive through the Five9 callback.
Generic channel — inbound
POST to the connector port, any path, with the Verify token as ?token= or X-Forward-Token. Files are downloaded by Midleman and uploaded to Five9.
POST http://<host>:<port>/?token=SECRET
Content-Type: application/json
{ "chatId": "244939609354", "name": "John", "text": "Hello" }
# response
{ "status": "accepted", "messages": 1, "requestId": "..." }
Session lifecycle and bot → human handover
- First message of a
chatId→ Midleman authenticates anonymously, creates a Five9 conversation and uses that message'stextas the question the agent sees. - Next messages with the same
chatId→ reuse the session. - Expired or closed session → the next message starts a new conversation.
- Business hours → outside the configured hours the customer gets the business-hours message; the message is only passed on to Five9 when forward to Five9 is on.
For a bot → human handover, send the conversation summary as the first message — there is no separate endpoint:
POST http://<host>:<port>/?token=SECRET
Content-Type: application/json
{ "chatId": "244939609354", "name": "John Smith",
"text": "Customer wants to cancel contract 12345. Identity already confirmed by the bot." }
Five9 callback and events
Five9 sends agent replies to the connector's Callback URL. Midleman checks the token, finds the session by correlationId and fans out to your webhook targets and/or the customer via Meta/Smooch.
https://<host>:<connector-port>/any-path?token=CALLBACK_TOKEN
{
"connector": "name", "channel": "generic",
"event": "agent_message", // or "agent_joined" | "chat_closed"
"chatId": "244939609354", "displayName": "John Smith",
"message": {
"uuid": "dedup-id", "text": "Hi! How can I help?",
"timestamp": 1234567890000, "agentName": "Mary",
"userType": "AGENT",
"file": null // or { url, filename, mimetype, size }
}
}
// chat_closed → message: null, "reason": "agent" | "expired"
Answer 2xx to acknowledge and deduplicate by message.uuid — Five9 can resend an event.
GoContact connector
Links a digital channel (Meta WhatsApp, Smooch/Sunshine or generic JSON) to a GoContact webchat session and returns the agent's replies. Mode is poll or webchat-api; the channel is independent of the mode.
Generic channel — inbound
POST to the connector port, any path. If a Verify token is set, send it as ?token= or in the X-Forward-Token header.
POST http://<host>:<port>/?token=SECRET
Content-Type: application/json
// plain text
{ "chatId": "244939609354", "name": "John", "text": "Hello" }
// with a file (Midleman downloads it and sends it to the contact center)
{ "chatId": "244939609354", "name": "John",
"file": { "url": "https://.../photo.jpg", "filename": "photo.jpg", "mimetype": "image/jpeg" } }
// several messages at once
{ "messages": [ { "chatId": "c1", "text": "hi" }, { "chatId": "c2", "text": "hello" } ] }
// response
{ "status": "accepted", "messages": 1, "requestId": "..." }
Accepted aliases: chatId = idChat / from · name = displayName · text = message / mensagem. Each message needs text or file.
Agent replies
Enable Direct reply (Meta/Smooch — delivered straight to the customer) and/or add Webhook targets (Midleman POSTs the event). The generic channel only supports webhook targets.
POST <your-webhook>
X-Connector: connector-name
{
"connector": "connector-name",
"channel": "generic",
"event": "agent_message", // or "agent_joined" | "chat_closed"
"chatId": "customer-244939609354",
"displayName": "John",
"message": {
"uuid": "unique-id", "text": "How can I help?",
"timestamp": 1781700000000, "agentName": "Mary",
"userType": "AGENT",
"file": null // or { url, filename, mimetype, size }
}
}
// chat_closed → message: null + "reason": "agent" | "admin" | "expired"
Answer 2xx to acknowledge. agent_message is at-least-once (retried on failure) — deduplicate by message.uuid. chat_closed: 3 attempts, then the dead-letter queue.
Bot → human handover (with history)
Creates the GoContact conversation with the chat history. webchat-api mode only; same auth as inbound.
POST http://<host>:<port>/handover?token=SECRET
Content-Type: application/json
{
"chatId": "customer-244939609354",
"name": "John",
"phoneNumberId": "879847985208219", // routes replies on Meta
"history": [
{ "from": "client", "text": "I want to talk to a human", "timestamp": 1781700000000 },
{ "from": "bot", "text": "Sure, transferring you.", "timestamp": 1781700001000 }
]
}
// response
{ "status": "ok", "conversationUuid": "…", "contactId": "…", "historyCount": 2 }
from: "bot" is marked as BOT, anything else as CLIENT. Up to 100 messages (the most recent are kept), text only.
Meta WhatsApp / Smooch
Meta: the Verify token answers the hub.challenge handshake; the full envelope, a bare value or an array of them is accepted. Smooch: validated with X-Smooch-Signature. Several connectors can share one Meta feed — each filters by its Phone number filter (phone_number_id).
https://<host>:<port>/?token=VERIFY_TOKEN
webchat-api mode — callback and URLs
GoContact pushes agent replies to Midleman. Register this URL in GoContact; the Callback token protects it.
https://<host>:<port>/gocontact/callback?token=CALLBACK_TOKEN
API base URL (eu.ds.gocontact.com) serves the whole API. Base URL (the instance) only serves attachments in webchat-api mode. loginFields are detected automatically; override them in Login field mapping.
Attachments by mode
poll: any file type is uploaded to the GoContact instance storage. webchat-api: the API only accepts jpg / png / pdf from the customer. Agent attachments are served by the instance at <Base URL>/storage/webchat-attachments/….
Report feeds API
Report feeds are served on the report API port. Authenticate with an API key in X-API-Key, Authorization: Bearer <key> or ?apiKey=<key>.
// Feed without a group GET /reports/:name X-API-Key: <api-key> // Grouped feed GET /reports/:group/:slug // Detail (needs detail.idField on the feed) GET /reports/:group/:slug/:id GET /reports/:name/:id // Audio stream GET /reports/:group/:slug/:id/audio
// Exact match GET /reports/:group/:slug?agentName=John // Typed operators (?field__op=value) GET /reports/:group/:slug?startDate__gte=2026-01-01&startDate__lte=2026-01-31 GET /reports/:group/:slug?talkTime__gte=60&direction__contains=inbound
GET /reports/docs?apiKey=<key> all feeds GET /reports/:group/docs?apiKey=<key> one group GET /reports/openapi.json machine-readable spec
Consent Pages
Library of reusable pages. OAuth clients and proxy profiles reference them by name instead of duplicating the text.
| Name | Title | Updated | |
|---|---|---|---|
| Loading... | |||
LDAP / Active Directory
External directories used to authenticate admins and/or profile users. Multiple servers can run in parallel.
| Name | URL | Base DN | Scope | 2FA | Status | |
|---|---|---|---|---|---|---|
| Loading... | ||||||
Notes
- Scope: admin → dashboard login only; proxy → profile users only; both → both.
- 2FA: required enforces TOTP on first login; optional allows skipping; disabled ignores it. LDAP admins always require TOTP.
- The bind admin password is encrypted with AES-256-GCM using a key derived from the JWT RSA key.
- The filter must contain
{login}. Default coversuid,mailandsAMAccountName.
Notifications
Define recipient groups and the rules that decide which events reach them. Events are matched by category and severity; channels default to email for info/warning and email + SMS for critical, with optional per-rule overrides.
Nginx Proxy Manager
Manage proxy hosts, certificates and HTTPS termination from inside Midleman. Optional addon — Midleman keeps working without it.
Report Feeds
Fetch GoContact reports and expose them as a JSON API with configurable field mapping and API key auth.
| Name | Template | Owner Type | Date Range | Cache | Last Fetch | |
|---|---|---|---|---|---|---|
| Loading... | ||||||
Activity Log
Consumer API (auth, routes, filters, Swagger): Docs → Report feeds API.
Audit Log
History of administrative actions — who did what, when, and from where.
| When | Actor | Action | Target | IP | |
|---|---|---|---|---|---|
| Loading... | |||||
Log Storage
Request-log retention, what gets captured, and manual clean-up of the SQLite database. Per-resource overrides live in each proxy, webhook and connector editor.
Retention & capture
REQUEST_LOG_RETENTION_DAYS (7).
Clean up now
Rows by type
| Type | Rows | Errors | Share |
|---|---|---|---|
| — | |||
System Alerts
Every error and warning raised by the backend — including background jobs that never touch a request. Identical failures are grouped and counted.
| Last seen | Sev | Source | Message | Count | |
|---|---|---|---|---|---|
| Loading... | |||||