---
title: "Trigger a Flow for specified users"
method: POST
path: "/v1/flows/trigger/{triggerId}"
tags: ["Flows"]
---

# Trigger a Flow for specified users

`POST /v1/flows/trigger/{triggerId}`

Enrolls users in a Flow via an API trigger. Users can be identified
by email or userId. All specified users must be valid members of the
company associated with the API key. If any users are not found, the
request will fail without enrolling any users.

## Path parameters

- `triggerId` string, required

## Request body

- union — Request body for triggering a Flow. Provide either emails or userIds.
  - object
    - `emails` string[], required — List of user emails to enroll in the Flow
    - `userIds` string[] — List of user IDs to enroll in the Flow
  - object
    - `emails` string[] — List of user emails to enroll in the Flow
    - `userIds` string[], required — List of user IDs to enroll in the Flow

## Response `200`

Users enrolled successfully

- object
  - `status` 'success'
  - `links` Links
    - `self` string, uri
    - `related` object[]
      - `type` string
      - `href` string, uri
  - `data` object
    - `flowId` string
    - `triggerId` string
    - `enrolledCount` number — Number of users successfully enrolled in the flow
    - `enrolledUserIds` string[] — UUIDs of users successfully enrolled
    - `skippedCount` number — Number of users skipped because they are already enrolled in this flow

## Other responses

- `400` — `BAD REQUEST`: Body or Query Params are malformed (missing, extra, or invalid values)
- `401` — `UNAUTHORIZED`: Request was sent with an expired or missing API Key
- `403` — `FORBIDDEN`: Request was authenticated but the resource requested is missing or not accessible with that key
- `404` — `NOT FOUND`: The requested resource was not found
- `429` — `TOO MANY REQUESTS`: Company is being rate limited
- `500` — `INTERNAL SERVER ERROR`: Request was unable to be processed due to a server error. Contact our support team.
- `501` — `NOT IMPLEMENTED`: Method is not implemented on that endpoint.

---

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