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

# Criar treinamento

> Adiciona um novo treinamento ao agente



## OpenAPI

````yaml POST /v2/agent/{agentId}/trainings
openapi: 3.0.1
info:
  title: OpenAPI GPT Maker
  description: Documentação completa da API do GPT Maker
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.gptmaker.ai
security:
  - bearerAuth: []
paths:
  /v2/agent/{agentId}/trainings:
    post:
      description: Adiciona um novo treinamento ao agente
      parameters:
        - name: agentId
          in: path
          description: ID do agente
          required: true
          schema:
            type: string
      requestBody:
        description: Dados do treinamento a ser adicionado
        content:
          application/json:
            schema:
              oneOf:
                - title: Texto
                  type: object
                  properties:
                    type:
                      type: string
                      description: Tipo do treinamento deve ser TEXT
                      enum:
                        - TEXT
                    text:
                      type: string
                      description: Texto do treinamento
                    image:
                      type: string
                      description: URL de uma imagem para o treinamento
                    callbackUrl:
                      type: string
                      description: >-
                        URL do webhook para notificação quando o treinamento
                        finaliza com sucesso ou erro (opcional)
                - title: Website
                  type: object
                  properties:
                    type:
                      type: string
                      description: Tipo do treinamento deve ser WEBSITE
                      enum:
                        - WEBSITE
                    website:
                      type: string
                      description: Website do treinamento
                    trainingSubPages:
                      type: string
                      description: Treinamento em subpáginas
                      enum:
                        - DISABLED
                        - ACTIVE
                    trainingInterval:
                      type: string
                      description: Intervalo de treinamento
                      enum:
                        - THIRTY_SECONDS
                        - NEVER
                        - ONE_HOUR
                        - FOUR_HOUR
                        - EIGHT_HOUR
                        - TWELVE_HOUR
                        - ONE_DAY
                        - ONE_WEEK
                        - ONE_MONTH
                    callbackUrl:
                      type: string
                      description: >-
                        URL do webhook para notificação quando o treinamento
                        finaliza com sucesso ou erro (opcional)
                - title: Vídeo
                  type: object
                  properties:
                    type:
                      type: string
                      description: Tipo do treinamento deve ser VIDEO
                      enum:
                        - VIDEO
                    video:
                      type: string
                      description: URL Vídeo do treinamento
                    callbackUrl:
                      type: string
                      description: >-
                        URL do webhook para notificação quando o treinamento
                        finaliza com sucesso ou erro (opcional)
                - title: Documento
                  type: object
                  properties:
                    type:
                      type: string
                      description: Tipo do treinamento
                      enum:
                        - DOCUMENT
                    documentUrl:
                      type: string
                      description: URL do documento do treinamento
                    documentName:
                      type: string
                      description: Nome do documento do treinamento
                    documentMimetype:
                      type: string
                      description: Tipo MIME do documento do treinamento
                    callbackUrl:
                      type: string
                      description: >-
                        URL do webhook para notificação quando o treinamento
                        finaliza com sucesso ou erro (opcional)
        required: true
      responses:
        '200':
          description: Treinamento adicionado com sucesso
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '400':
          description: Erro inesperado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Erro de token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error403'
components:
  schemas:
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
    Error403:
      required:
        - error
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````