REST API Endpoints (action=)

All REST calls are POSTed to api.php with an action parameter. Authentication can be via API key (Bearer), logged-in session, or anonymous widget session for specific endpoints.

Access levels

  • Anonymous widget allowed: messageNew, againOptions, chatStream, getMessageFiles, userRegister, lostPassword
  • Authenticated only: all others listed below

Endpoint list and purpose

Each item links to an anchor for quick navigation. Responses are JSON.


action=messageNew – Post a user message

  • Anonymous widget or authenticated
  • Body: message (text). Optional files via files[] form field
curl -sS -X POST -F "action=messageNew" -F "message=Hello" https://app.synaplan.com/api.php

action=chatStream – Stream AI response (SSE)

  • Anonymous widget or authenticated
  • Body: lastIds (comma-separated IDs returned by messageNew) or again=1 with in_id
curl -N -X POST -F "action=chatStream" -F "lastIds=123" https://app.synaplan.com/api.php

action=againOptions – Get model options for re-run

action=messageAgain – Trigger context-aware rerun

action=snippetTranslate – Translate short text

  • Authenticated
  • Body: source_text, source_lang (default en), dest_lang

Example (Bearer API key):

curl -sS -H "Authorization: Bearer $SYNAPLAN_API_KEY" -X POST \
  -F action=snippetTranslate \
  -F source_text="Hello, how are you?" \
  -F source_lang=en \
  -F dest_lang=de \
  https://app.synaplan.com/api.php

action=docSum – Summarize a document

action=ragUpload – Upload files for RAG

  • Authenticated, files via files[]

Prompt endpoints

  • promptLoad, promptUpdate, deletePrompt, getPromptDetails

File endpoints

  • getMessageFiles (anon allowed), getFileGroups, changeGroupOfFile

action=getProfile – Get profile JSON

action=loadChatHistory – Recent chat messages

  • Body: amount in {10,20,30}

Widget endpoints

  • getWidgets, saveWidget, deleteWidget (authenticated)

API key endpoints

  • getApiKeys, createApiKey, setApiKeyStatus, deleteApiKey (authenticated)

User endpoints

  • userRegister, lostPassword (public)

Mail handler endpoints

  • getMailhandler, saveMailhandler, mailOAuthStart, mailOAuthCallback, mailOAuthStatus, mailOAuthDisconnect, mailTestConnection