JSON API » alerts » alerts/create

Creates a new alert.

Input parameters

Requires authentication and the administrator role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringName.Yes
emailStringEmail addresses to send alerts to.Yes
typeStringWhat to alert on. "calls", "concurrent", "deregister", "destinations", "maximum", "numbers", "outgroups", "peer", "person_locked", "phone_address", "phone_locked", "phones", "queue_auto_unavailable", or "queue_exit".Yes
callsIntegerThe minimum number of calls to send an alert for "peer" type.No1
costIntegerThe minimum cost to match, in the customer's currency.No0.00
customerIntegerID of customer to create in.NoCustomer of authentication user.
days_weekStringWhich days the alert is active. Monday is 1, and Sunday is 7. "1,2,3,4,5" is Monday to Friday.No"1,2,3,4,5,6,7"
descriptionStringDescription.NoEmpty string.
destinationStringThe prefix of the destination to match.NoEmpty string.
dnd_secondsIntegerMinimum length of time telephone line has been in do not disturb for in seconds. -1 for no limit.No-1
endhourIntegerThe end hour, from 0 to 23.No23
endminuteIntegerThe end minute, from 0 to 59.No59
endsecondIntegerThe end second, from 0 to 59.No59
eventsInteger1 to record events for this alert, 0 not to.No0
idle_secondsIntegerMinimum length of time telephone line has been idle for in seconds. -1 for no limit.No-1
messageStringDestination to send text message to.NoEmpty string.
minimum_affectedIntegerThe minimum number affected to send an alert.No1
minimum_callsIntegerThe minimum number of calls to send an alert for "outgroups" type.No1
minimum_durationIntegerThe minimum call duration affected to send an alert.No1
peerIntegerThe ID of the peer to check.Only for "peer" type0
percent_failIntegerThe minimum percent of calls failing to send an alert.No100
periodIntegerThe minimum interval to send alerts in seconds.NoCurrent value.
searchInteger1 to use data from all customers on system, 0 not to. May only be used by system owners.No0
starthourIntegerThe start hour, from 0 to 23.No0
startminuteIntegerThe start minute, from 0 to 59.No0
startsecondIntegerThe start second, from 0 to 59.No0
talktimeIntegerThe minimum talk time to match in seconds.No0
timesIntegerThe minimum number of times to match.No1
times_periodStringHow long the times field applies to. "day", "week", or "month".No"day"
validationInteger1 to validate input then return, 0 for full action.No0

For each type, only some of the matching fields are used. See the web interface to determine which.

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.

Data returned

The ID of the created alert.

Example: With required parameters

http://enswitch.example.com/api/json/alerts/create/?auth_username=user;auth_password=password;name=example1;email=user%40example.com;type=calls

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
3.14type input parameter changed to allow a value of "phone_address".
3.13Function added.