---
title: "Write Scripted Opening"
method: POST
path: "/chats/{chat_id}/scripted-opening"
tags: ["Chats"]
---

# Write Scripted Opening

`POST /chats/{chat_id}/scripted-opening`

## Request

- Base URL: `https://api.excellence-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.excellence-ai.com/chats/{chat_id}/scripted-opening`
- Auth: OAuth 2 (password, token URL `api/login`)

A suggestion of the empty chat, answered without the model (EXC-1554):
stores the user turn and its scripted reply and returns them to show.

## Path parameters

- `chat_id` string, required

## Request body

- ScriptedOpeningRequest
  - `key` 'student_chapter' | 'student_test' | 'teacher_course' | 'teacher_exam' | 'teacher_exercise', required
  - `with_welcome` boolean
  - `capabilities` string, nullable

## Response `200`

Successful Response

- ScriptedOpeningResponse
  - `user_text` string, required
  - `reply` string, required
  - `tool_activity` object[], nullable
  - `scripted_step` string, nullable

## Other responses

- `404`: Resource not found
- `409`: Business rule violated
- `422`: Validation Error

## Changes

> 55 revisions in range; 1 not diffed.

- **2026-10-21** `1d6009058248`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/excellence-ai/apis/excellence-learning/changes/chats/:chat_id/scripted-opening/post.md)

---

[API](https://skmtc.dev/excellence-ai/apis/excellence-learning.md) - [All operations](https://skmtc.dev/excellence-ai/apis/excellence-learning/llms.txt) - [OpenAPI document](https://skmtc.dev/excellence-ai/apis/excellence-learning/revisions/379e4a57dee8?raw)
