For the complete documentation index, see llms.txt. This page is also available as Markdown.

Save Files Trigger

Create or update a files trigger.

A files trigger runs an action automatically on file storage events — for example notifying the team when a file is uploaded. It fires on OnFileUploaded or OnFileDeleted. This method creates the trigger (or updates it when you pass an existing triggerId); the response returns its id.

This method is on the Hub surface (norbix.hub.files) — call it from admin tooling or IaC.

These examples assume the SDK is installed and your credentials are set as environment variables — each client reads them automatically, so the constructors below take no arguments. See Install a Norbix SDK.

import { Norbix } from '@norbix.ai/ts';
const norbix = new Norbix();

const result = await norbix.hub.files.saveFilesTrigger({
  trigger: {
    type: 'Files',
    when: 'OnFileUploaded',
    name: 'notify-on-upload',
    isEnabled: true,
    action: {
      type: 'email',
      templateId: 'tmpl_5XqvoF4k6I2GfarDBg3zqq',
      deliverySettings: { recipientsSourceType: 'AllUsers' },
    },
  },
});
using Norbix.Sdk;
using Norbix.Sdk.Types.Hub;

using var client = new NorbixClient();

var result = await client.Files.SaveFilesTriggerAsync(new SaveFilesTrigger
{
    Trigger = new FilesTriggerRequest
    {
        Type = TriggerType.Files,
        When = FilesTriggerType.OnFileUploaded,
        Name = "notify-on-upload",
        IsEnabled = true,
        Action = new TriggerActionEmailDto
        {
            Type = TriggerActionType.Email,
            TemplateId = "tmpl_5XqvoF4k6I2GfarDBg3zqq",
            DeliverySettings = new EmailToAllUsersDeliverySettingsDto
            {
                RecipientsSourceType = EmailCampaignRecipientsSourceTypes.AllUsers,
            },
        },
    },
});

Scenarios

The examples above send an email to all users. The action object is where the behaviour lives — here is one working example for every action type (JavaScript; the structure is identical in the other SDKs, only syntax changes as in the tabs above).

Email specific users

Send a templated email to chosen project users when a file is uploaded.

Email raw addresses

Send the email to fixed addresses (an ops inbox, an external partner) instead of project users.

Push notification to all users

Send a mobile push from a push template to every user when a file is uploaded.

SMS to phone numbers

Send a text message to fixed phone numbers.

Call a webhook

Publish the event to your configured webhook destinations. Destinations (URLs, secrets) are managed in the Webhooks module; here you only pick which ones receive it.

Run a function

Execute one of your functions from the Code module with the event as input.

Send a realtime (SSE) event

Push a server-sent event to connected clients — for live UI updates.

Run a marketplace function

Fire an installed marketplace function; payload passes extra static values.

For every field of every shape (CC/BCC, campaign timing, timezone settings, token mappings, collection-based audiences), see the API reference. More runnable examples live in the SDK repos on GitHub.

In the dashboard

Manage this visually in Norbix Cloud — see Files → Triggers.

API reference

Full request and response for this endpoint: Save Files Trigger.

Last updated