---
title: "Create a proactive trigger"
method: POST
path: "/api/v1/proactive-triggers"
---

# Create a proactive trigger

`POST /api/v1/proactive-triggers`

## Request

- Base URL: `https://smartwebchat.eu`
- URL: `https://smartwebchat.eu/api/v1/proactive-triggers`
- Auth: HTTP bearer

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `chatbotId` string, required
  - `name` string, required
  - `triggerType` 'time_on_page' | 'exit_intent' | 'scroll_depth' | 'page_view_count' | 'inactivity', required
  - `conditionValue` object: { seconds } | { percent } | { count } | {}
  - `targetPagePattern` string
  - `messageTemplate` string
  - `cooldownMinutes` integer
  - `enabled` boolean
  - `priority` integer

## Response `201`

Created ProactiveTrigger

## Other responses

- `400`: Invalid input
- `401`: Missing or invalid API key
- `409`: A request with this Idempotency-Key is still being processed. Retry after the seconds given in Retry-After (2).
- `422`: Idempotency-Key was already used with a different request body. Use a new key for a new request.
- `429`: Rate limit exceeded: 600 requests per minute per account across all /api/v1/ routes. Wait for the seconds given in Retry-After (60) and retry.

---

[API](https://skmtc.dev/smartwebchat/apis/smartwebchat-api.md) · [All operations](https://skmtc.dev/smartwebchat/apis/smartwebchat-api/llms.txt) · [OpenAPI document](https://skmtc.dev/smartwebchat/apis/smartwebchat-api/revisions/1b052502dacb?raw)
