Event Targets
An EventTarget is a delivery destination for EventRecords.
List Event Targets
Command
files-cli event-targets list
Output
Outputs a list of EventTarget objects according to the output format.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Additional Arguments
Show Event Target
Command
files-cli event-targets find
Output
Outputs a EventTarget object according to the output format.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Flags
| Flag | Description |
|---|---|
| --id= int64 Required | Event Target ID. |
Create Event Target
Command
files-cli event-targets create
Output
Outputs a EventTarget object according to the output format.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Flags
| Flag | Default | Description |
|---|---|---|
| --name= string Required | Event Target name. | |
| --workspace-id= int64 | 0 | Workspace ID. 0 means the default workspace or site-wide. |
| --apply-to-all-workspaces boolean | false | If true, this default-workspace target can receive events from all workspaces. |
| --enabled boolean | true | Whether this Event Target can receive events. |
| --config= object Required | Event Target configuration. Fields depend on target_type. | |
| --delivery-policy= object | Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400. Slack and Teams support delivery_mode (immediate or subfolder_summary), summary_path (empty string means root), and summary_delay (15–300 seconds, default 60). The summary applies to matching file activity under summary_path; other matching events retain immediate delivery. | |
| --target-type= string Required | Event Target type. Possible values: email, webhook, slack_webhook, teams_webhook, amazon_sns, google_pubsub, folder |
Update Event Target
Command
files-cli event-targets update
Output
Outputs a EventTarget object according to the output format.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Flags
| Flag | Description |
|---|---|
| --id= int64 Required | Event Target ID. |
| --name= string | Event Target name. |
| --workspace-id= int64 | Workspace ID. 0 means the default workspace or site-wide. |
| --apply-to-all-workspaces boolean | If true, this default-workspace target can receive events from all workspaces. |
| --enabled boolean | Whether this Event Target can receive events. |
| --config= object | Event Target configuration. Fields depend on target_type. |
| --delivery-policy= object | Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400. Slack and Teams support delivery_mode (immediate or subfolder_summary), summary_path (empty string means root), and summary_delay (15–300 seconds, default 60). The summary applies to matching file activity under summary_path; other matching events retain immediate delivery. |
Delete Event Target
Command
files-cli event-targets delete
Output
No output is returned.
Authorization Requirement
Requires a Site-Wide API key, or a User API key or session from a Site Administrator or a Workspace Administrator for the relevant workspace.
Flags
| Flag | Description |
|---|---|
| --id= int64 Required | Event Target ID. |
The EventTarget Object
Some of the commands above return a EventTarget object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| id int64 | Event Target ID |
| name string | Event Target name. |
| target_type string | Event Target type. Possible values: email, webhook, slack_webhook, teams_webhook, amazon_sns, google_pubsub, folder |
| workspace_id int64 | Workspace ID. 0 means the default workspace or site-wide. |
| apply_to_all_workspaces boolean | If true, this default-workspace target can receive events from all workspaces. |
| enabled boolean | Whether this Event Target can receive events. |
| config object | Event Target configuration. Fields depend on target_type. |
| delivery_policy object | Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400. Slack and Teams support delivery_mode (immediate or subfolder_summary), summary_path (empty string means root), and summary_delay (15–300 seconds, default 60). The summary applies to matching file activity under summary_path; other matching events retain immediate delivery. |
| created_at date-time | Event Target create date/time. |
| updated_at date-time | Event Target update date/time. |
config
Settings for the target's target_type. Each field names the target types that use it.
| Value Hash Parameter | Description |
|---|---|
| user_ids array of integers | Required for email targets. IDs of active users who receive the email. Each user must belong to this target's workspace and to this site or a parent site authorized to access it. At least 1 item. |
| url string | Required for webhook, Slack and Teams targets. Webhook URL. Slack and Teams URLs must use HTTPS. |
| headers object of string values | Webhook targets only. Additional HTTP headers sent with each request. Files.com sets Content-Type, X-Files-Event-Id and X-Files-Event-Type itself. Null sends no additional headers. |
| signing_secret string | Webhook targets only. When set, each request includes X-Files-Signature and X-Files-Signature-V2 headers containing the HMAC-SHA256 hex digest of the request body. |
| use_dedicated_ips boolean | Webhook targets only. If enabled, requests are sent from this site's dedicated IP address. Delivery fails when the site has none. Use true or false. Any value other than false or null enables it, including integers such as 0 and 1. |
| username string | Slack targets only. Display name for messages. Defaults to Files.com. |
| channel string | Slack targets only. Channel to post to instead of the webhook's default channel. |
| icon_emoji string | Slack targets only. Emoji to use as the message icon instead of the Files.com icon. |
| arn string | Required for Amazon SNS targets. ARN of the SNS topic. |
| aws_credentials object | Required for Amazon SNS targets. Responses omit secret_access_key. Region defaults to us-east-1. |
| project_id string | Required for Google Pub/Sub targets. Google Cloud project ID. |
| topic_id string | Required for Google Pub/Sub targets. Pub/Sub topic ID. It must start with a letter, must not start with goog, and must be 3 to 255 characters. |
| google_credentials object | Required for Google Pub/Sub targets. Service account key as an object, or the key file contents as a JSON string. It is stored as an object. Responses omit private_key. |
| path string | Required for folder targets. Folder that receives event files. |
| format string | Required for folder targets. Event file format. Cannot be changed after creation. Possible values: json, csv. |
delivery_policy
Delivery settings for this target. Each target-specific field names the target types that use it. max_attempts and retry_delay_minutes control retries of failed deliveries, and an Event Subscription's delivery_policy can override them.
| Value Hash Parameter | Description |
|---|---|
| max_attempts integer | Maximum delivery attempts, including the first attempt. A value below 1 uses the default of 5. Null works like an omitted key. |
| retry_delay_minutes array of integers | Minutes to wait before each retry. The last value is used for any later retries, so a list with one value applies it to every retry. An empty list uses the default of [1,5,15,60,180]. Null works like an omitted key. |
| batch_interval integer | Email and folder targets only. Seconds to collect events before delivering them together. An omitted or blank value is stored as 600. A numeric string is stored as an integer. From 600 to 86400. |
| delivery_mode string | Slack and Teams targets only. Send each event immediately, or summarize file activity under summary_path by first-level subfolder. Other events are still sent immediately. Omitted means immediate. Possible values: immediate, subfolder_summary. |
| summary_path string | Slack and Teams targets only. Required when delivery_mode is subfolder_summary. Folder whose file activity is summarized. An empty string means the root folder. |
| summary_delay integer | Slack and Teams targets only. Seconds without new matching activity before a summary is sent. Omitted means 60. From 15 to 300. |