Skip to article
NEXUSDocs
Documentation/API reference
API reference

Handle Send Chat Message

This endpoint is used to send a new chat message.

Before you begin

This page uses Nexus's generated request and response schema. Requests still require the correct account, workspace, and resource permissions.

POST/chat/send-chat-message
curl --request POST 'https://school.narb.cc/api/chat/send-chat-message' \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "message": "example"
}'

This builds a request example. Fill in required query values, then replace path placeholders and YOUR_TOKEN in your own environment. Use a token for a user with access to this workspace. Responses and permissions depend on your account and deployment. Never paste a private token into documentation.

Download the Nexus OpenAPI schema ↗
Import the schema into your API client. It describes the backend source; enabled routes depend on your workspace.

Authentication and scope#

Send requests to the workspace that owns the resource. Authentication does not by itself grant a school membership, class assignment, or administrator permission. School endpoints apply their role and class checks on the server.

Use a credential issued for that workspace with only the permissions your integration needs. Keep it on your server. Do not place credentials in a public website or a shared skill.

This endpoint is used to send a new chat message.

Args: chat_message_req (SendMessageRequest): Details about the new chat message. - When stream=True (default): Returns StreamingResponse with SSE - When stream=False: Returns ChatFullResponse with complete data request (Request): The current HTTP request context. user (User): The current user, obtained via dependency injection. _ (None): Rate limit check is run if user/group/global rate limits are enabled.

Returns: StreamingResponse | ChatFullResponse: Either streams or returns complete response.

Parameters#

NameLocationRequiredType
tenant_idqueryNostring or null

The tenant_id parameter is part of the engine schema. It does not authorize a caller to another school. Use the workspace and permissions assigned to your account.

Request body#

Content type: application/json.

FieldTypeRequiredDetails
messagestringYesSee Request schema.
llm_overrideobject or nullNoSee Request schema.
llm_overridesarray of object or nullNoSee Request schema.
mock_llm_responsestring or nullNoSee Request schema.
allowed_tool_idsarray of integer or nullNoSee Request schema.
forced_tool_idinteger or nullNoSee Request schema.
file_descriptorsarray of objectNoDefault: [].
internal_search_filtersobject or nullNoSee Request schema.
deep_researchbooleanNoDefault: false.
mcp_headersobject or nullNoSee Request schema.
originstringNoOrigin of a chat message for telemetry tracking. Allowed: "webapp", "chrome_extension", "api", "slackbot", "widget", "discordbot", "mobile", "unknown", "unset".
parent_message_idinteger or nullNoDefault: -1.
chat_session_idstring or nullNoSee Request schema.
chat_session_infoobject or nullNoSee Request schema.
streambooleanNoDefault: true.
include_citationsbooleanNoDefault: true.
additional_contextstring or nullNoSee Request schema.

Request schema#

The schema includes field limits and required values. Referenced types are included in the downloadable OpenAPI file. Replace example identifiers with IDs from your workspace.

{
  "properties": {
    "message": {
      "type": "string",
      "title": "Message"
    },
    "llm_override": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/LLMOverride"
        },
        {
          "type": "null"
        }
      ]
    },
    "llm_overrides": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/components/schemas/LLMOverride"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Llm Overrides"
    },
    "mock_llm_response": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mock Llm Response"
    },
    "allowed_tool_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Allowed Tool Ids"
    },
    "forced_tool_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Forced Tool Id"
    },
    "file_descriptors": {
      "items": {
        "$ref": "#/components/schemas/FileDescriptor"
      },
      "type": "array",
      "title": "File Descriptors",
      "default": []
    },
    "internal_search_filters": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/BaseFilters"
        },
        {
          "type": "null"
        }
      ]
    },
    "deep_research": {
      "type": "boolean",
      "title": "Deep Research",
      "default": false
    },
    "mcp_headers": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Mcp Headers"
    },
    "origin": {
      "$ref": "#/components/schemas/MessageOrigin",
      "default": "unset"
    },
    "parent_message_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parent Message Id",
      "default": -1
    },
    "chat_session_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Chat Session Id"
    },
    "chat_session_info": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/ChatSessionCreationRequest"
        },
        {
          "type": "null"
        }
      ]
    },
    "stream": {
      "type": "boolean",
      "title": "Stream",
      "default": true
    },
    "include_citations": {
      "type": "boolean",
      "title": "Include Citations",
      "default": true
    },
    "additional_context": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Additional Context"
    }
  },
  "type": "object",
  "required": [
    "message"
  ],
  "title": "SendMessageRequest"
}

Responses#

200#

If stream=true, returns text/event-stream. If stream=false, returns application/json (ChatFullResponse).

{
  "properties": {
    "answer": {
      "type": "string",
      "title": "Answer"
    },
    "answer_citationless": {
      "type": "string",
      "title": "Answer Citationless"
    },
    "pre_answer_reasoning": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pre Answer Reasoning"
    },
    "tool_calls": {
      "items": {
        "$ref": "#/components/schemas/ToolCallResponse"
      },
      "type": "array",
      "title": "Tool Calls",
      "default": []
    },
    "top_documents": {
      "items": {
        "$ref": "#/components/schemas/SearchDoc"
      },
      "type": "array",
      "title": "Top Documents"
    },
    "citation_info": {
      "items": {
        "$ref": "#/components/schemas/CitationInfo"
      },
      "type": "array",
      "title": "Citation Info"
    },
    "message_id": {
      "type": "integer",
      "title": "Message Id"
    },
    "chat_session_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Chat Session Id"
    },
    "incognito": {
      "type": "boolean",
      "title": "Incognito",
      "default": false
    },
    "error_msg": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Msg"
    }
  },
  "type": "object",
  "required": [
    "answer",
    "answer_citationless",
    "top_documents",
    "citation_info",
    "message_id"
  ],
  "title": "ChatFullResponse",
  "description": "Complete non-streaming response with all available data.\nNOTE: This model is used for the core flow of the Onyx application, any changes to it should be reviewed and approved by an\nexperienced team member. It is very important to 1. avoid bloat and 2. that this remains backwards compatible across versions."
}

422#

Validation Error

{
  "properties": {
    "detail": {
      "items": {
        "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Access and error handling#

A signed-out or expired session needs authentication. A denied request can mean the account lacks permission, class membership, an approved model, or an available allowance. Do not retry a write blindly after a network failure; first check whether it was recorded.

Treat validation errors as a request problem. Use the returned field details to correct the request. Resource identifiers do not confer access.

Schema version#

Generated from Nexus backend source fe1c3a07c793029d3d87191a68f89e481afd6bc8. Check your deployed version before integrating. Schema coverage is not a live acceptance test.

NEXUS

Nexus helps students think, practice, and learn, with teachers guiding AI use.

[ Support ]

[ NARB TECHNOLOGY INC. ]

Nexus is a school AI platform by narb Technology Inc. · 16192 Coastal Hwy, Lewes, DE 19958

© 2026 narb Technology Inc.

Nexus

Nexus helps schools make room for questions, practice, and reflection — with teacher guidance in view.

[ Contact us through e-mail ]

© 2026 narb Technology Inc.

NEXUS

Nexus helps students think, practice, and learn, with teachers guiding AI use.

[ Support ]

[ NARB TECHNOLOGY INC. ]

Nexus is a school AI platform by narb Technology Inc.

© 2026 narb Technology Inc.