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

> Cria uma nova regra de transferência para o agente especificado



## OpenAPI

````yaml POST /v2/agent/{agentId}/transfer-rules
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}/transfer-rules:
    post:
      description: Cria uma nova regra de transferência para o agente especificado
      parameters:
        - name: agentId
          in: path
          description: Id do agente
          required: true
          schema:
            type: string
      requestBody:
        description: Dados da regra de transferência a ser adicionado
        content:
          application/json:
            schema:
              type: object
              properties:
                instructions:
                  type: string
                  description: Instruções visíveis na transferência
                returnOnFinish:
                  type: boolean
                  description: Define se deve retornar ao assistente após o atendimento
                type:
                  enum:
                    - HUMAN
                    - AGENT
                userId:
                  type: string
                  nullable: true
                  description: Id do usuário de destino (caso o tipo seja HUMAN)
                agentId:
                  type: string
                  nullable: true
                  description: Id do agente de destino (caso o tipo seja AGENT)
        required: true
      responses:
        '200':
          description: Regra de transferência criada com sucesso
          content:
            application/json:
              schema:
                properties:
                  id:
                    type: string
                    description: Id da regra
                  createdAt:
                    type: string
                    description: data de atualização do campo
                  instructions:
                    type: string
                    description: Instruções visíveis na transferência
                  returnOnFinish:
                    type: boolean
                    description: Define se deve retornar ao assistente após o atendimento
                  type:
                    enum:
                      - HUMAN
                      - AGENT
                  agentId:
                    type: string
                    nullable: true
                    description: Id do agente de destino (se aplicável)
                  userId:
                    type: string
                    nullable: true
                    description: Id do usuário de destino (se aplicável)
        '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

````