---
title: "Create Comment"
method: POST
path: "/workspaces/{workspace_id}/cases/{case_id}/comments"
tags: ["cases"]
---

# Create Comment

`POST /workspaces/{workspace_id}/cases/{case_id}/comments`

## Request

- Base URL: `https://platform.tracecat.com/api`
- URL: `https://platform.tracecat.com/api/workspaces/{workspace_id}/cases/{case_id}/comments`
- Auth: one of:
  - API key in cookie `fastapiusersauth`
  - HTTP bearer

Create a new comment on a case.

## Path parameters

- `case_id` string, uuid, required
- `workspace_id` string, uuid, required

## Request body

- CaseCommentCreate
  - `content` string, required
  - `parent_id` string, uuid, nullable
  - `workflow_id` union
    - string
    - string

## Response `201`

Successful Response

- CaseCommentRead
  - `id` string, uuid, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `content` string, required
  - `parent_id` string, uuid, nullable
  - `workflow` CaseCommentWorkflowRead
    - `workflow_id` string, uuid, nullable
    - `title` string, required
    - `alias` string, nullable
    - `wf_exec_id` string, nullable
    - `status` 'running' | 'succeeded' | 'failed', required
  - `agent` CaseCommentAgentAttributionRead: Read model for agent attribution on a generated comment reply.
    - `invocation_id` string, uuid, required
    - `preset_name` string, required
    - `preset_slug` string, required
    - `session_id` string, uuid, nullable
  - `user` UserRead
    - `id` string, uuid, required
    - `email` string, email, required
    - `is_active` boolean
    - `is_superuser` boolean
    - `is_verified` boolean
    - `role` 'basic' | 'admin', required
    - `first_name` string, nullable
    - `last_name` string, nullable
    - `settings` object, required
  - `last_edited_at` string, date-time, nullable
  - `deleted_at` string, date-time, nullable
  - `is_deleted` boolean
  - `mentions` CaseCommentMentionRead[]
    - `id` string, uuid, required
    - `target_type` 'agent', required: Polymorphic target kind for a parsed case-comment mention. Only ``AGENT`` is supported today. The finite set lives here (rather than as a bare ``str`` checked at runtime) so every mention-aware call site — the parser, persistence, and API read schema — shares one exhaustive, type-checked domain of valid target kinds.
    - `target_id` string, uuid, required
    - `label` string, required
    - `created_at` string, date-time, required
    - `invocation` CaseCommentAgentInvocationRead: Read model for an agent invocation triggered by a comment mention.
      - `id` string, uuid, required
      - `preset_name` string, required
      - `preset_slug` string, required
      - `status` 'pending' | 'running' | 'succeeded' | 'failed', required: Lifecycle state for an agent invoked from a case-comment mention.
      - `session_id` string, uuid, nullable
      - `error` CaseCommentAgentInvocationError: Structured terminal failure persisted for a comment agent invocation.
        - `kind` 'startup' | 'preparation' | 'agent_turn' | 'completion' | 'cancelled', required
        - `message` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/tracecat/apis/tracecat-api.md) - [All operations](https://skmtc.dev/tracecat/apis/tracecat-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tracecat/apis/tracecat-api/revisions/2efdda25045f?raw)
