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

# Create Comment



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/comments
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/comments:
    post:
      tags:
        - comments
      summary: Create Comment
      operationId: comments.post_comments_post_comments
      parameters:
        - in: query
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/CommentCreateRequest'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/CommentResponse'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '429':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Rate limited
      security:
        - HTTPBearer: []
components:
  schemas:
    CommentCreateRequest:
      additionalProperties: false
      description: |-
        Top-level envelope for POST /api/comments.

        Shape: { "data": { "type": "comments", "attributes": { ... } } }
      properties:
        data:
          $ref: '#/components/schemas/CommentCreateResource'
      required:
        - data
      title: CommentCreateRequest
      type: object
    CommentResponse:
      description: |-
        Single-item JSON:API envelope for a comment.

        Shape: { "data": <CommentResource> }
      properties:
        data:
          $ref: '#/components/schemas/CommentResource'
      required:
        - data
      title: CommentResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    CommentCreateResource:
      additionalProperties: false
      description: JSON:API resource wrapper for a create request.
      properties:
        attributes:
          $ref: '#/components/schemas/CommentCreateAttributes'
        type:
          const: comments
          title: Type
          type: string
      required:
        - type
        - attributes
      title: CommentCreateResource
      type: object
    CommentResource:
      description: |-
        JSON:API resource object for a comment.

        Shape:
        {
          "type": "comments",
          "id": "<uuid>",
          "attributes": { ... },
          "links": { "self": "/api/comments/<uuid>" }
        }
      properties:
        attributes:
          $ref: '#/components/schemas/CommentAttributes'
        id:
          title: Id
          type: string
        links:
          additionalProperties:
            type: string
          title: Links
          type: object
        type:
          const: comments
          default: comments
          title: Type
          type: string
      required:
        - id
        - attributes
        - links
      title: CommentResource
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
    CommentCreateAttributes:
      additionalProperties: false
      description: Attributes for POST /api/comments.
      properties:
        anchor:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Anchor
        attachments:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Attachments
        body:
          default: ''
          description: >-
            Markdown body text. Mention tokens use the format `@[Display
            Name](contact_id)` where `contact_id` is the mentioned contact's
            UUID. The display label is render-only; the backend trusts only the
            UUID. Plain `@Name` text does not trigger notifications. Recipients
            must be active hub members; unknown or ineligible IDs are silently
            ignored.
          maxLength: 50000
          title: Body
          type: string
        external_video_embeds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: External Video Embeds
        parent_comment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Comment Id
        target_id:
          title: Target Id
          type: string
        target_type:
          title: Target Type
          type: string
      required:
        - target_type
        - target_id
      title: CommentCreateAttributes
      type: object
    CommentAttributes:
      properties:
        anchor:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Anchor
        attachments:
          anyOf:
            - items:
                $ref: '#/components/schemas/RenderableAttachment'
              type: array
            - type: 'null'
          title: Attachments
        author_contact_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Contact Id
        author_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Display Name
        author_membership_status:
          anyOf:
            - enum:
                - active
                - banned
                - soft_banned
                - left
              type: string
            - type: 'null'
          title: Author Membership Status
        author_photo_thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Photo Thumbnail Url
        author_photo_thumbnail_url_expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Author Photo Thumbnail Url Expires At
        author_photo_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Photo Url
        author_photo_url_expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Author Photo Url Expires At
        author_role:
          anyOf:
            - enum:
                - owner
                - admin
                - moderator
                - member
              type: string
            - type: 'null'
          title: Author Role
        body:
          title: Body
          type: string
        body_plain:
          title: Body Plain
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        edited_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Edited At
        external_video_embeds:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: External Video Embeds
        is_deleted:
          title: Is Deleted
          type: boolean
        parent_comment_author_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Comment Author Display Name
        parent_comment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Comment Id
        reaction_count:
          title: Reaction Count
          type: integer
        reactions:
          items:
            additionalProperties: true
            type: object
          title: Reactions
          type: array
        reply_count:
          default: 0
          title: Reply Count
          type: integer
        report_count:
          default: 0
          description: >-
            Number of moderation reports on this resource, across ALL statuses
            (pending, dismissed, actioned). Present ONLY for an active,
            non-banned hub owner/admin/moderator — the key is omitted entirely
            for any other viewer. Clients MUST treat absence as 'not authorized
            / not supplied', never as zero.
          minimum: 0
          title: Report Count
          type: integer
        reported_by_me:
          default: false
          description: >-
            True when the requesting member has already filed a report against
            this resource. Present for any authenticated member; omitted
            entirely for an anonymous viewer. Clients MUST treat absence as
            'unknown', never as false.
          title: Reported By Me
          type: boolean
        target_id:
          title: Target Id
          type: string
        target_type:
          title: Target Type
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - target_type
        - target_id
        - author_contact_id
        - author_display_name
        - parent_comment_id
        - body
        - body_plain
        - anchor
        - reaction_count
        - reactions
        - is_deleted
        - edited_at
        - created_at
        - updated_at
      title: CommentAttributes
      type: object
    RenderableAttachment:
      properties:
        asset_kind:
          anyOf:
            - type: string
            - type: 'null'
          title: Asset Kind
        file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: File Id
        filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Filename
        id:
          title: Id
          type: string
        media_id:
          title: Media Id
          type: string
        mime_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Mime Type
        role:
          title: Role
          type: string
        size_bytes:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size Bytes
        status_upload:
          anyOf:
            - type: string
            - type: 'null'
          title: Status Upload
        thumbnail_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail Url
        thumbnail_url_expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Thumbnail Url Expires At
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        url_expires_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Url Expires At
      required:
        - id
        - media_id
        - role
      title: RenderableAttachment
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````