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

# Update a trigger

> Updates the fields given; the rest are kept. The trigger can also be named by `subject` in the body.



## OpenAPI

````yaml /api-reference/endpoint/trigger/openapi.json patch /trigger/triggers/{trigger_type}/{topic}
openapi: 3.0.3
info:
  title: quiva.ai Triggers API
  description: >-
    Manages the triggers that start automation in response to events — create,
    retrieve and delete gateway triggers (custom API endpoints that kick off a
    flow) and stream triggers (real-time data flowing from a source into a
    target).
  contact:
    name: quiva.ai Support
  version: '1.0'
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Triggers
    description: Gateway, stream and object store triggers
  - name: Email triggers
    description: Emails received by email triggers
paths:
  /trigger/triggers/{trigger_type}/{topic}:
    patch:
      tags:
        - Triggers
      summary: Update a trigger
      description: >-
        Updates the fields given; the rest are kept. The trigger can also be
        named by `subject` in the body.
      operationId: patchTrigger
      parameters:
        - name: trigger_type
          in: path
          required: true
          description: 'Trigger type: gateway, stream, subject, obj or email'
          schema:
            type: string
        - name: topic
          in: path
          required: true
          description: Topic of the trigger, without the prefix
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Trigger name
                description:
                  type: string
                  description: Description
                subject:
                  type: string
                  description: Trigger subject
                trigger_type:
                  type: string
                  description: Trigger type
                gateway_mapping:
                  $ref: '#/components/schemas/GatewayMapping'
                source:
                  $ref: '#/components/schemas/TriggerSource'
                target:
                  $ref: '#/components/schemas/TriggerTarget'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Trigger not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    GatewayMapping:
      type: object
      properties:
        error:
          type: string
          description: >-
            Error message or identifier for failed mapping attempts or
            validation issues.
        gateway:
          type: string
          description: >-
            Gateway identifier associated with this mapping. Links to the
            specific gateway infrastructure.
        is_public:
          type: boolean
          description: >-
            Whether the endpoint is publicly accessible without authentication.
            Default is false.
          default: false
          example: true
        limit:
          $ref: '#/components/schemas/GatewayLimit'
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - DELETE
            - PATCH
            - OPTIONS
            - HEAD
          description: >-
            HTTP method for the gateway endpoint. Determines how clients should
            interact with this endpoint.
          example: GET
        path:
          type: string
          description: >-
            URL path for the gateway endpoint, including the leading slash.
            Forms the route that clients use to access this endpoint.
          example: /api/resource
        subject:
          type: string
          description: >-
            Subject identifier for the gateway mapping. Used internally for
            routing and message delivery.
        timeout:
          type: integer
          description: >-
            Maximum time in milliseconds before the request times out. Default
            is 30000ms (30 seconds).
          minimum: 1
          default: 30000
          example: 30000
        traffic_distribution:
          type: object
          additionalProperties:
            type: number
          description: >-
            Traffic distribution configuration mapping version numbers to
            percentage allocations. Used for A/B testing or canary deployments.
          example:
            '1': 100
    TriggerSource:
      type: object
      properties:
        advertise:
          type: boolean
          description: >-
            Whether to advertise this trigger source to other services. When
            true, allows other services to discover this source.
        allow_trace:
          type: boolean
          description: >-
            Whether to allow request tracing. When true, enables debugging and
            performance monitoring.
        name:
          type: string
          description: >-
            Human-readable name for the source. Used for identification in logs
            and monitoring.
        response_type:
          type: string
          enum:
            - Singleton
            - Stream
            - Chunked
          description: |-
            Format of response data from this source:
            * Singleton - Returns a single response and closes
            * Stream - Continuously streams data until connection closes
            * Chunked - Returns paginated data in multiple responses
        subject:
          type: string
          description: >-
            Subject identifier for the source. Used for routing messages to/from
            this source.
        type:
          type: string
          enum:
            - stream
            - service
          description: |-
            Export type categorizing how this source behaves:
            * stream - Emits a continuous flow of data
            * service - Provides request/response functionality
        description:
          type: string
          description: >-
            Detailed information about the source including its purpose and data
            format.
        info_url:
          type: string
          description: >-
            URL pointing to additional documentation or information about this
            source.
    TriggerTarget:
      type: object
      properties:
        name:
          type: string
          description: >-
            Human-readable name for the target. Used for identification in logs
            and monitoring.
        subject:
          type: string
          description: >-
            Subject identifier for the target. Used for routing messages to this
            target.
        account:
          type: string
          description: >-
            Account identifier owning or associated with this target. Used for
            access control.
        local_subject:
          type: string
          description: Alternative subject for local routing within the same account.
        type:
          type: string
          enum:
            - stream
            - service
          description: |-
            Export type categorizing how this target behaves:
            * stream - Consumes a continuous flow of data
            * service - Provides request/response functionality
        share:
          type: boolean
          description: >-
            Whether this target is shareable with other accounts. When true,
            allows cross-account access.
        allow_trace:
          type: boolean
          description: >-
            Whether to allow request tracing to this target. When true, enables
            debugging and performance monitoring.
    TriggerResponse:
      type: object
      properties:
        body:
          type: object
          additionalProperties: true
          description: Complete trigger data containing all configurations and properties.
        metadata:
          type: object
          properties:
            subject:
              type: string
              description: >-
                Full subject identifier of the trigger, including type and
                topic.
              example: ms.trigger.gateway.my-gateway-trigger
        status_code:
          type: integer
          description: HTTP status code indicating the result of the operation.
          example: 200
    Error:
      type: object
      properties:
        error:
          type: string
          description: >-
            Detailed error message explaining what went wrong and potential
            solutions.
          example: 'Invalid request: Missing required field'
        status_code:
          type: integer
          description: HTTP status code indicating the specific error type.
          example: 400
    GatewayLimit:
      type: object
      required:
        - request
        - time
      properties:
        request:
          type: integer
          description: >-
            Maximum number of requests allowed within the specified time window.
            Used for rate limiting.
          minimum: 1
          example: 1000
        time:
          type: integer
          description: >-
            Time window in milliseconds for rate limiting calculations.
            Typically 1000ms (1 second).
          minimum: 1
          example: 1000
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.