Skip to main content
GET/functions/{name}/triggers

List 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.

Parameters
name *path

The function's name.

A module's operation is named <module>:<operation>.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
400K9O_INVALID_FIELD_VALUEThe project slug or the function name is not a valid identifier.
401K9O_UNAUTHENTICATEDThe caller presented no authenticated session.
403K9O_ACCESS_DENIEDThe caller has no access to this project.
403K9O_IAM_POLICY_DENIEDThe bound IAM policy ceiling denies reading function triggers; the default floor is PROJECT_ADMIN.
404K9O_FUNCTION_NOT_FOUNDNo function with that name exists in this project, or it is retired.
Response body (200)
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: insert, update, delete and upsert on a collection; on a bucket, object.created (an upload, an overwrite included), object.deleted (a delete through the API) and object.expired (removed by the bucket's deleteAfterDays).

A function that receives object.deleted or object.expired can't read the object any more.

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
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.functions.triggers.list('greet')

Showing example in TypeScript

Response example (200)
{
  "data": [
    {
      "id": "string",
      "functionName": "string",
      "collection": "string",
      "bucket": "string",
      "events": [
        "insert"
      ],
      "enabled": false,
      "logOkInvocations": false,
      "createdAt": "string"
    }
  ]
}

More in Compute & Automation