Skip to main content

Update LRN Prefix

This request updates an LRN prefix, targeted by secure ID.

patch /phonenumber/lrn_prefixes/{lrn_prefix_sid}
put /phonenumber/lrn_prefixes/{lrn_prefix_sid}

Sample

A sample PATCH request to update the LRN Prefix object, targeted by secure ID, with the values in the request body:

curl -X PATCH \
'https://api.carrierx.com/core/v2/phonenumber/lrn_prefixes/cc367acb-94c8-418f-b247-85dce5806ef4' \
-H 'Content-Type: application/json' \
--data-binary '{"name":"lrn prefix"}' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response

200 status code with a serialized copy of the updated LRN Prefix object:

{
"attributes": {},
"callback_url": null,
"lrn_prefix_sid": "cc367acb-94c8-418f-b247-85dce5806ef4",
"lrn_sid": null,
"name": "lrn prefix",
"partner_sid": "e00430c3-a7d0-4666-ab5c-f7202448382f",
"prefix": "1520",
"source_trunk_group_sid": null,
"string_key_1": null,
"string_key_2": null,
"transformations": [],
"trunk_group_sid": null
}

An LRN Prefix object can be updated using either a PATCH or PUT request.

  • A PATCH request can be used to update one or more attribute values. When using a PATCH request, only the attributes specified in the request payload will be updated, all the other attributes and values will remain the same. The LRN prefix secure ID is passed in the query URL, and the values to be modified are passed in the request body.

    The LRN Prefix object also contains nested Attributes and Transformations objects. Refer to this section to learn how nested objects can be updated using the PATCH request.

  • A PUT request can be used to update the entire LRN Prefix object. The LRN prefix secure ID is passed in the query URL, and the entire LRN Prefix object is passed in the request body.

note

Note, while all the fields must be present in a PUT request, this request may be unable to modify all the attribute values because as soon as an object has been created, some of its values become read-only values, e.g. the LRN prefix sid.

Required Scopes

To update an LRN Prefix object, the partner must have one of the following scopes enabled:

  • phonenumber.manage
  • phonenumber.update

Path Arguments

ParameterData TypeDescription
lrn_prefix_sid requiredstringThe LRN prefix secure ID.

Query Arguments

ParameterData TypeDescription
nested_objectsstringDetermines if the nested objects fields and values should be replaced. Value accepted in this field is replace.

Body Arguments

JSON representation of the fields and values to be updated.

Fields that can be modified are:

  • attributes
  • callback_url
  • name
  • prefix
  • source_trunk_group_sid
  • string_key_1
  • string_key_2
  • transformations

Refer to this table to view all fields that appear in the LRN Prefix object.