Skip to main content
The Dimedove API lets you programmatically create conversations, send messages, and receive AI agent responses. Use it to build custom lead qualification chat applications or embed conversational AI into your own applications.

Base URL

All API requests are made to:
https://api.dimedove.com/v1/apps/{app_id}

Authentication

The API uses Bearer token authentication with your secret API key.
Authorization: Bearer sk_live_your_api_key
You can create and manage API keys from the Manage Keys page in your dashboard.
Never expose your secret API key (sk_live_*) in client-side code. All API requests should be made from your server.

Error Handling

The API returns errors in an OpenAI-compatible format:
{
  "error": {
    "message": "Human-readable description",
    "type": "error_type",
    "param": null,
    "code": null
  }
}

Error Types

TypeStatusDescription
invalid_api_key401Invalid or missing API key
access_denied403API key does not have access to this app
app_inactive403App is disabled
agent_unavailable403No active agent configured for this app
not_found404App or conversation not found
rate_limit_exceeded429Rate limit exceeded
internal_error500Unexpected server error

Rate Limits

The API applies rate limits based on your plan. Limits are enforced per minute and per day. For more information, contact us.

Pagination

List endpoints use cursor-based pagination with the following query parameters:
ParameterTypeDefaultDescription
limitinteger20Number of results to return (1-100)
afterstring-Cursor for forward pagination (conversation ID)
beforestring-Cursor for backward pagination (conversation ID)
orderstringdescSort order: asc or desc
Paginated responses include:
{
  "object": "list",
  "data": [...],
  "first_id": "first-conversation-id",
  "last_id": "last-conversation-id",
  "has_more": true
}
Use last_id as the after parameter to fetch the next page.

Streaming

The Send Message endpoint supports Server-Sent Events (SSE) for streaming responses. Set stream: true in the request body to enable streaming. Streaming responses use the text/event-stream content type with the following event format:
event: <event_type>
data: <json_payload>

Event Types

EventDescription
response.createdInitial event with response metadata
response.output_text.deltaIncremental text chunk from the agent
response.output_text.doneComplete assembled text
response.function_call.startAgent initiated a tool call
response.function_call_arguments.deltaIncremental tool call arguments
response.function_call_arguments.doneComplete tool call arguments
response.data_specGenerative UI form patch (only when Generative UI is enabled)
response.completedResponse finished successfully
response.failedResponse encountered an error

Streaming Example

event: response.created
data: {"id":"resp_abc123","object":"response","status":"in_progress","conversation_id":"550e8400-e29b-41d4-a716-446655440000"}

event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Hello","output_index":0,"content_index":0}

event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"! How can I help?","output_index":0,"content_index":0}

event: response.output_text.done
data: {"type":"response.output_text.done","text":"Hello! How can I help?","output_index":0,"content_index":0}

event: response.completed
data: {"id":"resp_abc123","status":"completed"}

Generative UI

When Generative UI is enabled on your app, the agent can generate interactive forms (radio buttons, selects, text inputs, and more) to collect structured user input during conversations. These forms are streamed as response.data_spec events containing JSON Patch (RFC 6902) operations that describe the UI components to render. You can enable Generative UI from your app’s configuration page in the dashboard. Each response.data_spec event contains a JSON Patch operation describing a UI component:
{
  "type": "response.data_spec",
  "data": {
    "type": "patch",
    "patch": {
      "op": "add",
      "path": "/root",
      "value": "card-coverage"
    }
  },
  "output_index": 0
}
The data.patch field follows the RFC 6902 JSON Patch specification. Multiple response.data_spec events may be emitted during a single response to progressively build up a form. When Generative UI is enabled, response.data_spec events are interleaved with text events:
event: response.created
data: {"id":"resp_def456","object":"response","status":"in_progress","conversation_id":"550e8400-e29b-41d4-a716-446655440000"}

event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"Let me help you choose a plan.","output_index":0,"content_index":0}

event: response.output_text.done
data: {"type":"response.output_text.done","text":"Let me help you choose a plan.","output_index":0,"content_index":0}

event: response.data_spec
data: {"type":"response.data_spec","data":{"type":"patch","patch":{"op":"add","path":"/root","value":"card-plan-selection"}},"output_index":0}

event: response.data_spec
data: {"type":"response.data_spec","data":{"type":"patch","patch":{"op":"add","path":"/root/children/-","value":{"type":"radio-group","name":"plan","options":["Basic","Standard","Premium"]}}},"output_index":0}

event: response.completed
data: {"id":"resp_def456","status":"completed"}
Generative UI payloads use JSON Patch operations to describe UI components. Your frontend is responsible for rendering these patches into interactive form elements. You can use the json-render library to render these components in React applications.

Non-Streaming

When streaming is disabled (stream: false or omitted), the Send Message endpoint returns a single JSON response after the agent finishes processing. The response contains an output array with all items produced by the agent. Output items can be of the following types:
TypeDescription
messageA text message from the assistant
function_callA tool call made by the agent
data_specA Generative UI form patch (only when Generative UI is enabled)

Non-Streaming Example

{
  "id": "resp_abc123",
  "object": "response",
  "created_at": 1709712000,
  "conversation_id": "550e8400-e29b-41d4-a716-446655440000",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [{ "type": "text", "text": "Hello! How can I help?" }]
    },
    {
      "type": "function_call",
      "name": "lookup_policy",
      "arguments": "{\"query\":\"coverage details\"}",
      "call_id": "call_abc123"
    }
  ],
  "status": "completed"
}
When Generative UI is enabled, data_spec items appear alongside message and function_call items in the output array:
{
  "id": "resp_def456",
  "object": "response",
  "created_at": 1709712000,
  "conversation_id": "550e8400-e29b-41d4-a716-446655440000",
  "output": [
    {
      "type": "message",
      "role": "assistant",
      "content": [{ "type": "text", "text": "Let me help you choose a plan." }]
    },
    {
      "type": "data_spec",
      "data": {
        "type": "patch",
        "patch": { "op": "add", "path": "/root", "value": "card-plan-selection" }
      }
    }
  ],
  "status": "completed"
}