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

# Update knowledge item or media

> Updates the name and/or description of a knowledge item or media



## OpenAPI

````yaml /en/openapi.json patch /v1/knowledge/{id}
openapi: 3.0.0
info:
  title: Nuvia API - Company
  description: API documentation for companies
  version: '1.0'
  contact: {}
servers:
  - url: https://api.nuvia.ai
security: []
tags:
  - name: messages
    x-group: Mensagens
  - name: contacts
    x-group: Contatos
  - name: campaigns
    x-group: Campanhas
  - name: tables
    x-group: Tabelas e Listas
  - name: agents
    x-group: Agentes
  - name: conversations
    x-group: Conversas
  - name: inboxes
    x-group: Caixas de Entrada
  - name: knowledge
    x-group: Base de Conhecimento
  - name: Webhooks
    x-group: Webhooks
  - name: campaign-enrollments
    x-group: Inscrições em Campanha
  - name: custom-fields
    x-group: Campos Customizados
paths:
  /v1/knowledge/{id}:
    patch:
      tags:
        - knowledge
      summary: Update knowledge item or media
      description: Updates the name and/or description of a knowledge item or media
      operationId: KnowledgeController_update
      parameters:
        - name: x-company-id
          in: header
          description: >-
            Target company identifier. Required only for global API keys
            (type=global). Ignored for company API keys and human users.
          required: false
          schema:
            type: string
        - name: id
          required: true
          in: path
          description: Knowledge/media ID
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeEntity'
      security:
        - JWT-auth: []
components:
  schemas:
    KnowledgeEntity:
      type: object
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
        name:
          type: string
        description:
          type: string
        type:
          enum:
            - KNOWLEDGE
            - MEDIA
          type: string
        s3_key:
          type: string
          description: S3 object key. Source of truth for generating the signed URL.
        file_url:
          type: string
          deprecated: true
        file_type:
          enum:
            - PDF
            - DOCX
            - AUTCL
            - IMAGE
            - VIDEO
            - AUDIO
            - DOCUMENT
          type: string
        content:
          type: string
        status:
          enum:
            - PROCESSING
            - READY
            - ERROR
          type: string
        meta:
          type: object
        company:
          $ref: '#/components/schemas/CompanyEntity'
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
      required:
        - _id
        - name
        - type
        - file_type
        - company
    ObjectId:
      type: object
      properties: {}
    CompanyEntity:
      type: object
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
        name:
          type: string
        channels:
          type: array
          items:
            type: string
            enum:
              - WAP_AUTO_CLOSER
              - WEB_V2
              - EVOLUTION_API
              - LINKEDIN
              - EMAIL
        agent_flows:
          type: array
          items:
            $ref: '#/components/schemas/AgentFlowEntity'
        description:
          type: string
          description: >-
            Optional since ISSUE-6330: companies created via self-service are
            born

            without a description (legacy ones from before 2025-09-07 also lack
            the

            field). The requirement remains in the backoffice's INPUT layers
            (Zod DTOs

            for create-company/create-internal-company, and forms) — untouched.
        domains:
          description: >-
            Email domains that resolve to THIS company in self-service signup

            (ISSUE-6330): 1 domain → at most 1 company (partial unique index

            below). Only the self-service flow writes; legacy backoffice

            companies are left WITHOUT the field (no backfill — they go through

            resolution by inference via users' email). Canonicalized
            lowercase/trim in the

            schema (mirrors signup_leads.domain). `default: undefined` so the

            field is born ABSENT (a default array [] would enter the partial
            index's

            semantics and needlessly change backoffice documents).
          type: array
          items:
            type: string
        site:
          type: string
          description: >-
            [ISSUE-6438] Site entered in the wizard. INFORMATIONAL — it does not
            take part in

            domain-based resolution and has no unique index.


            It exists because of the personal email workspace

            (SIGNUP_ALLOW_PERSONAL_EMAILS): there the domain can't be derived
            from the

            email, so the user types it in. Putting it in `domains` would claim
            the

            domain globally (the index is unique) and would let someone with
            @gmail

            register "google.com" — hence a separate field, with `domains: []`.
        general_config:
          type: object
        status:
          enum:
            - ACTIVE
            - INACTIVE
            - DELETED
          type: string
        agent_builder_mcp_enabled:
          type: boolean
          description: >-
            Enables the agent builder tools in the client's `/mcp` for THIS
            company.

            Default `true`: the builder is GA — every company has it, unless
            explicit

            opt-OUT (`false`). It works as a per-company EXCLUSION switch (e.g.,
            turning off a

            client that made a mess), not an inclusion one. The AUTHORING gate
            remains

            the role (COMPANY_ADMIN); a regular user can only read/simulate.
            Companies created before

            GA were enabled via backfill
            (scripts/backfill-agent-builder-mcp-flag.ts).
        client_mcp_servers_enabled:
          type: boolean
          description: >-
            Enables the client's MCP servers feature (SDD "Client MCP in

            agent tools", §8 rollout) for THIS company. Absent/false = flag

            OFF: the `/mcp-servers` routes respond 403 (except the OAuth
            callback,

            which is public) and MCP tools already materialized become INERT at
            runtime

            (they disappear from the agent's array, without deleting anything
            from the database). Deliberate default

            `false`: it's a gradual rollout, not GA like
            `agent_builder_mcp_enabled`.
        auto_join_enabled:
          type: boolean
          description: >-
            [ISSUE-6432] Automatic domain-based entry. Absent/false = OFF

            (deliberate default: turning it on is an admin decision, not the
            initial state).


            When on, anyone who signs up with an email from this company's
            domain joins directly

            as a member, instead of generating an access request. Affects ONLY
            this company:

            a domain shared by multiple companies still lets the person choose,
            and among the

            chosen ones only the one that turned it on grants direct entry.
        subscription:
          type: object
          description: >-
            Subscription/trial (ISSUE-6334). Default `{status:'active'}` — a
            company

            created by the backoffice is born ACTIVE (product decision); the

            self-service flow (ProvisionCompanyByDomainService) overwrites it
            with

            `trialing` + dates. A legacy doc without the field = active (see

            resolveSubscriptionStatus + the backfill script).
        onboarding:
          type: object
          description: >-
            [ISSUE-6438] Onboarding wizard state. `default: undefined` so the

            field is born ABSENT (same technique as `domains`): a backoffice
            company

            does not get the subdocument and resolves as completed in

            `resolveOnboardingStatus`.
        attribution:
          type: object
          description: >-
            Campaign that brought in this company (`utm_*` from whoever created
            it).


            ── Why here, if the UTM already lives in `signup_leads` ──


            There the key is the EMAIL, and the link only goes as far as the
            user. Cross-referencing campaign with

            trial, activation, or revenue required a manual join by the first

            user's email — which breaks as soon as the person changes email or
            leaves.


            Copied at CREATION time, and only then. There's no backfill: a
            company created before this

            is left without the field, and absent means "we don't know", not
            "organic".


            `default: undefined` so it's born ABSENT (same technique as
            `onboarding`):

            a backoffice company doesn't go through the self-service flow and
            shouldn't get

            an empty subdocument.
      required:
        - _id
        - name
        - channels
        - agent_flows
        - description
        - status
    AgentFlowEntity:
      type: object
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
        name:
          type: string
        url:
          type: string
        specialist_url:
          type: string
        type:
          enum:
            - N8N
            - API
            - INTERNAL
          type: string
      required:
        - _id
        - name
        - url
        - specialist_url
        - type
  securitySchemes:
    JWT-auth:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Token JWT de autenticação

````