You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

Media type object

The following objects are directly related to the mediatype API.

Media type

The media type object has the following properties.

Property Type Description
mediatypeid ID ID of the media type.

Property behavior:
- read-only
- required for update operations
name string Name of the media type.

Property behavior:
- required for create operations
type integer Transport used by the media type.

Possible values:
0 - Email;
1 - Script;
2 - SMS;
4 - Webhook.

Property behavior:
- required for create operations
exec_path string For script media types exec_path contains the name of the executed script.

Property behavior:
- required if type is set to "Script"
gsm_modem string Serial device name of the GSM modem.

Property behavior:
- required if type is set to "SMS"
passwd string Authentication password.

Property behavior:
- supported if type is set to "Email"
smtp_email string Email address from which notifications will be sent.

Property behavior:
- required if type is set to "Email"
smtp_helo string SMTP HELO.

Property behavior:
- required if type is set to "Email"
smtp_server string SMTP server.

Property behavior:
- required if type is set to "Email"
smtp_port integer SMTP server port to connect to.
smtp_security integer SMTP connection security level to use.

Possible values:
0 - None;
1 - STARTTLS;
2 - SSL/TLS.
smtp_verify_host integer SSL verify host for SMTP.

Possible values:
0 - No;
1 - Yes.
smtp_verify_peer integer SSL verify peer for SMTP.

Possible values:
0 - No;
1 - Yes.
smtp_authentication integer SMTP authentication method to use.

Possible values:
0 - None;
1 - Normal password.
status integer Whether the media type is enabled.

Possible values:
0 - (default) Enabled;
1 - Disabled.
username string User name.

Property behavior:
- supported if type is set to "Email"
maxsessions integer The maximum number of alerts that can be processed in parallel.

Possible values if type is set to "SMS": (default) 1.

Possible values if type is set to "Email", "Script", or "Webhook": 0-100.
maxattempts integer The maximum number of attempts to send an alert.

Possible values: 1-100.

Default value: 3.
attempt_interval string The interval between retry attempts. Accepts seconds and time unit with suffix.

Possible values: 0-1h.

Default value: 10s.
content_type
(deprecated)
integer This parameter is deprecated, please use message_format instead.
Message format.

Possible values:
0 - plain text;
1 - (default) html.
message_format integer Message format.

Possible values:
0 - plain text;
1 - (default) html.
script text Media type webhook script javascript body.
timeout string Media type webhook script timeout.
Accepts seconds and time unit with suffix.

Possible values: 1-60s.

Default: 30s.
process_tags integer Defines should the webhook script response to be interpreted as tags and these tags should be added to associated event.

Possible values:
0 - (default) Ignore webhook script response;
1 - Process webhook script response as tags.
show_event_menu integer Show media type entry in problem.get and event.get property urls.

Possible values:
0 - (default) Do not add urls entry;
1 - Add media type to urls property.
event_menu_url string Define url property of media type entry in urls property of problem.get and event.get.
event_menu_name string Define name property of media type entry in urls property of problem.get and event.get.
parameters array Array of webhook or script input parameters.
description text Media type description.

Webhook parameters

Parameters passed to a webhook script when it is being called have the following properties.

Property Type Description
name string Parameter name.

Property behavior:
- required
value string Parameter value, supports macros.
Supported macros are described on the Supported macros page.

Script parameters

Parameters passed to a script when it is being called have the following properties.

Property Type Description
sortorder integer The order in which the parameters will be passed to the script as command-line arguments, starting with 0 as the first one.

Property behavior:
- required
value string Parameter value, supports macros.
Supported macros are described on the Supported macros page.

Message template

The message template object defines a template that will be used as a default message for action operations to send a notification. It has the following properties.

Property Type Description
eventsource integer Event source.

Possible values:
0 - triggers;
1 - discovery;
2 - autoregistration;
3 - internal;
4 - services.

Property behavior:
- required
recovery integer Operation mode.

Possible values:
0 - operations;
1 - recovery operations;
2 - update operations.

Property behavior:
- required
subject string Message subject.
message string Message text.