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

# Ingest event intelligently

> Intelligently resumes paused executions for the same entityId and event, or triggers new workflows if no paused executions exist. This endpoint simplifies integration by automatically handling the decision between resuming and triggering.



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/triglit/openapi.documented.yml post /v1/gateway/triggers/ingest
openapi: 3.0.0
info:
  title: Triglit
  description: Documentação da API do Triglit
  version: '1.0'
  contact: {}
servers: []
security: []
tags: []
paths:
  /v1/gateway/triggers/ingest:
    post:
      tags:
        - Triggers
      summary: Ingest event intelligently
      description: >-
        Intelligently resumes paused executions for the same entityId and event,
        or triggers new workflows if no paused executions exist. This endpoint
        simplifies integration by automatically handling the decision between
        resuming and triggering.
      operationId: publictriggers_ingestEvent_v1
      parameters:
        - name: X-API-Key
          in: header
          description: Chave de API do tenant (publishable key ou secret key)
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestEventDto'
      responses:
        '200':
          description: Event ingested successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestEventResponseDto'
        '400':
          description: Invalid request
        '401':
          description: API key não fornecida, inválida ou não encontrada.
        '403':
          description: Tipo de chave não permitido para este endpoint.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Triglit from 'triglit';

            const client = new Triglit({
              apiKey: 'My API Key',
            });

            const response = await client.triggers.ingest({ event: 'x' });

            console.log(response.resumed);
components:
  schemas:
    IngestEventDto:
      type: object
      properties:
        event:
          type: string
          minLength: 1
        eventData:
          type: object
          additionalProperties:
            nullable: true
        subTenantId:
          type: string
        resumeOptions:
          type: object
          properties:
            resumeAll:
              type: boolean
              default: true
            runIds:
              type: array
              items:
                type: string
            workflowVersionIds:
              type: array
              items:
                type: string
      required:
        - event
    IngestEventResponseDto:
      type: object
      properties:
        resumed:
          description: List of resumed executions
          type: array
          items:
            $ref: '#/components/schemas/IngestEventResumedItemDto'
        triggered:
          description: List of newly triggered workflows
          type: array
          items:
            $ref: '#/components/schemas/IngestEventTriggeredItemDto'
        skipped:
          description: List of skipped executions
          type: array
          items:
            $ref: '#/components/schemas/IngestEventSkippedItemDto'
      required:
        - resumed
        - triggered
        - skipped
    IngestEventResumedItemDto:
      type: object
      properties:
        runId:
          type: string
          description: Run identifier that was resumed
          example: run_abc123def456
        workflowVersionId:
          type: string
          description: Workflow version identifier
          example: wfv_abc123def456
        entityId:
          type: string
          description: Entity ID
          example: user_123
      required:
        - runId
        - workflowVersionId
        - entityId
    IngestEventTriggeredItemDto:
      type: object
      properties:
        triggerId:
          type: string
          description: Trigger identifier
          example: trg_abc123def456
        runId:
          type: string
          description: Run identifier (if workflow was started)
          example: run_abc123def456
        dedupeKey:
          type: string
          description: Deduplication key
          example: tenant_123:sub_456:trg_abc123def456:1705312200000
      required:
        - triggerId
        - dedupeKey
    IngestEventSkippedItemDto:
      type: object
      properties:
        reason:
          type: string
          description: Reason why the execution was skipped
          example: expired
          enum:
            - expired
            - not_paused
            - wrong_event
            - filtered_out
        runId:
          type: string
          description: Run identifier (if applicable)
          example: run_abc123def456
      required:
        - reason
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Chave de API do tenant (publishable key ou secret key)

````