> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.sesametime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create comment

> Create a comment written by an employee of the company on a planned task. The thread of the task is created when it does not exist yet.

Version:
v4


## OpenAPI

````yaml openapi-v2.json POST /discussion/v4/comments
openapi: 3.0.0
info:
  title: Sesame Public API v2
  description: >-
    Public API v2 — additive surface `/public/{context}/v{N}`,
    endpoint-versioned from v4
  version: 1.0.0
servers:
  - url: https://api.sesamehr.com
    description: Production
security:
  - Bearer: []
paths:
  /discussion/v4/comments:
    post:
      tags:
        - Comments
      summary: Create comment
      description: >-
        Create a comment written by an employee of the company on a planned
        task. The thread of the task is created when it does not exist yet.
      operationId: CreateComment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCommentRequest'
      responses:
        '201':
          description: The identifier of the created comment.
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/CreatedEntry'
                type: object
        '401':
          description: Missing or invalid API key
        '403':
          description: API consumer lacks permission over the requested resource
        '422':
          description: Validation error
components:
  schemas:
    CreateCommentRequest:
      required:
        - authorId
        - comment
        - entityReference
      properties:
        authorId:
          description: Employee of the company who writes the comment.
          type: string
          format: uuid
        comment:
          description: Text of the comment. Surrounding spaces are removed.
          type: string
          maxLength: 3000
          minLength: 1
        entityReference:
          $ref: '#/components/schemas/CreateCommentEntityReference'
      type: object
    CreatedEntry:
      properties:
        id:
          description: Identifier of the created resource.
          type: string
          format: uuid
      type: object
    CreateCommentEntityReference:
      required:
        - id
        - type
      properties:
        id:
          description: Identifier of the planned task the comment is written on.
          type: string
          format: uuid
        type:
          type: string
          enum:
            - planned_task
      type: object
  securitySchemes:
    Bearer:
      type: http
      description: 'Sesame Public API consumer token (Authorization: Bearer <token>)'
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.