latestOpenAPI 3.0.02026-07-135965404.0 KB

a1bd874b5960

Notifications

Create a new notification

Create a new notification for a resource in your account. Notifications can be sent via email or webhook;

  • To enable email, pass an array of email addresses to the recipients parameter of this call.
  • To enable webhooks, setup the webhook callback URL in your account settings via PATCH /account.

Notes:

  • Authenticated user should have notifications permission
post/notifications

Headers

ev-api-keystring required

API Key required to make API call.

ev-access-tokenstring required

Access token required to make the API call.

Request body

type'file' | 'folder' required

What kind of notification you're making. Valid choices are:

  • file to monitor activity for a file resource
  • folder to monitor activity for a folder resource
resourcestring required

Resources for this notification. See details on how to specify resources above.

action'upload' | 'download' | 'delete' | 'all' required

Type of action be notified about. Notifications will only be fired for the given type of action. Valid choices are upload, download, delete or all (upload/download/delete)

usernamesstring[] required

Determines which users' actions should trigger the notification.

Rather than listing individual users, you can also use 3 special options:

  • notice_user_all for activity by any user or share recipient
  • notice_user_all_users for activity only by user accounts
  • notice_user_all_recipient for activity only by share recipients
sendEmailboolean required

Set to true if the user should be notified by email when the notification is triggered.

recipientsstring[]

Email addresses to send notification emails to. If not specified, sends to the current user's email address.

messagestring

Custom message to include in notification emails.

Example request

{
  "type": "file",
  "action": "upload",
  "sendEmail": true,
  "recipients": [
    "myemail@example.com"
  ]
}

Response

Successful Operation

NotificationResponse required— unresolved $ref