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.
Schema
Section titled “Schema”A client-managed block on a host DID. The four block flags determine which message directions and media types are suspended.
| Name | Type | Description |
|---|---|---|
| block_inbound | Boolean | Block inbound messages for the host DID. |
| block_mms | Boolean | Apply the block to MMS messages. |
| block_outbound | Boolean | Block outbound messages for the host DID. |
| block_sms | Boolean | Apply the block to SMS messages. |
| host_number | String | The host DID number being suspended. |
| id | ULID | |
| inserted_at | String(format:datetime) | |
| updated_at | String(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"}Create a DID’s Client Suspension
Section titled “Create a DID’s Client Suspension”Creates a client-managed block for the specified host DID. The host number is always taken from the DID in the URL.
Path Parameters
Section titled “Path Parameters”| Name | Type | Description |
|---|---|---|
| did_id | ULID required |
Request:
POST https://api.swift-api.com/api/v1/dids/{did_id}/client_suspensionsAccept: application/json, text/plainContent-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" } ]}Update a DID Client Suspension
Section titled “Update a DID Client Suspension”Updates the block settings for an existing client suspension.
Path Parameters
Section titled “Path Parameters”| Name | Type | Description |
|---|---|---|
| id | ULID required |
Request:
PATCH https://api.swift-api.com/api/v1/did_client_suspensions/{id}Accept: application/json, text/plainContent-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" } ]}Delete a DID Client Suspension
Section titled “Delete a DID Client Suspension”Deletes an existing client suspension.
Path Parameters
Section titled “Path Parameters”| Name | Type | Description |
|---|---|---|
| id | ULID required |
Request:
DELETE https://api.swift-api.com/api/v1/did_client_suspensions/{id}Accept: application/json, text/plainResponse 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" } ]}List DID Client Suspensions
Section titled “List DID Client Suspensions”Returns all client-managed suspensions within the caller’s scope.
Request:
GET https://api.swift-api.com/api/v1/did_client_suspensionsAccept: application/json, text/plainResponse 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" } ]}Get a DID Client Suspension
Section titled “Get a DID Client Suspension”Returns a client suspension by ID.
Path Parameters
Section titled “Path Parameters”| Name | Type | Description |
|---|---|---|
| id | ULID required |
Request:
GET https://api.swift-api.com/api/v1/did_client_suspensions/{id}Accept: application/json, text/plainResponse 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" } ]}