> ## 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.

# Criar novo conhecimento ou mídia

> 
Cria um novo item de conhecimento ou mídia.

**Tipos disponíveis:**
- `KNOWLEDGE`: Documentos PDF/DOCX que serão processados para busca semântica
- `MEDIA`: Imagens, vídeos, áudios ou documentos para envio em conversas

**Para KNOWLEDGE:**
- O arquivo será processado automaticamente (chunking + embeddings)
- Status inicial: PROCESSING → READY quando concluído

**Para MEDIA:**
- O arquivo é apenas armazenado para uso posterior
- Status: READY imediatamente
    



## OpenAPI

````yaml https://api.nuvia.ai/api/docs/user-json post /v1/knowledge
openapi: 3.0.0
info:
  title: Nuvia API - Empresa
  description: Documentação da API para empresas
  version: '1.0'
  contact: {}
servers:
  - url: https://api.nuvia.ai
security: []
tags:
  - name: auth
    description: Autenticação
paths:
  /v1/knowledge:
    post:
      tags:
        - knowledge
      summary: Criar novo conhecimento ou mídia
      description: >-

        Cria um novo item de conhecimento ou mídia.


        **Tipos disponíveis:**

        - `KNOWLEDGE`: Documentos PDF/DOCX que serão processados para busca
        semântica

        - `MEDIA`: Imagens, vídeos, áudios ou documentos para envio em conversas


        **Para KNOWLEDGE:**

        - O arquivo será processado automaticamente (chunking + embeddings)

        - Status inicial: PROCESSING → READY quando concluído


        **Para MEDIA:**

        - O arquivo é apenas armazenado para uso posterior

        - Status: READY imediatamente
            
      operationId: KnowledgeController_create
      parameters:
        - name: x-company-id
          in: header
          description: >-
            Identificador da empresa-alvo. Obrigatório apenas para API Keys
            globais (type=global). Ignorado para API Keys de empresa e usuários
            humanos.
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - name
                - type
                - file_type
              properties:
                file:
                  type: string
                  format: binary
                  description: Arquivo para upload
                name:
                  type: string
                  description: Nome do conhecimento/mídia
                description:
                  type: string
                  description: Descrição opcional
                type:
                  type: string
                  enum:
                    - KNOWLEDGE
                    - MEDIA
                  description: 'Tipo: KNOWLEDGE ou MEDIA'
                file_type:
                  type: string
                  enum:
                    - PDF
                    - DOCX
                    - AUTCL
                    - IMAGE
                    - VIDEO
                    - AUDIO
                    - DOCUMENT
                  description: 'Tipo do arquivo: PDF, DOCX, IMAGE, VIDEO, AUDIO, DOCUMENT'
      responses:
        '201':
          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: Chave do objeto no S3. Fonte da verdade para gerar URL assinada.
        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
        general_config:
          type: object
        status:
          enum:
            - ACTIVE
            - DELETED
          type: string
        agent_builder_mcp_enabled:
          type: boolean
          description: >-
            Libera as tools do agent builder no `/mcp` do cliente para ESTA
            empresa.

            Default `true`: o builder é GA — toda empresa tem, salvo opt-OUT
            explícito

            (`false`). Vira o interruptor por-empresa de EXCLUSÃO (ex.: desligar
            um

            cliente que fez bagunça), não de inclusão. O gate de AUTORIA
            continua sendo

            o role (COMPANY_ADMIN); usuário comum só lê/simula. Empresas criadas
            antes

            do GA foram ligadas via backfill
            (scripts/backfill-agent-builder-mcp-flag.ts).
      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

````