JSON API » outcosts » outcosts/update

Updates an existing outbound call cost.

Input parameters

Requires authentication and the system role privilege if updating a cost for a peer or the commerce role privilege if updating a cost for a rate plan.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of the cost.Yes
callergroupIntegerID of caller group this outbound call cost will be restricted to, 0 for any caller.No0
connectfeeDecimalA connect fee charged on answer.NoCurrent value.
costDecimalThe cost per minute after the included seconds are used.NoCurrent value.
descriptionStringDescription.NoCurrent value.
endIntegerThe Unix timestamp after which this cost no longer applies. -1 for never.NoCurrent value.
includedIntegerThe number of seconds included free with the connectfee.NoCurrent value.
incrementIntegerBilling increment in seconds.NoCurrent value.
least_costInteger1 to use this cost for least cost routing, 0 not to.NoCurrent value.
messageDecimalThe cost to send a message.NoCurrent value.
message_mediaDecimalThe cost to send a media message.NoCurrent value.
minimumDecimalAn overall minimum cost for the call if answered.NoCurrent value.
priorityIntegerThe priority from 1 to 10.NoCurrent value.
startIntegerThe Unix timestamp from which this cost applies.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
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.
404The cost does not exist, or you do not have permission to update it.

Data returned

No data is returned.

Example: Updating the per-minute cost

http://enswitch.example.com/api/json/outcosts/update/?auth_username=user;auth_password=password;id=123;cost=0.12

{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }

Change history

VersionChanges
4.2message_media and callergroup parameters added.
4.1least_cost parameter added.
3.13Function added.