Skip to main content
POST
/
ai
/
editor-assistant
/
generate
Generate Editor Assistant
curl --request POST \
  --url https://api.decodahealth.com/ai/editor-assistant/generate \
  --header 'API-KEY: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'TENANT: <tenant>' \
  --data '
{
  "mode": "template",
  "message": "<string>",
  "currentState": {},
  "history": [
    {
      "role": "user",
      "content": "<string>",
      "timestamp": "<string>",
      "files": [
        {
          "name": "<string>",
          "size": 123,
          "type": "<string>",
          "data": "<string>"
        }
      ]
    }
  ],
  "files": [
    {
      "name": "<string>",
      "size": 123,
      "type": "<string>",
      "data": "<string>"
    }
  ]
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Headers

TENANT
string
required

The tenant you are making this request on behalf of

API-KEY
string
required

Your api key

Body

application/json

Request schema for the AI editor assistant endpoint.

mode
enum<string>
required

Editor mode: 'template' for note templates, 'form' for check-in forms

Available options:
template,
form
message
string
required

User's natural language instruction

currentState
Currentstate · object

Serialized current editor state

history
ConversationMessage · object[] | null

Conversation history

files
FileAttachment · object[] | null

PDF/image uploads (base64)

Response

Successful Response