Platform Connections API

Unified platform connection manager for integrating external services like Discord, Slack, and Teams. Connect platforms, configure message ingestion and auto-reply settings, and trigger history imports. All endpoints require JWT authentication.

Base path: /api/v2/platform-connections

GET/api/v2/platform-connectionsAuthenticated

List all connected platforms and available (unconnected) platforms. Connected platforms include synced channels, configuration, and last sync time.

Request

cURL
curl -X GET "https://api.lvng.ai/api/v2/platform-connections" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "connected": [
    {
      "id": "int_abc123",
      "platform": "discord",
      "displayName": "Discord",
      "status": "connected",
      "config": {
        "ingestMessages": true,
        "selectedChannels": ["general", "dev"],
        "autoReply": false
      },
      "channels": [
        { "id": "ch_001", "name": "general", "type": "text" },
        { "id": "ch_002", "name": "dev", "type": "text" }
      ],
      "connectedAt": "2026-03-01T10:00:00.000Z",
      "lastSyncAt": "2026-04-01T12:00:00.000Z"
    }
  ],
  "available": [
    {
      "platform": "slack",
      "displayName": "Slack",
      "status": "available",
      "features": ["messages", "channels", "threads"]
    }
  ]
}
POST/api/v2/platform-connections/:platform/connectAuthenticated

Connect a new platform. Tests the connection if the platform adapter supports it.

Path Parameters

platformstringrequired

Platform identifier (e.g. "discord", "slack", "teams").

Body Parameters

configobject

Platform-specific configuration.

config.ingestMessagesboolean

Whether to ingest messages from this platform. Defaults to false.

config.selectedChannelsstring[]

Channels to sync. Defaults to empty.

config.autoReplyboolean

Whether AI should auto-reply on this platform. Defaults to false.

Request

cURL
curl -X POST "https://api.lvng.ai/api/v2/platform-connections/{platform}/connect" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 201

{
  "id": "int_abc123",
  "platform": "discord",
  "displayName": "Discord",
  "status": "connected",
  "connectionTest": {
    "success": true
  }
}
DELETE/api/v2/platform-connections/:platform/disconnectAuthenticated

Disconnect a platform and remove the integration record.

Path Parameters

platformstringrequired

Platform identifier.

Request

cURL
curl -X DELETE "https://api.lvng.ai/api/v2/platform-connections/{platform}/disconnect" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "platform": "discord",
  "status": "disconnected",
  "disconnectedAt": "2026-04-01T14:00:00.000Z"
}
PATCH/api/v2/platform-connections/:platform/configAuthenticated

Update platform configuration. Only allowed fields (ingestMessages, selectedChannels, autoReply) are accepted.

Path Parameters

platformstringrequired

Platform identifier.

Body Parameters

ingestMessagesboolean

Toggle message ingestion.

selectedChannelsstring[]

Update synced channels.

autoReplyboolean

Toggle auto-reply.

Request

cURL
curl -X PATCH "https://api.lvng.ai/api/v2/platform-connections/{platform}/config" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 200

{
  "platform": "discord",
  "config": {
    "ingestMessages": true,
    "selectedChannels": ["general"],
    "autoReply": true
  },
  "updatedAt": "2026-04-01T14:30:00.000Z"
}
POST/api/v2/platform-connections/:platform/import-historyAuthenticated

Trigger a history import job for a connected platform. Returns a job ID that can be polled for progress.

Path Parameters

platformstringrequired

Platform identifier.

Body Parameters

channelIdsstring[]

Specific channels to import. Imports all if omitted.

sincestring

Start date for import range (ISO 8601).

untilstring

End date for import range (ISO 8601).

Request

cURL
curl -X POST "https://api.lvng.ai/api/v2/platform-connections/{platform}/import-history" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 202

{
  "platform": "discord",
  "jobId": "job_abc123",
  "status": "started",
  "message": "History import started"
}
GET/api/v2/platform-connections/:platform/import-statusAuthenticated

Check the progress of a history import job.

Path Parameters

platformstringrequired

Platform identifier.

Query Parameters

jobIdstringrequired

Job ID returned from the import-history endpoint.

Request

cURL
curl -X GET "https://api.lvng.ai/api/v2/platform-connections/{platform}/import-status" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "platform": "discord",
  "jobId": "job_abc123",
  "status": "in_progress",
  "progress": 65,
  "messagesImported": 1250,
  "totalEstimated": 1920
}