---
title: "Make a chat request"
method: POST
path: "/chat/{workspace_id}/request"
tags: ["Chat"]
---

# Make a chat request

`POST /chat/{workspace_id}/request`

Make a chat request to the assistant

## Path parameters

- `workspace_id` string, required

## Request body

- ChatRequest
  - `user_text` string, required — The user's latest text input to the assistant
  - `session_id` string — The ID of the current conversation session for tracking purposes
  - `user_context` ChatUserContext, required
    - `location_description` string, required — Short description of the location/source from which the chat request was made, such as the current page or view in the app or from an integration
    - `additional_context_description` string — Additional, detailed, free-text context about the user's current context in the application, such as selected/highlighted information or visible data not easily retrievable on the backend
    - `entities` ChatContextEntityList[] — Entities, by ID, relevant to current user context (especially any entities currently shown in UI)
      - `entity_type` 'application' | 'branch' | 'datatable' | 'deployment_event' | 'environment' | 'file_upload' | 'flow' | 'insight' | 'plan' | 'plan_run' | 'snippet' | 'test' | 'test_run', required
      - `is_focus` boolean, required — Whether the entity is the primary focus (for that entity type) in the user's current context. If true, the list of IDs should contain only one ID.
      - `ids` string[], required — List of entity IDs
      - `names` string[] — Optional list of entity names by same index as IDs
  - `history` ChatHistoryItem[] — The chat history leading up to this request
    - `role` 'user' | 'model', required
    - `message` string — The text of the chat message (may be partial or absent during streaming)
    - `timestamp` integer — The time the item was generated in epoch millis
    - `function_call_groups` ChatFunctionCallGroup[] — Function calls made during this chat message. Function calls are only supported for model messages. Each item is a group of function calls made in parallel, and following function calls were executed serially after the previous function calls.
      - `function_calls` ChatFunctionCall[], required — Contains a list of function calls made in parallel.
        - `function_name` string, required — The name of the function that was called
        - `arguments` object — The arguments passed to the function
        - `output` object — The output returned by the function
        - `succeeded` boolean — Whether the function call succeeded (may be undefined while in progress during streaming)
        - `error_message` string — Error message if the function call failed
      - `text` string — The text output from the model prior to generating this group of function calls
      - `thinking` string — The model's thinking output that led to generating this group of function calls
    - `streamed_thinking` string — The model's thinking output that is being streamed in real-time (only populated during streaming, accumulates until next function call round)
    - `thinking` string — The model's final thinking output for this message
  - `module_override` string — Temporarily force router to use specific module for hackathon only. String must match getName() value of the module

## Response `200`

A response from the assistant to the user's request

- ChatResponse
  - `workspace_id` string, required — The workspace associated with this assertion evaluation
  - `response_text` string, required — The assistant's response to the user's request
  - `action_suggestions` ChatAction[] — Suggestions for actions the user can take next
    - `action_type` 'deep_link' | 'external_link' | 'failure_categorization' | 'create_plan_from_test_list' | 'add_label', required — The type of action to suggest to the user
    - `display_text` string, required — The text to display for the external link suggested action
  - `entities` ChatContextEntityList[] — Entities, by ID, that are referenced in the assistant's response and provide context in subsequent conversation or action suggestions
    - `entity_type` 'application' | 'branch' | 'datatable' | 'deployment_event' | 'environment' | 'file_upload' | 'flow' | 'insight' | 'plan' | 'plan_run' | 'snippet' | 'test' | 'test_run', required
    - `is_focus` boolean, required — Whether the entity is the primary focus (for that entity type) in the user's current context. If true, the list of IDs should contain only one ID.
    - `ids` string[], required — List of entity IDs
    - `names` string[] — Optional list of entity names by same index as IDs

## Other responses

- `400` — Invalid or missing parameter
- `401` — User not authenticated
- `403` — User not authorized
- `default` — Unknown error

---

[API](https://skmtc.net/mabl/apis/mabl-api.md) · [All operations](https://skmtc.net/mabl/apis/mabl-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mabl/mabl-api/revisions/d0fc0114da66/schema)
