Update DID
Description
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
HTTP Method: PATCH
URI Path: /v3/dids/
URI Query Parameters:
Name |
Type |
Is Required? |
Description |
---|---|---|---|
id |
|
Yes |
Unique ID number allocated to this DID. |
include |
|
Optional |
Includes:
Value |
Description |
---|---|
trunk |
Attributes
Name |
Type |
Is Required? |
Description |
---|---|---|---|
terminated |
|
Optional |
If set to |
pending_removal |
|
Optional |
If set to |
description |
|
Optional |
A DID number description. |
billing_cycles_count |
|
Optional |
The number of Billing Cycles that this DID Number will renew until expiration. |
Attention
Attribute pending_removal
will become deprecated in the next version of API. It is recommended to use billing_cycles_count
.
Examples
PATCH /v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70 HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"id": "46e129f1-deaa-44db-8915-2646de4d4c70",
"type": "dids",
"attributes": {
"terminated": false,
"pending_removal": false,
"description": "string",
"capacity_limit": 1
}
}
}
curl -i -X PATCH https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 1, "description": "string", "pending_removal": false, "terminated": false}, "id": "46e129f1-deaa-44db-8915-2646de4d4c70", "type": "dids"}}'
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "46e129f1-deaa-44db-8915-2646de4d4c70",
"type": "dids",
"attributes": {
"blocked": false,
"capacity_limit": 1,
"description": "string",
"terminated": false,
"awaiting_registration": false,
"number": "437xxxxxxxxx",
"expires_at": "2017-06-25T08:21:41.795Z",
"channels_included_count": 2,
"created_at": "2017-06-25T08:21:41.795Z",
"pending_removal": false,
"dedicated_channels_count": 0
}
},
"relationships": {
"did_group": {
"links": {
"self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/did_group",
"related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/did_group"
}
},
"order": {
"links": {
"self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/order",
"related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/order"
}
},
"trunk": {
"links": {
"self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/trunk",
"related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/trunk"
}
},
"trunk_group": {
"links": {
"self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/trunk_group",
"related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/trunk_group"
}
},
"capacity_pool": {
"links": {
"self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/capacity_pool",
"related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/capacity_pool"
}
},
"shared_capacity_group": {
"links": {
"self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/shared_capacity_group",
"related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/shared_capacity_group"
}
}
},
"meta": {
"api_version": "2017-09-18"
}
}
PATCH /v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5 HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"id": "3505b18a-3019-47bc-95d1-0f9ec7766fd5",
"type": "dids",
"relationships": {
"trunk": {
"data": {
"type": "trunks",
"id": "c80d096a-c8cf-4449-aa6d-8bac39130fe0"
}
}
}
}
}
curl -i -X PATCH https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "3505b18a-3019-47bc-95d1-0f9ec7766fd5", "relationships": {"trunk": {"data": {"id": "c80d096a-c8cf-4449-aa6d-8bac39130fe0", "type": "trunks"}}}, "type": "dids"}}'
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "3505b18a-3019-47bc-95d1-0f9ec7766fd5",
"type": "dids",
"attributes": {
"blocked": false,
"capacity_limit": 1,
"description": "string",
"terminated": false,
"awaiting_registration": false,
"number": "437xxxxxxxxx",
"expires_at": "2017-06-25T08:21:41.795Z",
"channels_included_count": 2,
"created_at": "2017-06-25T08:21:41.795Z",
"pending_removal": false,
"dedicated_channels_count": 0
},
"relationships": {
"did_group": {
"links": {
"self": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/relationships/did_group",
"related": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/did_group"
}
},
"order": {
"links": {
"self": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/relationships/order",
"related": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/order"
}
},
"trunk": {
"links": {
"self": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/relationships/trunk",
"related": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/trunk"
}
},
"trunk_group": {
"links": {
"self": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/relationships/trunk_group",
"related": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/trunk_group"
}
},
"capacity_pool": {
"links": {
"self": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/relationships/capacity_pool",
"related": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/capacity_pool"
}
},
"shared_capacity_group": {
"links": {
"self": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/relationships/shared_capacity_group",
"related": "https://api.didww.com/v3/dids/3505b18a-3019-47bc-95d1-0f9ec7766fd5/shared_capacity_group"
}
}
}
},
"meta": {
"api_version": "2017-09-18"
}
}
PATCH /v3/dids/3e3f57ec-0541-473a-af63-103216d19db3 HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"id": "3e3f57ec-0541-473a-af63-103216d19db3",
"type": "dids",
"relationships": {
"trunk_group": {
"data": {
"type": "trunk_groups",
"id": "1dc6e448-d9d8-4da8-a34b-21459b03112f"
}
}
}
}
}
curl -i -X PATCH https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "3e3f57ec-0541-473a-af63-103216d19db3", "relationships": {"trunk_group": {"data": {"id": "1dc6e448-d9d8-4da8-a34b-21459b03112f", "type": "trunk_groups"}}}, "type": "dids"}}'
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "3e3f57ec-0541-473a-af63-103216d19db3",
"type": "dids",
"attributes": {
"blocked": false,
"capacity_limit": 1,
"description": "string",
"terminated": false,
"awaiting_registration": false,
"number": "437xxxxxxxxx",
"expires_at": "2017-06-25T08:21:41.795Z",
"channels_included_count": 2,
"created_at": "2017-06-25T08:21:41.795Z",
"pending_removal": false,
"dedicated_channels_count": 0
}
},
"relationships": {
"did_group": {
"links": {
"self": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/relationships/did_group",
"related": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/did_group"
}
},
"order": {
"links": {
"self": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/relationships/order",
"related": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/order"
}
},
"trunk": {
"links": {
"self": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/relationships/trunk",
"related": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/trunk"
}
},
"trunk_group": {
"links": {
"self": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/relationships/trunk_group",
"related": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/trunk_group"
}
},
"capacity_pool": {
"links": {
"self": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/relationships/capacity_pool",
"related": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/capacity_pool"
}
},
"shared_capacity_group": {
"links": {
"self": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/relationships/shared_capacity_group",
"related": "https://api.didww.com/v3/dids/3e3f57ec-0541-473a-af63-103216d19db3/shared_capacity_group"
}
}
},
"meta": {
"api_version": "2017-09-18"
}
}
PATCH /v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9 HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"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"
}
}
}
}
}
curl -i -X PATCH https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"dedicated_channels_count": 2}, "id": "a8d13b71-8f0b-4393-8992-ff5e4e7521f9", "relationships": {"capacity_pool": {"data": {"id": "1eb75a47-38b6-4ec2-8990-fe249ffd7b92", "type": "capacity_pools"}}}, "type": "dids"}}'
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "a8d13b71-8f0b-4393-8992-ff5e4e7521f9",
"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/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/did_group",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/did_group"
}
},
"order": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/order",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/order"
}
},
"trunk": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/trunk",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/trunk"
}
},
"trunk_group": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/trunk_group",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/trunk_group"
}
},
"capacity_pool": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/capacity_pool",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/capacity_pool"
}
},
"shared_capacity_group": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/shared_capacity_group",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/shared_capacity_group"
}
}
}
},
"meta": {
"api_version": "2017-09-18"
}
}
PATCH /v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9 HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"id": "a8d13b71-8f0b-4393-8992-ff5e4e7521f9",
"type": "dids",
"relationships": {
"shared_capacity_group": {
"data": {
"type": "shared_capacity_groups",
"id": "8a581244-de83-4c46-ac0a-32659279169e"
}
}
}
}
}
curl -i -X PATCH https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "a8d13b71-8f0b-4393-8992-ff5e4e7521f9", "relationships": {"shared_capacity_group": {"data": {"id": "8a581244-de83-4c46-ac0a-32659279169e", "type": "shared_capacity_groups"}}}, "type": "dids"}}'
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "a8d13b71-8f0b-4393-8992-ff5e4e7521f9",
"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/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/did_group",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/did_group"
}
},
"order": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/order",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/order"
}
},
"trunk": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/trunk",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/trunk"
}
},
"trunk_group": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/trunk_group",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/trunk_group"
}
},
"capacity_pool": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/capacity_pool",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/capacity_pool"
}
},
"shared_capacity_group": {
"links": {
"self": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/relationships/shared_capacity_group",
"related": "https://api.didww.com/v3/dids/a8d13b71-8f0b-4393-8992-ff5e4e7521f9/shared_capacity_group"
}
}
}
},
"meta": {
"api_version": "2017-09-18"
}
}
PATCH /v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5 HTTP/1.1
Host: api.didww.com
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
Api-Key: [API token]
{
"data": {
"type": "dids",
"id": "1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5",
"relationships": {
"trunk": {
"data": null
}
}
}
}
curl -i -X PATCH https://api.didww.com/v3/dids/1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5 -H "Accept: application/vnd.api+json" -H "Api-Key: [API token]" -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "1e0c45b1-1fea-4552-b41b-ffa9f5eb44c5", "relationships": {"trunk": {"data": null}}, "type": "dids"}}'
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
Other Responses
Code |
Success |
Description |
---|---|---|
404 |
No |
|
401 |
No |