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

# Update a native knowledge article (ADMIN only)

> Field-driven: an omitted field is left alone. `content` rewrites the S3 body, drops any stored original and schedules a managed-KB re-ingest; `tags` rewrites the tag sidecar and also re-ingests; `folderId` (`null` = root) and `title` touch DynamoDB only. A PATCH that omits `content` never touches S3, which is what makes it safe on a document whose conversion is still pending.



## OpenAPI

````yaml https://assist.i.moneyforward.com/api/v1/openapi.json patch /api/v1/knowledge/{docId}
openapi: 3.1.0
info:
  title: Minabot Public API
  description: >-
    REST API for querying sessions, knowledge articles and playbooks, and for
    maintaining native knowledge articles and playbooks. Requires an API key
    issued from the Admina admin panel; every write endpoint requires an ADMIN
    key.


    ### Rate limits

    Not currently enforced at the HTTP layer. Respect upstream DynamoDB capacity
    when making bulk requests (keep concurrency under ~20 RPS per key).
  version: 1.0.0
  contact:
    name: Minabot
    url: https://github.com/moneyforward-i/minabot
servers:
  - url: https://assist.i.moneyforward.com
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/v1/knowledge/{docId}:
    patch:
      tags:
        - Knowledge
      summary: Update a native knowledge article (ADMIN only)
      description: >-
        Field-driven: an omitted field is left alone. `content` rewrites the S3
        body, drops any stored original and schedules a managed-KB re-ingest;
        `tags` rewrites the tag sidecar and also re-ingests; `folderId` (`null`
        = root) and `title` touch DynamoDB only. A PATCH that omits `content`
        never touches S3, which is what makes it safe on a document whose
        conversion is still pending.
      operationId: patchApiV1KnowledgeByDocId
      parameters:
        - in: path
          name: docId
          schema:
            type: string
            minLength: 1
            pattern: ^(?:[a-z0-9-]+(?:\/[a-z0-9-]+)*\.(?:md|txt))$|^(?:[a-f0-9]{32})$
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                content:
                  type: string
                  minLength: 1
                  maxLength: 1048576
                title:
                  type: string
                  minLength: 1
                  maxLength: 200
                folderId:
                  description: '`null` moves the document to the root.'
                  anyOf:
                    - type: string
                      minLength: 1
                    - type: 'null'
                tags:
                  maxItems: 20
                  type: array
                  items:
                    type: string
                    maxLength: 50
                  description: >-
                    Normalised server-side: trimmed, empties dropped, deduped.
                    `[]` clears the tags.
                expectedUpdatedAt:
                  description: >-
                    Optimistic concurrency: the `updatedAt` you read. A mismatch
                    returns 409.
                  type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      responses:
        '200':
          description: The updated article
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: true
                  article:
                    type: object
                    properties:
                      docId:
                        type: string
                      title:
                        type: string
                      summary:
                        type: string
                      folderId:
                        description: Containing folder id (absent = root)
                        type: string
                      folderPath:
                        description: >-
                          Human-readable folder path, e.g. "Manuals/Network"
                          (absent = root)
                        type: string
                      type:
                        type: string
                      tags:
                        type: array
                        items:
                          type: string
                      metadata:
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                      createdAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      updatedAt:
                        type: string
                        format: date-time
                        pattern: >-
                          ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
                      citationCount30d:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: >-
                          AI citations (30d): number of AI replies that used
                          this document in the trailing 30 days
                      content:
                        type: string
                        description: Full markdown body
                    required:
                      - docId
                      - title
                      - createdAt
                      - updatedAt
                      - citationCount30d
                      - content
                required:
                  - ok
                  - article
        '400':
          description: Invalid body, unknown folder, or a connector docId
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: false
                  error:
                    type: string
                    description: Human-readable error message
                required:
                  - ok
                  - error
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: false
                  error:
                    type: string
                    description: Human-readable error message
                required:
                  - ok
                  - error
        '403':
          description: API key lacks ADMIN role
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: false
                  error:
                    type: string
                    description: Human-readable error message
                required:
                  - ok
                  - error
        '404':
          description: Document not found in this tenant
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: false
                  error:
                    type: string
                    description: Human-readable error message
                required:
                  - ok
                  - error
        '409':
          description: >-
            expectedUpdatedAt is stale, or a knowledge base import is in
            progress
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    const: false
                  error:
                    type: string
                    description: Human-readable error message
                required:
                  - ok
                  - error
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key created via the Admina admin panel (`Settings → API Keys →
        Create`). Format: `mb_live_<40-hex>`.

````

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