> ## 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.

# Update Comment



## OpenAPI

````yaml /openapi/mio-openapi.json patch /api/v1/comments/{comment_id}
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/{comment_id}:
    patch:
      tags:
        - comments
      summary: Update Comment
      operationId: comments.patch_comments_patch_comments_by_comment_id
      parameters:
        - in: path
          name: comment_id
          required: true
          schema:
            title: Comment Id
            type: string
        - in: query
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/CommentUpdateRequest'
        required: true
      responses:
        '200':
          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
      security:
        - HTTPBearer: []
components:
  schemas:
    CommentUpdateRequest:
      additionalProperties: false
      description: >-
        Top-level envelope for PATCH /api/comments/<id>.


        Shape: { "data": { "type": "comments", "attributes": { "body": "..." } }
        }
      properties:
        data:
          $ref: '#/components/schemas/CommentUpdateResource'
      required:
        - data
      title: CommentUpdateRequest
      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
    CommentUpdateResource:
      additionalProperties: false
      description: JSON:API resource wrapper for an update request.
      properties:
        attributes:
          $ref: '#/components/schemas/CommentUpdateAttributes'
        type:
          const: comments
          title: Type
          type: string
      required:
        - type
        - attributes
      title: CommentUpdateResource
      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
    CommentUpdateAttributes:
      additionalProperties: false
      properties:
        attachments:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            Full replacement list of attached media ids. Presence, not value,
            decides behavior: omit this key to leave attachments unchanged; send
            `[]` to remove every attachment; send `[ids]` to replace the
            attachment set with exactly those ids (only the delta is
            attached/detached — ids already attached that remain in the list are
            left untouched, and there is no reorder concept for attachments).
            This field is typed nullable (`list[str] | None`) for internal
            reasons only — the runtime REJECTS an explicit `null` with HTTP 422
            (`code: "invalid_attribute"`, `source.pointer:
            "/data/attributes/attachments"`); `null` is NOT one of the three
            supported wire states (omitted / `[]` / `[ids]`).
          title: Attachments
        body:
          default: ''
          maxLength: 50000
          title: Body
          type: string
        external_video_embeds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            Full replacement list of attached external-video-embed ids. Same
            presence-based semantics as `attachments` (omit = unchanged, `[]` =
            remove all, `[ids]` = full replacement, only the delta is
            attached/detached) — with one difference: order matters. Sending the
            SAME set of ids already attached in a DIFFERENT order repositions
            the existing embeds to match the new order (embeds carry a
            `position`; attachments do not). At most 5 embeds are allowed on one
            comment; exceeding it is a 422 (`code: "too_many_embeds"`). As with
            `attachments`, this field is typed nullable for internal reasons
            only — the runtime REJECTS an explicit `null` with HTTP 422 (`code:
            "invalid_attribute"`, `source.pointer:
            "/data/attributes/external_video_embeds"`).
          title: External Video Embeds
      title: CommentUpdateAttributes
      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

````