Skip to content

DID Client Suspensions

A Client Suspension blocks messages for a specific host DID before they’re sent. Blocked messages are dropped and never delivered. Use this to stop traffic on a number, e.g. if it’s backlogged or needs to be temporarily disabled.

Note: Suspensions take a moment to propagate. Messages may still go through briefly after creating one.

A client-managed block on a host DID. The four block flags determine which message directions and media types are suspended.

NameTypeDescription
block_inboundBooleanBlock inbound messages for the host DID.
block_mmsBooleanApply the block to MMS messages.
block_outboundBooleanBlock outbound messages for the host DID.
block_smsBooleanApply the block to SMS messages.
host_numberStringThe host DID number being suspended.
idULID
inserted_atString(format:datetime)
updated_atString(format:datetime)

Example:

{
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true,
"host_number": "12003004000",
"id": "01J0CRVTXX9KBD9NWS02R5R8RT",
"inserted_at": "2024-06-14T00:00:00.000000Z",
"updated_at": "2024-06-14T00:00:00.000000Z"
}

Creates a client-managed block for the specified host DID. The host number is always taken from the DID in the URL.

NameTypeDescription
did_idULID required

Request:

POST https://api.swift-api.com/api/v1/dids/{did_id}/client_suspensions
Accept: application/json, text/plain
Content-Type: application/json
{
"data": {
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true
},
"type": "did_client_suspension"
}

Response 201:

{
"data": {
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true,
"host_number": "12003004000",
"id": "01J0CRVTXX9KBD9NWS02R5R8RT",
"inserted_at": "2024-06-14T00:00:00.000000Z",
"updated_at": "2024-06-14T00:00:00.000000Z"
},
"type": "did_client_suspension"
}

Response 401:

"string"

Response 403:

{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "string",
"params": {
"action": "create",
"level": "string",
"resource": "accounts"
},
"sub_code": "none",
"title": "string"
}
]
}

Response 404:

{
"errors": [
{
"code": "not_found",
"params": {
"id": "string",
"type": "string"
},
"sub_code": "none",
"title": "Not Found"
}
]
}

Response 422:

{
"errors": [
{
"code": "invalid_parameter",
"detail": "must be at least 1 character(s) and no more than 64 character(s)",
"source": {
"in": "body",
"pointer": "/data/name"
},
"sub_code": "parameter.required"
}
]
}

Updates the block settings for an existing client suspension.

NameTypeDescription
idULID required

Request:

PATCH https://api.swift-api.com/api/v1/did_client_suspensions/{id}
Accept: application/json, text/plain
Content-Type: application/json
{
"data": {
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true
},
"type": "did_client_suspension"
}

Response 200:

{
"data": {
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true,
"host_number": "12003004000",
"id": "01J0CRVTXX9KBD9NWS02R5R8RT",
"inserted_at": "2024-06-14T00:00:00.000000Z",
"updated_at": "2024-06-14T00:00:00.000000Z"
},
"type": "did_client_suspension"
}

Response 401:

"string"

Response 403:

{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "string",
"params": {
"action": "update",
"level": "string",
"resource": "accounts"
},
"sub_code": "none",
"title": "string"
}
]
}

Response 404:

{
"errors": [
{
"code": "not_found",
"params": {
"id": "string",
"type": "string"
},
"sub_code": "none",
"title": "Not Found"
}
]
}

Response 422:

{
"errors": [
{
"code": "invalid_parameter",
"detail": "must be at least 1 character(s) and no more than 64 character(s)",
"source": {
"in": "body",
"pointer": "/data/name"
},
"sub_code": "parameter.required"
}
]
}

Deletes an existing client suspension.

NameTypeDescription
idULID required

Request:

DELETE https://api.swift-api.com/api/v1/did_client_suspensions/{id}
Accept: application/json, text/plain

Response 200:

{
"data": {
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true,
"host_number": "12003004000",
"id": "01J0CRVTXX9KBD9NWS02R5R8RT",
"inserted_at": "2024-06-14T00:00:00.000000Z",
"updated_at": "2024-06-14T00:00:00.000000Z"
},
"type": "did_client_suspension"
}

Response 401:

"string"

Response 403:

{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "string",
"params": {
"action": "delete",
"level": "string",
"resource": "accounts"
},
"sub_code": "none",
"title": "string"
}
]
}

Response 404:

{
"errors": [
{
"code": "not_found",
"params": {
"id": "string",
"type": "string"
},
"sub_code": "none",
"title": "Not Found"
}
]
}

Response 422:

{
"errors": [
{
"code": "invalid_parameter",
"detail": "must be at least 1 character(s) and no more than 64 character(s)",
"source": {
"in": "body",
"pointer": "/data/name"
},
"sub_code": "parameter.required"
}
]
}

Returns all client-managed suspensions within the caller’s scope.

Request:

GET https://api.swift-api.com/api/v1/did_client_suspensions
Accept: application/json, text/plain

Response 200:

{
"data": {
"items": [
{
"data": {
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true,
"host_number": "12003004000",
"id": "01J0CRVTXX9KBD9NWS02R5R8RT",
"inserted_at": "2024-06-14T00:00:00.000000Z",
"updated_at": "2024-06-14T00:00:00.000000Z"
},
"type": "did_client_suspension"
}
],
"page_info": {
"after": "string",
"before": "string",
"limit": 0.0,
"total": 0.0
}
},
"type": "list"
}

Response 401:

"string"

Response 403:

{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "string",
"params": {
"action": "list",
"level": "string",
"resource": "accounts"
},
"sub_code": "none",
"title": "string"
}
]
}

Response 422:

{
"errors": [
{
"code": "invalid_parameter",
"detail": "must be at least 1 character(s) and no more than 64 character(s)",
"source": {
"in": "body",
"pointer": "/data/name"
},
"sub_code": "parameter.required"
}
]
}

Returns a client suspension by ID.

NameTypeDescription
idULID required

Request:

GET https://api.swift-api.com/api/v1/did_client_suspensions/{id}
Accept: application/json, text/plain

Response 200:

{
"data": {
"block_inbound": true,
"block_mms": true,
"block_outbound": true,
"block_sms": true,
"host_number": "12003004000",
"id": "01J0CRVTXX9KBD9NWS02R5R8RT",
"inserted_at": "2024-06-14T00:00:00.000000Z",
"updated_at": "2024-06-14T00:00:00.000000Z"
},
"type": "did_client_suspension"
}

Response 401:

"string"

Response 403:

{
"errors": [
{
"code": "access_denied.no_scope",
"detail": "string",
"params": {
"action": "get",
"level": "string",
"resource": "accounts"
},
"sub_code": "none",
"title": "string"
}
]
}

Response 404:

{
"errors": [
{
"code": "not_found",
"params": {
"id": "string",
"type": "string"
},
"sub_code": "none",
"title": "Not Found"
}
]
}