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

# Atualizar Ações

> Atualizar uma nova ação de inatividade



## OpenAPI

````yaml PUT /v2/agent/{agentId}/idle-actions
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}/idle-actions:
    put:
      description: Atualizar uma nova ação de inatividade
      parameters:
        - name: agentId
          in: path
          description: Id do agente
          required: true
          schema:
            type: string
      requestBody:
        description: Atualização das ações de inatividade do assistente
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                actions:
                  type: array
                  description: Lista de ações configuradas
                  items:
                    type: object
                    properties:
                      instructions:
                        type: string
                        description: Mensagem ou instruções da ação
                      seconds:
                        type: integer
                        description: Tempo de inatividade em segundos
                      allowAllHours:
                        type: boolean
                        description: Se true, ignora restrição de horário
                      workingHours:
                        type: array
                        nullable: true
                        description: >-
                          Lista de dias e horários em que a ação pode ser
                          executada
                        items:
                          type: object
                          properties:
                            dayWeek:
                              type: integer
                              description: >-
                                Dia da semana (0=Domingo, 1=Segunda, ...
                                6=Sábado)
                            active:
                              type: boolean
                              description: Define se o dia está ativo
                            hours:
                              type: array
                              description: Faixas de horário do dia
                              items:
                                type: object
                                properties:
                                  start:
                                    type: string
                                    example: '08:00'
                                  end:
                                    type: string
                                    example: '12:00'
                finishOn:
                  type: object
                  description: Tempo para finalizar interação automaticamente
                  properties:
                    seconds:
                      type: integer
                      description: Tempo total em segundos
      responses:
        '200':
          description: Configuração de ações de inatividade atualizada com sucesso
          content:
            application/json:
              schema:
                type: object
                properties:
                  actions:
                    type: array
                    description: Lista de ações configuradas para inatividade
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Identificador único da ação
                        type:
                          type: string
                          enum:
                            - SEND_MESSAGE
                            - FINISH_INTERACTION
                          description: Tipo da ação
                        instructions:
                          type: string
                          nullable: true
                          description: Mensagem/instruções configuradas para a ação
                        workingHours:
                          type: object
                          nullable: true
                          description: >-
                            Horários de funcionamento da ação (quando
                            allowAllHours=false)
                          properties:
                            id:
                              type: string
                            tenant:
                              type: string
                            tenantOwner:
                              type: string
                            createdAt:
                              type: integer
                            updatedAt:
                              type: integer
                              nullable: true
                            active:
                              type: boolean
                            days:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  tenant:
                                    type: string
                                  tenantOwner:
                                    type: string
                                  createdAt:
                                    type: integer
                                  updatedAt:
                                    type: integer
                                    nullable: true
                                  active:
                                    type: boolean
                                  dayWeek:
                                    type: integer
                                    description: 0=Domingo ... 6=Sábado
                                  hours:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        id:
                                          type: string
                                        tenant:
                                          type: string
                                        tenantOwner:
                                          type: string
                                        createdAt:
                                          type: integer
                                        updatedAt:
                                          type: integer
                                          nullable: true
                                        start:
                                          type: string
                                          example: '08:00'
                                        end:
                                          type: string
                                          example: '12:00'
                                        sequence:
                                          type: integer
                                          description: Ordem do intervalo dentro do dia
                        allowAllHours:
                          type: boolean
                          description: Se a ação deve ignorar restrições de horário
                        seconds:
                          type: integer
                          description: Tempo em segundos para disparar a ação
                  finishOn:
                    type: object
                    description: Configuração de tempo total para finalizar automaticamente
                    properties:
                      seconds:
                        type: integer
                        description: Tempo em segundos para finalizar
        '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

````