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

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

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

response

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"
                }
}

Other Responses

Code

Success

Description

404

No

Not Found

401

No

Unauthorized