Event Targets

An EventTarget is a delivery destination for EventRecords.

List Event Targets

Endpoint

GET/event_targets

Return Object

EventTarget[]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/event_targets.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "name": "example",
    "target_type": "example",
    "workspace_id": 1,
    "apply_to_all_workspaces": true,
    "enabled": true,
    "config": "example",
    "delivery_policy": "example",
    "created_at": "2000-01-01T01:00:00Z",
    "updated_at": "2000-01-01T01:00:00Z"
  }
]

Show Event Target

Endpoint

GET/event_targets/{id}

Return Object

EventTarget

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Event Target ID.

Example Request

curl https://app.files.com/api/rest/v1/event_targets/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "example",
  "target_type": "example",
  "workspace_id": 1,
  "apply_to_all_workspaces": true,
  "enabled": true,
  "config": "example",
  "delivery_policy": "example",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Create Event Target

Endpoint

POST/event_targets

Return Object

EventTarget

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDefaultDescription
name
string
Required
Event Target name.
workspace_id
int64
0Workspace ID. 0 means the default workspace or site-wide.
apply_to_all_workspaces
boolean
falseIf true, this default-workspace target can receive events from all workspaces.
enabled
boolean
trueWhether this Event Target can receive events.
config
object
Required
Event Target configuration. Folder targets accept path and format (json or csv).
delivery_policy
object
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400.
target_type
string
Required
Event Target type.
Possible values: email, webhook, slack_webhook, teams_webhook, amazon_sns, google_pubsub, folder

Example Request

curl https://app.files.com/api/rest/v1/event_targets.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"name":"example","workspace_id":1,"apply_to_all_workspaces":true,"enabled":true,"config":"example","delivery_policy":"example","target_type":"example"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "example",
  "target_type": "example",
  "workspace_id": 1,
  "apply_to_all_workspaces": true,
  "enabled": true,
  "config": "example",
  "delivery_policy": "example",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Update Event Target

Endpoint

PATCH/event_targets/{id}

Return Object

EventTarget

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
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. Folder targets accept path and format (json or csv).
delivery_policy
object
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400.

Example Request

curl https://app.files.com/api/rest/v1/event_targets/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"name":"example","workspace_id":1,"apply_to_all_workspaces":true,"enabled":true,"config":"example","delivery_policy":"example"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "example",
  "target_type": "example",
  "workspace_id": 1,
  "apply_to_all_workspaces": true,
  "enabled": true,
  "config": "example",
  "delivery_policy": "example",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Delete Event Target

Endpoint

DELETE/event_targets/{id}

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Event Target ID.

Example Request

curl https://app.files.com/api/rest/v1/event_targets/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The EventTarget Object

Some of the endpoints above return a EventTarget object. The attributes of this object are listed below.

AttributeDescription
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. Folder targets accept path and format (json or csv).
delivery_policy
object
Event Target delivery policy. Email and folder targets support batch_interval in seconds, between 600 and 86400.
created_at
date-time
Event Target create date/time.
updated_at
date-time
Event Target update date/time.

Example EventTarget Object

{
  "id": 1,
  "name": "example",
  "target_type": "example",
  "workspace_id": 1,
  "apply_to_all_workspaces": true,
  "enabled": true,
  "config": "example",
  "delivery_policy": "example",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}