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

# Update a document

> Replaces the title and the text. The document goes back to `proposed` and off, even if an owner had switched it on, because changed text is text nobody has read.

A document added or changed here is `proposed`: saved switched off, so the AI cannot read it until an owner switches it on in the dashboard. Update and delete only reach text documents added through this API. A document an owner wrote, a FAQ, a file or a website answers 404.

Email addresses, long numbers such as card or phone numbers, IBANs and long tokens are replaced with placeholders like `[email]` before the text is stored.



## OpenAPI

````yaml /api-reference/openapi.json put /knowledge/{id}
openapi: 3.1.0
info:
  title: miniDesk API
  version: 1.0.0
  description: >-
    Create and work support tickets from your own systems. Every response
    carries an `X-Request-Id`; quote it when reporting a problem.
servers:
  - url: https://api.minidesk.ai/v1
security:
  - bearerAuth: []
paths:
  /knowledge/{id}:
    put:
      tags:
        - Knowledge
      summary: Update a document
      description: >-
        Replaces the title and the text. The document goes back to `proposed`
        and off, even if an owner had switched it on, because changed text is
        text nobody has read.


        A document added or changed here is `proposed`: saved switched off, so
        the AI cannot read it until an owner switches it on in the dashboard.
        Update and delete only reach text documents added through this API. A
        document an owner wrote, a FAQ, a file or a website answers 404.


        Email addresses, long numbers such as card or phone numbers, IBANs and
        long tokens are replaced with placeholders like `[email]` before the
        text is stored.
      operationId: updateKnowledgeDocument
      parameters:
        - name: id
          in: path
          required: true
          description: The document's id, as returned when you added it.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  minLength: 1
                  maxLength: 200
                content:
                  type: string
                  minLength: 1
                  maxLength: 80000
              required:
                - title
                - content
      responses:
        '200':
          description: The updated document, proposed again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeDocument'
        '400':
          description: The body failed validation. `field` names the offending property.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed, or revoked credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Unknown id, or a resource belonging to another workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Over the rate limit. See the `Retry-After` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    KnowledgeDocument:
      type: object
      properties:
        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)$
        title:
          type: string
        kind:
          type: string
          enum:
            - text
            - document
            - connector
            - faq
            - website
        status:
          type: string
          enum:
            - proposed
            - crawling
            - failed
            - needs_review
            - inactive
            - active
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - title
        - kind
        - status
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
                - invalid_credential
                - identity_required
                - identity_invalid
                - forbidden
                - email_unconfirmed
                - seat_unavailable
                - not_found
                - conflict
                - quota_exceeded
                - invalid_transition
                - ai_disabled
                - rate_limited
                - internal_error
                - service_unavailable
            message:
              type: string
            field:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API credential from **Settings → API**, sent as `Authorization:
        Bearer mdsk_api_...`. Issued per workspace and shown once.

````

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