Skip to main content
Neon Postgres Docs

Search documentation

Type to search this documentation.

Get a trigger

GET/projects/{project_id}/branches/{branch_id}/triggers/{trigger_id}Get a trigger

Returns the trigger visible on the branch. The supported trigger types are schedule and storage_object_created.

Note: This endpoint is currently in Beta.

Parameters

project_idstringpathrequired

The Neon project ID

pattern ^[a-z0-9-]{1,60}$

branch_idstringpathrequired

The Neon branch ID

pattern ^[a-z0-9-]{1,60}$

trigger_idstringpathrequired

The opaque, project-wide trigger ID

maxLength 128 · minLength 1 · pattern ^[A-Za-z0-9][A-Za-z0-9_.\-]{0,127}$

Responses

200The triggerapplication/json
objectTriggerResponse
triggerobjectrequired

A branch-effective trigger discriminated by `type`. The supported trigger types are `schedule` and `storage_object_created`.

Show child attributes
oneOf · 2 options
Option 1objectScheduleTrigger

A branch-effective schedule trigger for a Function.

enabledbooleanrequired
function_pathstringrequired

Path passed to the target Function.

function_slugstringrequired

The branch-local Function slug resolved when an occurrence is consumed.

inheritedbooleanrequired

True when the effective configuration was authored on an ancestor branch.

namestringrequired

Human-readable trigger name.

next_run_atnull | stringrequired

Next scheduled occurrence as an RFC 3339 UTC timestamp, or null while disabled or inherited and not explicitly enabled on this branch.

scheduleobjectrequired

A numeric five-field cron schedule interpreted in UTC.

Show child attributes
cronstringrequired

Numeric five-field cron expression (minute through day-of-week), interpreted in UTC.

maxLength 1024 · minLength 1

trigger_idstringrequired

Opaque, server-minted project-wide trigger identifier.

maxLength 128 · minLength 1 · pattern ^[A-Za-z0-9][A-Za-z0-9_.\-]{0,127}$

typestringrequired

Trigger type discriminator.

one of "schedule"

versioninteger · int64required

Monotonic configuration version.

minimum 1

Option 2objectStorageObjectCreatedTrigger

A branch-effective trigger that invokes a Function after a successful upload matching its exact bucket and optional object-key prefix.

enabledbooleanrequired
function_pathstringrequired

Path passed to the target Function.

function_slugstringrequired

The branch-local Function slug resolved when an invocation is consumed.

inheritedbooleanrequired

True when the effective configuration was authored on an ancestor branch.

namestringrequired

Human-readable trigger name.

storage_object_createdobjectrequired

Matches successful uploads to one exact bucket and, when configured, an object-key prefix. The Function receives a JSON request body with `type` set to `storage_object_created` and a `data` object containing exactly `bucket_name` and `object_key`.

Show child attributes
bucket_namestringrequired

The exact object-storage bucket name to watch.

maxLength 63 · minLength 3

prefixstring

Optional object-key prefix of at most 1024 UTF-8 bytes. When omitted, every key in the bucket matches. When present, the full object key must start with these exact bytes; matching is case-sensitive and does not normalize paths or require a path-segment boundary. Match-all responses omit this field rather than returning an empty string.

maxLength 1024 · minLength 1 · pattern ^[^\x00-\x1f\x7f-\x9f]+$

trigger_idstringrequired

Opaque, server-minted project-wide trigger identifier.

maxLength 128 · minLength 1 · pattern ^[A-Za-z0-9][A-Za-z0-9_.\-]{0,127}$

typestringrequired

Trigger type discriminator.

one of "storage_object_created"

versioninteger · int64required

Monotonic configuration version.

minimum 1

Example response
{
  "trigger": {
    "enabled": true,
    "function_path": "string",
    "function_slug": "string",
    "inherited": true,
    "name": "string",
    "next_run_at": "string",
    "schedule": {
      "cron": "0 9 * * 1-5"
    },
    "trigger_id": "string",
    "type": "schedule",
    "version": 0
  }
}
defaultGeneral Error. The request may or may not be safe to retry, depending on the HTTP method, response status code, and whether a response was received. - If no response is returned from the API, a network error or timeout likely occurred. - In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results. The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**. The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout. Any request that returns a `503 Service Unavailable` response is always safe to retry. Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress. application/json
objectGeneralError
codestringrequired

default ""

messagestringrequired

Error message

request_idstring

Unique identifier for the request, useful for debugging. You can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.

Example response
{
  "code": "",
  "message": "string",
  "request_id": "string"
}
Documentation menu