Update an origination URI
const url = 'https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/OriginationUri/example';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"meta_data":"primary site","priority":"10","sip_uri":"sip:pbx.example.com:5060","status":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/OriginationUri/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "meta_data": "primary site", "priority": "10", "sip_uri": "sip:pbx.example.com:5060", "status": true }'Replaces the SIP URI, priority, status and meta_data of an origination URI; all four are overwritten, so send the current values of those you keep. The SIP URI must not already be on the trunk. A vendor account can pass customer_id to act on a direct child account’s record.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of your account.
ID of the trunk.
ID of the origination URI.
Query Parameters
Section titled “ Query Parameters ”Vendor accounts only: act on this direct child account instead of your own.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The new values.
object
Free-form text; replaces the stored value.
Example
primary sitePriority as a decimal string; replaces the stored value.
Example
10SIP URI; replaces the stored value.
Example
sip:pbx.example.com:5060Whether the URI is enabled; replaces the stored value.
Example
trueResponses
Section titled “ Responses ”Updated (message “origination updated successfully”).
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}Sip_uri is missing, the URI does not exist or is a duplicate, the change failed, or the gateway did not supply your company (message “company id is empty”).
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}Missing or wrong Basic-auth credentials (returned by the API gateway).
Example generated
exampleCustomer_id is not a direct child of your account.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}Your account or the customer account could not be looked up.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}