/functions/{name}/triggersList Function Triggers
Returns the named function's EVENT triggers, newest first.
Each entry has id, functionName, collection, events, filter, enabled, logOkInvocations and createdAt.
Scheduled triggers are listed at GET /@{projectSlug}/forge/schedules, not here.
Requires PROJECT_ADMIN.
| name * | path | The function's name. A module's operation is named |
| projectSlug * | path | The project's slug: the path segment after It is unique within the org. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 400 | K9O_INVALID_FIELD_VALUE | The project slug or the function name is not a valid identifier. |
| 401 | K9O_UNAUTHENTICATED | The caller presented no authenticated session. |
| 403 | K9O_ACCESS_DENIED | The caller has no access to this project. |
| 403 | K9O_IAM_POLICY_DENIED | The bound IAM policy ceiling denies reading function triggers; the default floor is PROJECT_ADMIN. |
| 404 | K9O_FUNCTION_NOT_FOUND | No function with that name exists in this project, or it is retired. |
| data * | object[] | The function's collection and bucket triggers, newest first. Schedules and erasure triggers are listed by their own endpoints. |
| id * | string <uuid> | The trigger's id, a UUID. |
| functionName * | string | The function the trigger runs. |
| collection * | any | The collection whose writes fire the trigger; null on a bucket trigger. |
| One of: string | ||
| or: null | ||
| bucket * | any | The bucket whose object events fire the trigger; null on a collection trigger. |
| One of: string | ||
| or: null | ||
| events * | any[] | The events that fire the trigger: A function that receives |
| One of: "insert" | "update" | "delete" | "upsert" | ||
| or: "object.created" | "object.deleted" | "object.expired" | ||
| filter * | any | The condition an event must match: a record predicate on a collection trigger, object conditions on a bucket trigger. Null when the trigger fires on every matching event. |
| One of: object | ||
| or: null | ||
| enabled * | boolean | Whether the trigger fires. |
| logOkInvocations * | boolean | Whether successful invocations are logged as well as failed ones. |
| createdAt * | string <date-time> | When the trigger was created. |
| meta * | any | |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.functions.triggers.list('greet')Showing example in TypeScript
{
"data": [
{
"id": "string",
"functionName": "string",
"collection": "string",
"bucket": "string",
"events": [
"insert"
],
"enabled": false,
"logOkInvocations": false,
"createdAt": "string"
}
]
}