Documentation
Integrations
Dashboard

API Documentation

Inbound connector platform (pull and webhook) for external data ingestion, key mapping, caching, and prompt-template variable resolution.

Integrations
GETintegrationsPOSTintegrationsPATCH:idDELETE:idPOSTtestPOSTsyncPOSTwebhook

Overview

Integrations are inbound connectors (pull and/or webhook) that map external payloads into named output keys. Those keys can be consumed by prompt templates using {{var_name}} tokens.

mode
string
Connector mode: pull, webhook, or both.
output_map
array
Maps response paths (for example current.temperature_2m) to prompt-friendly keys.
allow_live_fetch
boolean
Allows request-time fetch when rendering dynamic prompt variables.
cache_ttl_seconds
number
Cache lifetime for integration values used by prompt runtime.
GET/api/v1/integrations

List integrations for the active project.

Scope:integrations:read
include_inactive
boolean
When true, include disabled integrations.
Request
bash
curl -G "https://www.mnexium.com/api/v1/integrations" \
  -H "x-mnexium-key: $MNX_KEY" \
  --data-urlencode "include_inactive=false"
Response
json
{
  "data": [
    {
      "integration_id": "int_weather_forecast",
      "name": "weather forecast",
      "mode": "pull",
      "scope": "project",
      "allow_live_fetch": true,
      "is_active": true,
      "output_map": [
        { "key": "weather_temp", "path": "current.temperature_2m" },
        { "key": "weather_wind", "path": "current.wind_speed_10m" }
      ]
    }
  ]
}
POST/api/v1/integrations

Create a pull/webhook integration and define output key mappings.

Scope:integrations:write
namerequired
string
Display name.
moderequired
string
One of: pull, webhook, both.
scope
string
One of: project, subject, chat.
endpoint_url
string
Required for pull/both modes.
output_maprequired
array
Array of { key, path, default? } mappings.
auth_secret
string
Optional encrypted secret for upstream auth.
webhook_secret
string
Optional secret used to verify incoming webhook signatures.
Request
bash
curl -X POST "https://www.mnexium.com/api/v1/integrations" \
  -H "x-mnexium-key: $MNX_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "weather forecast",
    "description": "Open-Meteo pull example",
    "mode": "pull",
    "scope": "project",
    "endpoint_url": "https://api.open-meteo.com/v1/forecast",
    "method": "GET",
    "cache_ttl_seconds": 300,
    "allow_live_fetch": true,
    "query_template": {
      "latitude": "40.7128",
      "longitude": "-74.0060",
      "current": "temperature_2m,wind_speed_10m"
    },
    "output_map": [
      { "key": "weather_temp", "path": "current.temperature_2m" },
      { "key": "weather_wind", "path": "current.wind_speed_10m" }
    ]
  }'
POST/api/v1/integrations/:id/test

Run a one-off integration fetch and preview mapped values. Use /sync to refresh cache.

Scope:integrations:write
idrequired
path
Integration ID.
subject_id
string
Optional runtime subject context.
chat_id
string
Optional runtime chat context.
Request
bash
curl -X POST "https://www.mnexium.com/api/v1/integrations/int_weather_forecast/test" \
  -H "x-mnexium-key: $MNX_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
Response
json
{
  "ok": true,
  "values": {
    "weather_temp": 14.1,
    "weather_wind": 13.8
  }
}
POST/api/v1/integrations/:id/webhook

Ingest external webhook data into integration cache using signed requests.

Scope:signature-only (no Mnexium key)
x-mnx-webhook-timestamprequired
header
Unix timestamp used in signature payload.
x-mnx-webhook-signaturerequired
header
HMAC signature generated with the integration webhook secret.
Request
bash
curl -X POST "https://www.mnexium.com/api/v1/integrations/int_weather_forecast/webhook" \
  -H "x-mnx-webhook-timestamp: 1733852431" \
  -H "x-mnx-webhook-signature: sha256=..." \
  -H "Content-Type: application/json" \
  -d '{"current":{"temperature_2m":14.1,"wind_speed_10m":13.8}}'

Prompt Template Binding + Request Trace

Bind integration outputs to system prompt templates using template.variables. Request Trace then exposes both the integration IDs used and each resolved variable source/value.

json
{
  "prompt_text": "Temp: {{temp}} Wind: {{wind}}",
  "template": {
    "enabled": true,
    "variables": {
      "temp": {
        "source": "integration",
        "integration_id": "int_weather_forecast",
        "key": "weather_temp",
        "live_fetch": true
      },
      "wind": {
        "source": "integration",
        "integration_id": "int_weather_forecast",
        "key": "weather_wind",
        "live_fetch": true
      }
    }
  }
}
json
{
  "system_prompt_ids": ["sp_demo_assistant"],
  "integration_ids": ["int_7bb01c4e-7ea6-48b1-892c-edc5ed7382f5"],
  "integration_cache_hit_count": 1,
  "integration_live_fetch_count": 1,
  "integration_failure_count": 0
}

// Integrations tab rows:
// token | integration_id | output_key | source(cached/live/default/empty) | resolved_value