Functions

Create a trigger

Changed on

Creates a trigger for a Function visible on the branch. The required type discriminator selects the trigger-specific configuration. The supported types are schedule and storage_object_created. A schedule trigger uses a numeric five-field cron expression interpreted in UTC. A storage-object-created trigger fires only after a successful upload to one exact bucket and may narrow matches to an object-key prefix.

The name must be unique among triggers visible on the branch, including inherited triggers.

Note: This endpoint is currently in Beta.

post/projects/{project_id}/branches/{branch_id}/triggers

Request

  • Base URL: https://console.neon.tech/api/v2
  • URL: https://console.neon.tech/api/v2/projects/{project_id}/branches/{branch_id}/triggers
  • Auth: one of:
    • HTTP bearer
    • API key in cookie zenith
    • API key in cookie keycloak_token

Request body

OR

Example request

{
  "schedule": {
    "cron": "0 9 * * 1-5"
  }
}

Response

Trigger created

Example response

{
  "trigger": {
    "schedule": {
      "cron": "0 9 * * 1-5"
    }
  }
}

Changes

    • ▲

      added to the response property oneOf list for the response status

    • ▲

      removed the required property ///// from the response with the status

    • ○

      added storage_object_created mapping keys to the request discriminator

    • ○

      added to the request body oneOf list

    • ○

      added storage_object_created discriminator mapping keys to the response property for the response status

    • ○

      endpoint added