GET /api/mail_notifications
List of email notifications

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort and order by a searchable field, e.g. ‘id DESC’

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, ‘all’ to return all results

Validations:

  • Must match regular expression /\A([1-9]\d|all)\Z$/.

Search fields

Field name Type Possible values
description text
name string
user string

GET /api/mail_notifications/:id
Show an email notification

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Numerical ID or email notification name

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/users/:user_id/mail_notifications
Add an email notification for a user

Examples

POST /api/users/988725677/mail_notifications
{
  "subscription": "subscribe to my hosts",
  "mail_notification_id": 518870487,
  "mail_notification": {}
}
200
{}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

Validations:

  • Must be a String

mail_notification_id
required

Validations:

  • Must be a Integer

interval
optional

Mail notification interval option, e.g. Daily, Weekly or Monthly. Required for summary notification

Validations:

  • Must be a String

subscription
optional

Mail notification subscription option, e.g. Subscribe, Subscribe to my hosts or Subscribe to all hosts. Required for host built and config error state

Validations:

  • Must be a String

mail_query
optional

Relevant only for audit summary notification

Validations:

  • Must be a String


PUT /api/users/:user_id/mail_notifications/:mail_notification_id
Update an email notification for a user

Examples

PUT /api/users/988725679/mail_notifications
{
  "subscription": "subscribe to all hosts",
  "mail_notification": {}
}
200
{}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

Validations:

  • Must be a String

mail_notification_id
required

Validations:

  • Must be a Integer

interval
optional

Mail notification interval option, e.g. Daily, Weekly or Monthly. Required for summary notification

Validations:

  • Must be a String

subscription
optional

Mail notification subscription option, e.g. Subscribe, Subscribe to my hosts or Subscribe to all hosts. Required for host built and config error state

Validations:

  • Must be a String

mail_query
optional

Relevant only for audit summary notification

Validations:

  • Must be a String


DELETE /api/users/:user_id/mail_notifications/:mail_notification_id
Remove an email notification for a user

Examples

DELETE /api/users/988725677/mail_notifications
{
  "mail_notification": {}
}
204

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

Validations:

  • Must be a String

mail_notification_id
required

Validations:

  • Must be a Integer


GET /api/users/:user_id/mail_notifications
List all email notifications for a user

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

Validations:

  • Must be a String