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

string

Yes

Unique ID number allocated to this DID.

include

string

Optional

Inclusion

Includes:

Value

Description

trunk

Trunk Object

Attributes

Name

Type

Is Required?

Description

terminated

boolean

Optional

If set to True, it will cancel a DID number. To renew or restore a DID number, the attribute must be set to False.

pending_removal

boolean

Optional

If set to True, it will disable automatic DID Renewal. If set to False, the DID number will continue renewal.

description

string

Optional

A DID number description.

billing_cycles_count

integer

Optional

The number of Billing Cycles that this DID Number will renew until expiration.
If set to 0, pending_removal attribute will change to True.
If set to null, pending_removal attribute will change to False.
Maximum value of billing_cycles_count is 999.

Attention

Attribute pending_removal will become deprecated in the next version of API. It is recommended to use billing_cycles_count.

Examples#

http

 1PATCH /v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70 HTTP/1.1
 2Host: api.didww.com
 3Content-Type: application/vnd.api+json
 4Accept: application/vnd.api+json
 5Api-Key: [API token]
 6
 7{
 8  "data": {
 9    "id": "46e129f1-deaa-44db-8915-2646de4d4c70",
10    "type": "dids",
11    "attributes": {
12      "terminated": false,
13      "pending_removal": false,
14      "description": "string",
15      "capacity_limit": 1
16    }
17  }
18}

curl

1curl -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"}}'

response

 1HTTP/1.1 200 OK
 2Content-Type: application/vnd.api+json
 3
 4{
 5                "data": {
 6                                "id": "46e129f1-deaa-44db-8915-2646de4d4c70",
 7                                "type": "dids",
 8                                "attributes": {
 9                                                "blocked": false,
10                                                "capacity_limit": 1,
11                                                "description": "string",
12                                                "terminated": false,
13                                                "awaiting_registration": false,
14                                                "number": "437xxxxxxxxx",
15                                                "expires_at": "2017-06-25T08:21:41.795Z",
16                                                "channels_included_count": 2,
17                                                "created_at": "2017-06-25T08:21:41.795Z",
18                                                "pending_removal": false,
19                                                "dedicated_channels_count": 0
20                                }
21                },
22                "relationships": {
23                                "did_group": {
24                                                "links": {
25                                                                "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/did_group",
26                                                                "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/did_group"
27                                                }
28                                },
29                                "order": {
30                                                "links": {
31                                                                "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/order",
32                                                                "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/order"
33                                                }
34                                },
35                                "trunk": {
36                                                "links": {
37                                                                "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/trunk",
38                                                                "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/trunk"
39                                                }
40                                },
41                                "trunk_group": {
42                                                "links": {
43                                                                "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/trunk_group",
44                                                                "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/trunk_group"
45                                                }
46                                },
47                                "capacity_pool": {
48                                                "links": {
49                                                                "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/capacity_pool",
50                                                                "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/capacity_pool"
51                                                }
52                                },
53                                "shared_capacity_group": {
54                                                "links": {
55                                                                "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/shared_capacity_group",
56                                                                "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/shared_capacity_group"
57                                                }
58                                }
59                },
60                "meta": {
61                                "api_version": "2017-09-18"
62                }
63}

Other Responses#

Code

Success

Description

404

No

Not Found

401

No

Unauthorized