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

No

Inclusion.

Includes:

Name

Description

voice_in_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.

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, then DID will not be renewed.
If set to null, then DID will be renewed infinitely.
After each renew value will be decreased by 1 if it is set.
Maximum value of billing_cycles_count is 999.

dedicated_channels_count

integer

Optional

Amount of dedicated channels to assign.

capacity_limit

integer

Optional

Limits incoming capacity per DID number according to entered value. If set as null, assigned capacity is not limited.

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,
      "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", "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",
      "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"
      }
    },
    "voice_in_trunk": {
      "links": {
        "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/voice_in_trunk",
        "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/voice_in_trunk"
      }
    },
    "voice_in_trunk_group": {
      "links": {
        "self": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/relationships/voice_in_trunk_group",
        "related": "https://api.didww.com/v3/dids/46e129f1-deaa-44db-8915-2646de4d4c70/voice_in_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"
      }
    }
  }
}

Other Responses

Code

Success

Description

404

No

Not Found

401

No

Unauthorized