← Back to Home

API Documentation

Base URL: https://ws.n8nbox.cloud

Authentication: All requests must include the x-api-key header.

Endpoints

GET /api/health

Check if the server is running and view active session count.

POST /api/session/create

Initialize a new chat session.

Body:
{
  "first_name": "John",
  "phone_number": "1234567890",
  "target_url": "wss://ag-txt.wittify.ai/v1/ws"
}

target_url: (Optional) The WebSocket URL to connect to. Defaults to the system configured URL.

POST /api/session/:session_id/message

Send a message to an active session.

Body:
{
  "message": "Hello, how are you?",
  "wait_for_response": true
}

wait_for_response: (Optional) If true, waits (up to 30s) for the AI response.

GET /api/session/:session_id/messages

Retrieve messages from a session.

Query Params: clear=true (default) or false.

GET /api/session/:session_id/status

Check the status of a specific session.

GET /api/sessions

List all active sessions (Admin only).

DELETE /api/session/:session_id

Terminate a specific session.