Update DID
PATCH https://{{host}}/v3/dids/:id
Update the settings of a single DID owned by your account. Using this endpoint you can cancel, restore or renew DID.
To cancel a DID, attribute terminated
must be true
, to renew or restore DID attribute terminated
must be false
.
Request Body Scheme
{
data (object, required)
{
id (string, required)
Unique ID number allocated to this DID.type (string, required): dids
attributes (object, optional)
{
terminated (boolean, optional)
If set toTrue
, it will cancel a DID number. To renew or restore a DID number, the attribute must be set toFalse
.description (string, optional)
A DID number description.billingcyclescount (integer, optional)
The number of Billing Cycles that this DID Number will renew until expiration.
null
value means that DID will be renewed infinitely.0
value means that DID will not be renewed.2
value means that DID will be renewed only twice. After each renew value will be decreased by 1 if it is set. Value can be set from0
to999
.dedicatedchannelscount (integer, optional)
Amount of channels to be assigned to curent DID from allocated in relationships Capacity Pool
Should be used with one of optional relationshipcapacity_pool
}
relationships (object, optional)
{
trunk (object, optional): to-one
Linkage for included Trunk Objecttrunk_group (object, optional): to-one
Linkage for included Trunk Group Objectcapacity_pool (object, optional): to-one
Linkage for included Capacity Pool Objectsharedcapacitygroup (object, optional): to-one
Linkage for included Shared Capacity Group Object
}
}
}
Attention
Attribute
pending_removal
will become deprecated in the next version of API. It is recommended to usebilling_cycles_count
.
Request Body Example:
Simple Resource Patch
{
"data": {
"id": "46e129f1-deaa-44db-8915-2646de4d4c70",
"type": "dids",
"attributes": {
"terminated": false,
"pending_removal": false,
"description": "string",
"capacity_limit": 1
}
}
}
Assign Trunk
{
"data": {
"id": "3505b18a-3019-47bc-95d1-0f9ec7766fd5",
"type": "dids",
"relationships": {
"trunk": {
"data": {
"type": "trunks",
"id": "c80d096a-c8cf-4449-aa6d-8bac39130fe0"
}
}
}
}
}
Remove Trunk
{
"data": {
"type": "dids",
"id": "1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5",
"relationships": {
"trunk": {
"data": null
}
}
}
}
Assign Trunk Group
{
"data": {
"id": "3e3f57ec-0541-473a-af63-103216d19db3",
"type": "dids",
"relationships": {
"trunk_group": {
"data": {
"type": "trunk_groups",
"id": "1dc6e448-d9d8-4da8-a34b-21459b03112f"
}
}
}
}
}
Assign Dedicated Capacity
{
"data": {
"id": "a8d13b71-8f0b-4393-8992-ff5e4e7521f9",
"type": "dids",
"attributes": {
"dedicated_channels_count": 2
},
"relationships": {
"capacity_pool": {
"data": {
"type": "capacity_pools",
"id": "1eb75a47-38b6-4ec2-8990-fe249ffd7b92"
}
}
}
}
}
Assign Shared Capacity
{
"data": {
"id": "a8d13b71-8f0b-4393-8992-ff5e4e7521f9",
"type": "dids",
"relationships": {
"shared_capacity_group": {
"data": {
"type": "shared_capacity_groups",
"id": "8a581244-de83-4c46-ac0a-32659279169e"
}
}
}
}
}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Accept | string | ||
Content-Type | string | ||
Api-Key | string |
RESPONSES
status: OK
{"data":{"id":"1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5","type":"dids","attributes":{"blocked":false,"capacity_limit":null,"description":null,"terminated":false,"awaiting_registration":false,"created_at":"2019-05-21T08:25:02.223Z","number":"4474183XXXXX","expires_at":"2019-06-21T08:25:13.367Z","channels_included_count":2,"pending_removal":false,"dedicated_channels_count":2},"relationships":{"did_group":{"links":{"self":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/relationships/did_group","related":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/did_group"}},"order":{"links":{"self":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/relationships/order","related":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/order"}},"trunk":{"links":{"self":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/relationships/trunk","related":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/trunk"}},"trunk_group":{"links":{"self":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/relationships/trunk_group","related":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/trunk_group"}},"capacity_pool":{"links":{"self":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/relationships/capacity_pool","related":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/capacity_pool"}},"shared_capacity_group":{"links":{"self":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/relationships/shared_capacity_group","related":"https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5/shared_capacity_group"}}}},"meta":{"api_version":"2021-04-19"}}