Developer API

Developer console endpoints for managing webhooks, viewing per-key API usage, and querying event logs. Webhooks support automatic retries, delivery logs, and test events. All endpoints require JWT authentication.

Base path: /api/v2/developer

API Key Usage

View per-key usage statistics and sparkline data for dashboard charts.

GET/api/v2/developer/api-keys/:id/usageAuthenticated

Get per-key usage sparkline data (requests per day). Verifies the authenticated user owns the key.

Path Parameters

idstringrequired

UUID of the API key.

Query Parameters

daysinteger

Number of days of usage data. Defaults to 7.

Request

cURL
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/api-keys/key_abc123/usage?days=14" \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": {
    400">class="text-emerald-400">"key_id": 400">class="text-emerald-400">"key_abc123",
    400">class="text-emerald-400">"days": 14,
    400">class="text-emerald-400">"sparkline": [12, 8, 15, 23, 19, 31, 28, 14, 9, 22, 35, 18, 27, 20]
  }
}

Webhooks

Create and manage webhook endpoints that receive real-time event notifications. Supported event types: agent.completed, workflow.completed, message.created, credit.low, swarm.spawn, knowledge.indexed.

POST/api/v2/developer/webhooksAuthenticated

Create a new webhook endpoint. A signing secret is generated automatically for verifying payloads.

Body Parameters

urlstringrequired

HTTP/HTTPS URL to receive webhook payloads.

eventsstring[]required

Array of event types to subscribe to.

descriptionstring

Human-readable description of the webhook.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/webhooks \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//myapp.com/webhooks/lvng",
    400">class="text-emerald-400">"events": [400">class="text-emerald-400">"agent.completed", 400">class="text-emerald-400">"workflow.completed"],
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Production webhook for agent completions"
  }'

Response 201

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"wh_abc123",
    400">class="text-emerald-400">"workspace_id": 400">class="text-emerald-400">"ws_abc123",
    400">class="text-emerald-400">"url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//myapp.com/webhooks/lvng",
    400">class="text-emerald-400">"events": [400">class="text-emerald-400">"agent.completed", 400">class="text-emerald-400">"workflow.completed"],
    400">class="text-emerald-400">"signing_secret": 400">class="text-emerald-400">"whsec_a1b2c3d4e5f6...",
    400">class="text-emerald-400">"active": true,
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Production webhook for agent completions",
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-04-01T12:00:00.000Z"
  }
}
GET/api/v2/developer/webhooksAuthenticated

List all webhooks for the current workspace.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/webhooks \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"wh_abc123",
      400">class="text-emerald-400">"url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//myapp.com/webhooks/lvng",
      400">class="text-emerald-400">"events": [400">class="text-emerald-400">"agent.completed", 400">class="text-emerald-400">"workflow.completed"],
      400">class="text-emerald-400">"active": true,
      400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Production webhook for agent completions",
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-04-01T12:00:00.000Z",
      400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-04-01T12:00:00.000Z"
    }
  ]
}
PUT/api/v2/developer/webhooks/:idAuthenticated

Update a webhook's URL, events, active status, or description.

Path Parameters

idstringrequired

UUID of the webhook.

Body Parameters

urlstring

Updated webhook URL.

eventsstring[]

Updated event subscriptions.

activeboolean

Enable or disable the webhook.

descriptionstring

Updated description.

Request

cURL
400">curl -X 400">PUT https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/webhooks/wh_abc123 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"events": [400">class="text-emerald-400">"agent.completed", 400">class="text-emerald-400">"workflow.completed", 400">class="text-emerald-400">"credit.low"],
    400">class="text-emerald-400">"active": true
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"wh_abc123",
    400">class="text-emerald-400">"url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//myapp.com/webhooks/lvng",
    400">class="text-emerald-400">"events": [400">class="text-emerald-400">"agent.completed", 400">class="text-emerald-400">"workflow.completed", 400">class="text-emerald-400">"credit.low"],
    400">class="text-emerald-400">"active": true,
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-04-01T14:00:00.000Z"
  }
}
DELETE/api/v2/developer/webhooks/:idAuthenticated

Delete a webhook endpoint.

Path Parameters

idstringrequired

UUID of the webhook.

Request

cURL
400">curl -X 400">DELETE https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/webhooks/wh_abc123 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"message": 400">class="text-emerald-400">"Webhook deleted"
}
GET/api/v2/developer/webhooks/:id/deliveriesAuthenticated

Get the last 50 delivery attempts for a webhook, including status codes and response data.

Path Parameters

idstringrequired

UUID of the webhook.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/webhooks/wh_abc123/deliveries \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"del_xyz789",
      400">class="text-emerald-400">"webhook_id": 400">class="text-emerald-400">"wh_abc123",
      400">class="text-emerald-400">"event_type": 400">class="text-emerald-400">"agent.completed",
      400">class="text-emerald-400">"status_code": 200,
      400">class="text-emerald-400">"success": true,
      400">class="text-emerald-400">"latency_ms": 145,
      400">class="text-emerald-400">"request_body": { 400">class="text-emerald-400">"event": 400">class="text-emerald-400">"agent.completed", 400">class="text-emerald-400">"data": {} },
      400">class="text-emerald-400">"response_body": 400">class="text-emerald-400">"OK",
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-04-01T13:00:00.000Z"
    }
  ]
}
POST/api/v2/developer/webhooks/:id/testAuthenticated

Send a test.ping event to the webhook endpoint to verify connectivity.

Path Parameters

idstringrequired

UUID of the webhook.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/webhooks/wh_abc123/test \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": {
    400">class="text-emerald-400">"delivered": true,
    400">class="text-emerald-400">"status_code": 200,
    400">class="text-emerald-400">"latency_ms": 132,
    400">class="text-emerald-400">"delivery": {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"del_test123",
      400">class="text-emerald-400">"event_type": 400">class="text-emerald-400">"test.ping"
    }
  }
}

Event Logs

Query paginated, filterable developer event logs. Supports cursor-based pagination.

GET/api/v2/developer/logsAuthenticated

Get paginated developer event logs with optional filtering by category, API key, and date range.

Query Parameters

categoriesstring

Comma-separated event categories to filter by.

api_key_idstring

Filter by specific API key UUID.

startstring

Start date (ISO 8601) for date range filter.

endstring

End date (ISO 8601) for date range filter.

cursorstring

Pagination cursor from a previous response.

limitinteger

Results per page (max 100). Defaults to 50.

Request

cURL
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/developer/logs?categories=api,webhook&limit=25" \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"data": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"evt_abc123",
      400">class="text-emerald-400">"category": 400">class="text-emerald-400">"api",
      400">class="text-emerald-400">"action": 400">class="text-emerald-400">"agent.create",
      400">class="text-emerald-400">"api_key_id": 400">class="text-emerald-400">"key_abc123",
      400">class="text-emerald-400">"status_code": 201,
      400">class="text-emerald-400">"duration_ms": 45,
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-04-01T12:00:00.000Z"
    }
  ],
  400">class="text-emerald-400">"nextCursor": 400">class="text-emerald-400">"eyJjcmVhdGVkX2F0IjoiMjAyNi0wNC0wMVQxMTowMDowMC4wMDBaIn0="
}