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

# Atualizar evento

> Altera nome ou configuração de um evento.



## OpenAPI

````yaml /automations-api/api-reference/openapi-automations.json patch /v1/events/{eventId}
openapi: 3.0.3
info:
  title: 'Notifique API v1: Automações e eventos'
  version: 1.0.0
  description: >-
    Definição de **eventos** (nome + schema opcional do `payload`),
    **automações** em grafo (gatilho por evento ou **mensagem recebida** em
    canal, delays, condições, inclusive com **`source: "message"`** no inbound,
    **`endFlow`** para encerrar um ramo, envios multicanal, atualização de
    contato, etc.) e **disparo** via `POST /v1/events/send`. Autenticação:
    `Authorization: Bearer sk_live_...` ou header `x-api-key`. Todos os corpos
    usam **camelCase**.


    **Escopos:** `events:read` | `events:write` | `automations:read` |
    `automations:write`. O motor de envio dos passos (`sendTemplate`, e-mails
    diretos, etc.) ainda exige as chaves de envio dos canais correspondentes.


    **Paginação:** query `page` (≥1, padrão 1) e `limit` (1 a 100, padrão 20),
    como strings ou números coerentes.


    **Workspace bloqueado** responde **402** com `Payment Required`.


    **Onboarding:** em qualquer rota `/v1`, se a conta ainda não concluiu o
    onboarding, o middleware responde **403** com `code: ONBOARDING_REQUIRED`
    (corpo semelhante aos outros 403).
servers:
  - url: https://api.notifique.dev
    description: Produção
security:
  - ntfAutoBearerAuth: []
  - ntfAutoApiKeyHeader: []
tags:
  - name: Eventos
    description: CRUD de definições de evento + disparo `POST /v1/events/send`.
  - name: Automações
    description: CRUD de automações, stop e listagem de runs.
  - name: Runs
    description: Histórico e detalhe de execuções (`AutomationRun` + passos).
paths:
  /v1/events/{eventId}:
    patch:
      tags:
        - Eventos
      summary: Atualizar evento
      description: Altera nome ou configuração de um evento.
      operationId: ntfAuto_patchEvent
      parameters:
        - $ref: '#/components/parameters/NtfAuto_eventId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NtfAuto_EventPatchBody'
      responses:
        '200':
          $ref: '#/components/responses/NtfAuto_EventPatch200'
        '400':
          $ref: '#/components/responses/NtfAuto_EventPatch400'
        '401':
          $ref: '#/components/responses/NtfAuto_401'
        '402':
          $ref: '#/components/responses/NtfAuto_402'
        '403':
          $ref: '#/components/responses/NtfAuto_403EventsWrite'
        '404':
          $ref: '#/components/responses/NtfAuto_EventNotFound'
        '409':
          $ref: '#/components/responses/NtfAuto_EventNameConflict'
components:
  parameters:
    NtfAuto_eventId:
      name: eventId
      in: path
      required: true
      schema:
        type: string
      description: Cuid do registro `AutomationEvent`.
  schemas:
    NtfAuto_EventPatchBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 256
        schemaJson:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/NtfAuto_EventPayloadSchema'
    NtfAuto_EventPayloadSchema:
      type: object
      additionalProperties:
        type: string
        enum:
          - string
          - number
          - boolean
          - date
        description: '`date`: string ISO-8601 parseável no disparo.'
      description: 'Objeto plano: nome do campo → tipo esperado no `payload`.'
    NtfAuto_EventPatchResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          type: object
          required:
            - id
            - name
            - schemaJson
            - updatedAt
          properties:
            id:
              type: string
            name:
              type: string
            schemaJson:
              nullable: true
              type: object
              additionalProperties:
                type: string
            updatedAt:
              type: string
              format: date-time
    NtfAuto_ErrorWithOptionalCode:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
        message:
          type: string
        code:
          type: string
    NtfAuto_ErrorEnvelope401:
      type: object
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
          example: Unauthorized
        message:
          type: string
    NtfAuto_ErrorPaymentRequired:
      type: object
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
          enum:
            - Payment Required
        message:
          type: string
          example: Plan expired or suspended
    NtfAuto_ErrorForbiddenScope:
      type: object
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
          enum:
            - Forbidden
        message:
          type: string
    NtfAuto_ErrorNotFound:
      type: object
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
          enum:
            - Not Found
        message:
          type: string
    NtfAuto_ErrorConflict:
      type: object
      required:
        - success
        - error
        - message
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: string
          enum:
            - Conflict
        message:
          type: string
  responses:
    NtfAuto_EventPatch200:
      description: Atualizado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_EventPatchResponse'
    NtfAuto_EventPatch400:
      description: Nome inválido ou schema inválido.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorWithOptionalCode'
    NtfAuto_401:
      description: >-
        Chave ausente ou inválida. No middleware global de `/v1` também ocorre
        quando não há API Key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorEnvelope401'
          examples:
            route:
              value:
                success: false
                error: Unauthorized
                message: Invalid or missing API Key
                code: UNAUTHORIZED
            middleware:
              value:
                success: false
                error: Unauthorized
                message: >-
                  API Key is required. Provide Authorization: Bearer <key> or
                  x-api-key header.
                code: UNAUTHORIZED
    NtfAuto_402:
      description: Plano expirado ou workspace suspenso.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorPaymentRequired'
          example:
            success: false
            error: Payment Required
            message: Plan expired or suspended
            code: WORKSPACE_BLOCKED
    NtfAuto_403EventsWrite:
      description: Sem escopo `events:write`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorForbiddenScope'
          example:
            success: false
            error: Forbidden
            message: 'Missing scope: events:write'
            code: FORBIDDEN
    NtfAuto_EventNotFound:
      description: Evento inexistente ou já excluído.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorNotFound'
          example:
            success: false
            error: Not Found
            message: Event not found
            code: NOT_FOUND
    NtfAuto_EventNameConflict:
      description: Já existe evento com o mesmo nome no workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorConflict'
          example:
            success: false
            error: Conflict
            message: An event with this name already exists
            code: CONFLICT
  securitySchemes:
    ntfAutoBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '`Authorization: Bearer sk_live_...`'
    ntfAutoApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: Mesmo valor da chave, sem prefixo Bearer.

````