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

> Cria um novo agente de atendimento.



## OpenAPI

````yaml https://api.nuvia.ai/api/docs/user-json post /v1/agents
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/agents:
    post:
      tags:
        - agents
      summary: Criar agente
      description: Cria um novo agente de atendimento.
      operationId: AgentsController_createAgent
      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
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentEntity'
      security:
        - JWT-auth: []
components:
  schemas:
    AgentEntity:
      type: object
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
        name:
          type: string
        agent_flow:
          $ref: '#/components/schemas/AgentFlowEntity'
        prompts:
          type: object
          properties:
            service_prompt:
              type: string
            name:
              type: string
            role:
              type: string
            mission:
              type: string
            personality:
              type: array
              items:
                $ref: '#/components/schemas/PromptItem'
            communication_style:
              type: array
              items:
                $ref: '#/components/schemas/PromptItem'
            rules:
              type: array
              items:
                $ref: '#/components/schemas/PromptItem'
          required:
            - service_prompt
            - name
            - role
            - mission
            - personality
            - communication_style
            - rules
        company:
          $ref: '#/components/schemas/CompanyEntity'
        model_config:
          type: object
        general_config:
          type: object
        specialist_config:
          type: object
        status:
          enum:
            - ACTIVE
            - DRAFT
            - INACTIVE
            - DELETED
          type: string
        knowledge_base:
          type: array
          items:
            $ref: '#/components/schemas/ObjectId'
        avatar_color:
          type: string
        avatar_initials:
          type: string
        personality_presets:
          type: array
          items:
            type: string
            enum:
              - FRIENDLY
              - DIDACTIC
              - CURIOUS
              - FORMAL
              - PLAYFUL
              - PERSUASIVE
        steps:
          type: array
          items:
            $ref: '#/components/schemas/AgentStepEntity'
      required:
        - _id
        - name
        - agent_flow
        - prompts
        - company
        - model_config
        - status
    ObjectId:
      type: object
      properties: {}
    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
    PromptItem:
      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
    AgentStepEntity:
      type: object
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
        name:
          type: string
        slug:
          type: string
          deprecated: true
        description:
          type: string
        order:
          type: number
        mentions:
          type: array
          items:
            type: object
        general_config:
          type: object
          properties:
            disable_followups:
              type: boolean
            should_auto_run_on_enter:
              type: boolean
        type:
          enum:
            - INITIAL
            - DEFAULT
            - CLOSED
            - SUCCESS
          type: string
        agent:
          $ref: '#/components/schemas/AgentEntity'
        company:
          $ref: '#/components/schemas/CompanyEntity'
        meta_event_name:
          nullable: true
          enum:
            - ViewContent
            - LeadSubmitted
            - QualifiedLead
            - AddToCart
            - InitiateCheckout
            - Purchase
          type: string
      required:
        - _id
        - name
        - slug
        - description
        - order
        - type
        - agent
        - company
  securitySchemes:
    JWT-auth:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Token JWT de autenticação

````