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

# Detalhe da execução

> Mostra passos e status de uma execução.



## OpenAPI

````yaml /automations-api/api-reference/openapi-automations.json get /v1/automations/{automationId}/runs/{runId}
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/automations/{automationId}/runs/{runId}:
    get:
      tags:
        - Runs
      summary: Detalhe da execução
      description: Mostra passos e status de uma execução.
      operationId: ntfAuto_getRun
      parameters:
        - $ref: '#/components/parameters/NtfAuto_automationId'
        - $ref: '#/components/parameters/NtfAuto_runId'
      responses:
        '200':
          $ref: '#/components/responses/NtfAuto_RunDetail200'
        '401':
          $ref: '#/components/responses/NtfAuto_401'
        '402':
          $ref: '#/components/responses/NtfAuto_402'
        '403':
          $ref: '#/components/responses/NtfAuto_403AutomationsRead'
        '404':
          $ref: '#/components/responses/NtfAuto_RunNotFound'
components:
  parameters:
    NtfAuto_automationId:
      name: automationId
      in: path
      required: true
      schema:
        type: string
      description: Cuid da automação.
    NtfAuto_runId:
      name: runId
      in: path
      required: true
      schema:
        type: string
      description: Cuid da `AutomationRun`.
  responses:
    NtfAuto_RunDetail200:
      description: Run com array `steps` ordenado por criação.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_RunDetailResponse'
    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_403AutomationsRead:
      description: Sem escopo `automations:read`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorForbiddenScope'
          example:
            success: false
            error: Forbidden
            message: 'Missing scope: automations:read'
            code: FORBIDDEN
    NtfAuto_RunNotFound:
      description: Run não pertence à automação ou não existe.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NtfAuto_ErrorNotFound'
          example:
            success: false
            error: Not Found
            message: Run not found
            code: NOT_FOUND
  schemas:
    NtfAuto_RunDetailResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          enum:
            - true
        data:
          $ref: '#/components/schemas/NtfAuto_AutomationRunDetail'
    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_AutomationRunDetail:
      type: object
      required:
        - id
        - workspaceId
        - automationId
        - contactId
        - eventName
        - payloadJson
        - status
        - createdAt
        - updatedAt
        - steps
      properties:
        id:
          type: string
        workspaceId:
          type: string
        automationId:
          type: string
        contactId:
          type: string
        eventName:
          type: string
        payloadJson:
          type: object
          additionalProperties: true
        status:
          $ref: '#/components/schemas/NtfAuto_AutomationRunStatus'
        sourceApiKeyId:
          type: string
          nullable: true
        fireId:
          type: string
          nullable: true
        errorMessage:
          type: string
          nullable: true
        startedAt:
          nullable: true
          type: string
          format: date-time
        completedAt:
          nullable: true
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        steps:
          type: array
          items:
            $ref: '#/components/schemas/NtfAuto_AutomationRunStepRow'
    NtfAuto_AutomationRunStatus:
      type: string
      enum:
        - QUEUED
        - RUNNING
        - COMPLETED
        - FAILED
        - CANCELLED
    NtfAuto_AutomationRunStepRow:
      type: object
      required:
        - id
        - runId
        - stepKey
        - stepKind
        - status
        - attempt
        - createdAt
      properties:
        id:
          type: string
        stepKey:
          type: string
        stepKind:
          $ref: '#/components/schemas/NtfAuto_AutomationRunStepKind'
        status:
          $ref: '#/components/schemas/NtfAuto_AutomationRunStepStatus'
        scheduledFor:
          nullable: true
          type: string
          format: date-time
        startedAt:
          nullable: true
          type: string
          format: date-time
        finishedAt:
          nullable: true
          type: string
          format: date-time
        attempt:
          type: integer
          minimum: 0
        errorMessage:
          type: string
          nullable: true
        outputJson:
          nullable: true
          description: Objeto livre conforme passo.
          type: object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
    NtfAuto_AutomationRunStepKind:
      type: string
      enum:
        - TRIGGER
        - DELAY
        - SEND_TEMPLATE
        - CONDITION
        - SEND_EMAIL
        - SEND_WHATSAPP
        - SEND_SMS
        - SEND_TELEGRAM
        - SEND_PUSH
        - SEND_RCS
        - UPDATE_CONTACT
        - DELETE_CONTACT
        - CREATE_CONTACT
        - END_FLOW
    NtfAuto_AutomationRunStepStatus:
      type: string
      enum:
        - PENDING
        - RUNNING
        - COMPLETED
        - FAILED
        - SKIPPED
        - CANCELLED
  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.

````