---
title: "create amqp trigger"
method: POST
path: "/w/{workspace}/amqp_triggers/create"
tags: ["amqp_trigger"]
---

# create amqp trigger

`POST /w/{workspace}/amqp_triggers/create`

## Path parameters

- `workspace` string, required

## Request body

- NewAmqpTrigger
  - `amqp_resource_path` string, required — Path to the AMQP resource containing broker connection configuration
  - `queue_name` string, required — Name of the queue to consume messages from
  - `exchange` AmqpExchange
    - `exchange_name` string, required — Name of the exchange to bind the consumed queue to
    - `routing_keys` string[] — Routing keys used to bind the queue to the exchange
  - `options` AmqpOptions
    - `declare_queue` boolean — Declare the queue (durable) before consuming; when false the queue is declared passively and must already exist
    - `prefetch_count` integer — Maximum number of unacknowledged messages the broker delivers at once (1-65535)
  - `path` string, required — The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`.
  - `script_path` string, required — Path to the script or flow to execute when a message is received
  - `is_flow` boolean, required — True if script_path points to a flow, false if it points to a script
  - `mode` 'enabled' | 'disabled' | 'suspended' — job trigger mode
  - `error_handler_path` string — Path to a script or flow to run when the triggered job fails
  - `error_handler_args` ScriptArgs — The arguments to pass to the script or flow
  - `retry` Retry — unresolved $ref
  - `permissioned_as` string — The user or group this trigger runs as. Used during deployment to preserve the original trigger owner.
  - `preserve_permissioned_as` boolean — When true and the caller is a member of the 'wm_deployers' group, preserves the original permissioned_as value instead of overwriting it.
  - `labels` string[]

## Response `201`

amqp trigger created

---

[API](https://skmtc.net/windmill/apis/windmill-api.md) · [All operations](https://skmtc.net/windmill/apis/windmill-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/windmill/windmill-api/revisions/ece11d5a1cd7/schema)
