run_ai_action
Apply a pre-defined AI prompt to specific messages. Provide the prompt ID and message IDs to generate responses in the language you need.
Instructions
Run an AI Action (Prompt) against one or more specific messages.
USE WHEN: You have concrete message_ids and a prompt_id, and want the AI Action applied to exactly those messages.
USE INSTEAD: summarize_conversation if you want a whole conversation summarized and would otherwise have to list its messages yourself — it does that selection for you.
FIRST: prompt_id comes from list_ai_actions (field id) — call it first if you don't have one.
FIRST: message_ids comes from list_messages (field results[].id) — call it first if you don't have one.
EXAMPLE: {"prompt_id":"prompt-abc","message_ids":["msg-1","msg-2"],"language":"english"}
RETURNS: {id, prompt_id, message_ids, creator_id, channel_id?, workspace_id?, responses: [{language, text?, markdown?, html?, json?}], created_at}. The generated output is in responses[], one entry per language.
ERROR BAD_REQUEST: prompt_id or one of message_ids is not a valid ID. — Call list_ai_actions for valid prompt_id values and list_messages for valid message IDs; do not retry with the same IDs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | The language of the response. Defaults to original message. | |
| prompt_id | Yes | AI Action ID, from `list_ai_actions` (its `id`). | |
| channel_id | No | Conversation the messages belong to, from `list_conversations`. | |
| message_ids | Yes | Message IDs, from `list_messages` (`results[].id`). | |
| workspace_id | No | Workspace scope, from `get_workspaces_basic_info`. | |
| response_fields | No | Dot-path allowlist to shrink the response, e.g. ["results.id","total"]. Omit for the full payload. | |
| ignore_existing_response | No | Whether to ignore existing response and generate a new one. Defaults to false. |