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

# Update Semantic Layer Document

> Edit a document's name, content, or folder with an API key.

Same rule as creating: the key edits as its creator. On Growth and Custom a member needs **editor**
on the document; on Free and Starter the key has to carry an owner's or admin's role.

Sending `content` re-parses the document's mentions and reindexes it for semantic search. A document
its creator cannot see answers `404`, not `403` — an id you cannot read is indistinguishable from one
that does not exist.

```bash theme={null}
curl --request PATCH \
  --url "https://api.nekt.ai/api/v1/semantic-layer/documents/DOCUMENT_ID/" \
  --header "x-api-key: YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"content": "MRR excludes trials AND paused subscriptions."}'
```

<Note>
  `DELETE` is not available to an API key and returns `403`. Remove documents from the app.
</Note>

## Related

* [Create a document](/platform-api/semantic-layer/create).
* [Document object](/platform-api/semantic-layer/document) — the fields and which of them are read-only.


## OpenAPI

````yaml PATCH /api/v1/semantic-layer/documents/{id}/
openapi: 3.0.3
info:
  title: Nekt API
  version: v1
  description: Nekt API Documentation
  contact:
    email: support@nekt.ai
servers:
  - url: https://api.nekt.ai
security: []
paths:
  /api/v1/semantic-layer/documents/{id}/:
    patch:
      tags:
        - v1
      summary: Update a Semantic Layer document
      description: >-
        Requires editor access on the document. Sending `content` re-parses its
        mentions and reindexes it.
      operationId: v1_semantic_layer_documents_partial_update
      parameters:
        - in: path
          name: id
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedSemanticLayerDocument'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedSemanticLayerDocument'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedSemanticLayerDocument'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SemanticLayerDocument'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PatchedSemanticLayerDocument:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        content:
          type: string
        mentions:
          readOnly: true
        folder:
          type: string
          format: uuid
          nullable: true
          description: >-
            Folder to place the document in. Omit or send null to put it at the
            root.
        order:
          type: integer
          readOnly: true
          nullable: true
          description: >-
            Manual position among its siblings; NULL falls back to created_at
            ordering.
        created_by:
          type: string
          readOnly: true
          description: Created by (Expandable)
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
    SemanticLayerDocument:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          maxLength: 255
        content:
          type: string
        mentions:
          readOnly: true
        folder:
          type: string
          format: uuid
          nullable: true
          description: >-
            Folder to place the document in. Omit or send null to put it at the
            root.
        order:
          type: integer
          readOnly: true
          nullable: true
          description: >-
            Manual position among its siblings; NULL falls back to created_at
            ordering.
        created_by:
          type: string
          readOnly: true
          description: Created by (Expandable)
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - created_by
        - id
        - mentions
        - name
        - order
        - updated_at
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Format: ''x-api-key: api_key'''

````