---
title: "Create or update a trigger"
method: POST
path: "/api/v3/trigger_instances/{slug}/upsert"
tags: ["Triggers"]
---

# Create or update a trigger

`POST /api/v3/trigger_instances/{slug}/upsert`

Creates a new trigger instance or updates an existing one with the same configuration. Triggers listen for events from external services (webhooks or polling) and can invoke your workflows. If a matching trigger already exists and is disabled, it will be re-enabled. Provide either a connected_account_id to pin a specific user connection, or a user_id to auto-resolve the first active connection for that user and the trigger's toolkit.

## Path parameters

- `slug` string, required — The slug of the trigger instance. Case-insensitive (internally normalized to uppercase).

## Request body

- object
  - `connectedAuthId` string, connectedAccountId — DEPRECATED: This parameter will be removed in a future version. Please use connected_account_id instead.
  - `triggerConfig` object — DEPRECATED: This parameter will be removed in a future version. Please use trigger_config instead.
  - `connected_account_id` string, connectedAccountId — Connected account nanoid. Optional when user_id is provided — the first active connection for that user and the trigger's toolkit is auto-resolved.
  - `user_id` string — The user id (entity id) that owns the connection. When connected_account_id is omitted, the first active connection for this user and the trigger's toolkit is auto-resolved (same as tool execution). When connected_account_id is also provided and the project has 2FA enabled, user_id is validated against the owner of that connection.
  - `trigger_config` object — Trigger configuration
  - `version` string — DEPRECATED: This parameter will be removed in a future version. Please use toolkit_versions instead.
  - `toolkit_versions` union — Toolkit version specification. Supports "latest" string or a record mapping toolkit slugs to specific versions.
    - string
    - object
    - unknown

## Response `200`

Successfully upserted trigger instance

- object
  - `trigger_id` string, required — ID of the updated trigger

## Other responses

- `201` — Successfully created trigger instance
- `204` — No content
- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Trigger instance not found
- `408` — Request timeout
- `409` — Conflict
- `410` — Gone
- `422` — Unprocessable entity
- `429` — Too many requests
- `500` — Internal server error
- `501` — Not implemented

---

[API](https://skmtc.net/composiohq/apis/composio-platform-api.md) · [All operations](https://skmtc.net/composiohq/apis/composio-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/composiohq/composio-platform-api/versions/df7478fc8f3b/schema)
