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

# Propose changes to a help center article

> Suggest changes to a help center article for review. The suggestions become the working draft in one language; an author accepts or rejects each one in the editor, then saves and publishes.

Send the complete article body as an HTML fragment in `diff_html`, with each change wrapped in suggestion markup. An inline change replaces a phrase:

```html theme={"dark"}
<p>Refunds are available within <span data-diff-suggestion data-diff-suggestion-id="d1" data-diff-suggestion-comment="Policy changed"><span data-diff-suggestion-old>14 days</span><span data-diff-suggestion-new>30 days</span></span>.</p>
```

A block change adds, removes or replaces whole paragraphs, with `data-diff-suggestion-block`, `data-diff-suggestion-block-old` and `data-diff-suggestion-block-new` on `div` elements. Leave an old or new part empty to suggest a pure addition or removal.

An inline change holds only text, formatting and whole links to other articles. To change the text of a link to another article, an image or a code block, wrap the whole paragraph or block in a block change instead; an inline change there is refused with `400`. To change a collapsible section's title, wrap the whole `<details>` element in a block change; a block change between its title and its body, or holding a title without its section, is refused with `400`. In a list, change an item's text with an inline change; a block change may follow the item's text or wrap the whole list. A block change placed first in an item is turned into an inline change when each side holds a single paragraph with the same attributes, which are kept; otherwise, as for a side holding an image, it is refused with `400`. A block change placed between items is refused with `400`.

Read the article first with [Get an article](https://docs.open.cx/api-reference/help-center/articles/get.md). Build on `proposal_base.content_html`: the working draft when there is one, otherwise the newest saved version, which may be newer than the live one. Send `proposal_base.revision` back as `revision` and `proposal_base.base_version` as `base_version`. If the draft changed, or a version was saved or retranslated, since you read it, the request is refused with `409` and nothing is written; read it again and rebuild the change.

The body replaces the whole working draft in that language: content left out of `diff_html` is removed from the draft. Nothing is saved as a version or published. A version can't be saved, and the article can't be published, until every suggestion is accepted or rejected. A body with no suggestion in it is refused with `400`.

To propose a translation the article doesn't have yet, pass that `language_code` and a `title` for it.


## OpenAPI

````yaml put /hc/{helpCenterId}/articles/{entityId}/diff
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /hc/{helpCenterId}/articles/{entityId}/diff:
    put:
      summary: Propose changes to a help center article
      description: >-
        Store the complete article HTML, with each change wrapped in
        data-diff-suggestion markup, as the article's working draft in one
        language. The author accepts or rejects each change in the dashboard
        editor; nothing is versioned or published. `revision` and `base_version`
        come from `proposal_base` of the read the proposal was built on; a draft
        changed since, or a saved version newer or rewritten since, is refused
        with 409.
      operationId: applyHelpCenterArticleDiff
      parameters:
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: helpCenterId
          required: true
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: path
          name: entityId
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApplyArticleDiffDto'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplyArticleDiffResponseDto'
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArticleDraftConflictDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    ApplyArticleDiffDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ApplyArticleDiffDtoInput'
      type: object
      properties:
        language_code:
          type: string
          minLength: 2
        diff_html:
          type: string
          minLength: 1
        revision:
          type: integer
          minimum: 0
          maximum: 9007199254740991
        base_version:
          type: string
          description: >-
            `proposal_base.base_version` from the read the proposal was built
            on. If the draft or a saved version changed since, the proposal is
            refused with 409.
        title:
          type: string
          minLength: 1
      required:
        - diff_html
        - revision
        - base_version
    ApplyArticleDiffResponseDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ApplyArticleDiffResponseDto'
      type: object
      properties:
        artifact_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        article_entity_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        language_code:
          type: string
        title:
          type: string
        change_count:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        revision:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - artifact_id
        - article_entity_id
        - language_code
        - title
        - change_count
        - revision
      additionalProperties: false
    ArticleDraftConflictDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/ArticleDraftConflictDto'
      type: object
      properties:
        message:
          type: string
        current_revision:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        updated_by:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
      required:
        - message
        - current_revision
        - updated_by
        - updated_at
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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