Windmill nats_trigger API

The nats_trigger API from Windmill — 8 operation(s) for nats_trigger.

OpenAPI Specification

windmill-nats-trigger-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.694.0
  title: Windmill admin nats_trigger API
  contact:
    name: Windmill Team
    email: contact@windmill.dev
    url: https://windmill.dev
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  x-logo:
    url: https://windmill.dev/img/windmill.svg
servers:
- url: /api
security:
- bearerAuth: []
- cookieAuth: []
tags:
- name: nats_trigger
paths:
  /w/{workspace}/nats_triggers/create:
    post:
      summary: Create Nats Trigger
      operationId: createNatsTrigger
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
      requestBody:
        description: new nats trigger
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewNatsTrigger'
      responses:
        '201':
          description: nats trigger created
          content:
            text/plain:
              schema:
                type: string
  /w/{workspace}/nats_triggers/update/{path}:
    post:
      summary: Update Nats Trigger
      operationId: updateNatsTrigger
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
      - $ref: '#/components/parameters/Path'
      requestBody:
        description: updated trigger
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditNatsTrigger'
      responses:
        '200':
          description: nats trigger updated
          content:
            text/plain:
              schema:
                type: string
  /w/{workspace}/nats_triggers/delete/{path}:
    delete:
      summary: Delete Nats Trigger
      operationId: deleteNatsTrigger
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
      - $ref: '#/components/parameters/Path'
      responses:
        '200':
          description: nats trigger deleted
          content:
            text/plain:
              schema:
                type: string
  /w/{workspace}/nats_triggers/get/{path}:
    get:
      summary: Get Nats Trigger
      operationId: getNatsTrigger
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
      - $ref: '#/components/parameters/Path'
      responses:
        '200':
          description: nats trigger deleted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NatsTrigger'
  /w/{workspace}/nats_triggers/list:
    get:
      summary: List Nats Triggers
      operationId: listNatsTriggers
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
        required: true
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PerPage'
      - name: path
        description: filter by path
        in: query
        schema:
          type: string
      - name: is_flow
        in: query
        schema:
          type: boolean
      - name: path_start
        in: query
        schema:
          type: string
      - name: label
        in: query
        required: false
        schema:
          type: string
        description: Filter by label
      responses:
        '200':
          description: nats trigger list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/NatsTrigger'
  /w/{workspace}/nats_triggers/exists/{path}:
    get:
      summary: Does Nats Trigger Exists
      operationId: existsNatsTrigger
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
      - $ref: '#/components/parameters/Path'
      responses:
        '200':
          description: nats trigger exists
          content:
            application/json:
              schema:
                type: boolean
  /w/{workspace}/nats_triggers/setmode/{path}:
    post:
      summary: Set Enabled Nats Trigger
      operationId: setNatsTriggerMode
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
      - $ref: '#/components/parameters/Path'
      requestBody:
        description: updated nats trigger enable
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mode:
                  $ref: '#/components/schemas/TriggerMode'
                force:
                  type: boolean
                  description: 'Bypass the parent-state conflict warning when enabling a trigger in a fork whose parent has the same path enabled.

                    '
              required:
              - mode
      responses:
        '200':
          description: nats trigger enabled set
          content:
            text/plain:
              schema:
                type: string
  /w/{workspace}/nats_triggers/test:
    post:
      summary: Test NATS Connection
      operationId: testNatsConnection
      tags:
      - nats_trigger
      parameters:
      - $ref: '#/components/parameters/WorkspaceId'
      requestBody:
        description: test nats connection
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connection:
                  type: object
              required:
              - connection
      responses:
        '200':
          description: successfuly connected to NATS servers
          content:
            text/plain:
              schema:
                type: string
components:
  parameters:
    WorkspaceId:
      name: workspace
      in: path
      required: true
      schema:
        type: string
    Page:
      name: page
      description: which page to return (start at 1, default 1)
      in: query
      schema:
        type: integer
    Path:
      name: path
      in: path
      required: true
      schema:
        type: string
    PerPage:
      name: per_page
      description: number of items to return for a given page (default 30, max 100)
      in: query
      schema:
        type: integer
  schemas:
    NatsTrigger:
      allOf:
      - $ref: '#/components/schemas/TriggerExtraProperty'
      type: object
      properties:
        nats_resource_path:
          type: string
          description: Path to the NATS resource containing connection configuration
        use_jetstream:
          type: boolean
          description: If true, uses NATS JetStream for durable message delivery
        stream_name:
          type: string
          nullable: true
          description: JetStream stream name (required when use_jetstream is true)
        consumer_name:
          type: string
          nullable: true
          description: JetStream consumer name (required when use_jetstream is true)
        subjects:
          type: array
          items:
            type: string
          description: Array of NATS subjects to subscribe to
        server_id:
          type: string
          description: ID of the server currently handling this trigger (internal)
        last_server_ping:
          type: string
          format: date-time
          description: Timestamp of last server heartbeat (internal)
        error:
          type: string
          description: Last error message if the trigger failed
        error_handler_path:
          type: string
          description: Path to a script or flow to run when the triggered job fails
        error_handler_args:
          $ref: '#/components/schemas/ScriptArgs'
          description: Arguments to pass to the error handler
        retry:
          $ref: ../../openflow.openapi.yaml#/components/schemas/Retry
          description: Retry configuration for failed executions
      required:
      - nats_resource_path
      - use_jetstream
      - subjects
    TriggerExtraProperty:
      type: object
      properties:
        path:
          type: string
          description: The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`. This is the trigger object path, not the HTTP route path.
        script_path:
          type: string
          description: Path to the script or flow to execute when triggered
        permissioned_as:
          type: string
          description: The user or group this trigger runs as (permissioned_as)
        extra_perms:
          type: object
          description: Additional permissions for this trigger
          additionalProperties:
            type: boolean
        workspace_id:
          type: string
          description: The workspace this trigger belongs to
        edited_by:
          type: string
          description: Username of the last person who edited this trigger
        edited_at:
          type: string
          format: date-time
          description: Timestamp of the last edit
        is_flow:
          type: boolean
          description: True if script_path points to a flow, false if it points to a script
        mode:
          $ref: '#/components/schemas/TriggerMode'
          description: Trigger mode (enabled/disabled)
        labels:
          type: array
          items:
            type: string
          default: []
      required:
      - path
      - script_path
      - permissioned_as
      - extra_perms
      - workspace_id
      - edited_by
      - edited_at
      - is_flow
      - mode
    ScriptArgs:
      type: object
      description: The arguments to pass to the script or flow
      additionalProperties: true
    TriggerMode:
      description: job trigger mode
      type: string
      enum:
      - enabled
      - disabled
      - suspended
    NewNatsTrigger:
      type: object
      properties:
        path:
          type: string
          description: The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`. This is the trigger object path, not the HTTP route path.
        script_path:
          type: string
          description: Path to the script or flow to execute when a message is received
        is_flow:
          type: boolean
          description: True if script_path points to a flow, false if it points to a script
        nats_resource_path:
          type: string
          description: Path to the NATS resource containing connection configuration
        use_jetstream:
          type: boolean
          description: If true, uses NATS JetStream for durable message delivery
        stream_name:
          type: string
          nullable: true
          description: JetStream stream name (required when use_jetstream is true)
        consumer_name:
          type: string
          nullable: true
          description: JetStream consumer name (required when use_jetstream is true)
        subjects:
          type: array
          items:
            type: string
          description: Array of NATS subjects to subscribe to
        mode:
          $ref: '#/components/schemas/TriggerMode'
        error_handler_path:
          type: string
          description: Path to a script or flow to run when the triggered job fails
        error_handler_args:
          $ref: '#/components/schemas/ScriptArgs'
          description: Arguments to pass to the error handler
        retry:
          $ref: ../../openflow.openapi.yaml#/components/schemas/Retry
          description: Retry configuration for failed executions
        permissioned_as:
          type: string
          description: The user or group this trigger runs as. Used during deployment to preserve the original trigger owner.
        preserve_permissioned_as:
          type: boolean
          description: When true and the caller is a member of the 'wm_deployers' group, preserves the original permissioned_as value instead of overwriting it.
        labels:
          type: array
          items:
            type: string
      required:
      - path
      - script_path
      - is_flow
      - nats_resource_path
      - use_jetstream
      - subjects
    EditNatsTrigger:
      type: object
      properties:
        nats_resource_path:
          type: string
          description: Path to the NATS resource containing connection configuration
        use_jetstream:
          type: boolean
          description: If true, uses NATS JetStream for durable message delivery
        stream_name:
          type: string
          nullable: true
          description: JetStream stream name (required when use_jetstream is true)
        consumer_name:
          type: string
          nullable: true
          description: JetStream consumer name (required when use_jetstream is true)
        subjects:
          type: array
          items:
            type: string
          description: Array of NATS subjects to subscribe to
        path:
          type: string
          description: The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`. This is the trigger object path, not the HTTP route path.
        script_path:
          type: string
          description: Path to the script or flow to execute when a message is received
        is_flow:
          type: boolean
          description: True if script_path points to a flow, false if it points to a script
        error_handler_path:
          type: string
          description: Path to a script or flow to run when the triggered job fails
        error_handler_args:
          $ref: '#/components/schemas/ScriptArgs'
          description: Arguments to pass to the error handler
        retry:
          $ref: ../../openflow.openapi.yaml#/components/schemas/Retry
          description: Retry configuration for failed executions
        permissioned_as:
          type: string
          description: The user or group this trigger runs as. Used during deployment to preserve the original trigger owner.
        preserve_permissioned_as:
          type: boolean
          description: When true and the caller is a member of the 'wm_deployers' group, preserves the original permissioned_as value instead of overwriting it.
        labels:
          type: array
          items:
            type: string
      required:
      - path
      - script_path
      - nats_resource_path
      - use_jetstream
      - subjects
      - is_flow
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    cookieAuth:
      type: apiKey
      in: cookie
      name: token
externalDocs:
  description: documentation portal
  url: https://windmill.dev