Set DND
PATCH
/api/v1/ext/contacts/{id}/dnd
Change a contact's Do-Not-Disturb for one direction.
Auth: Bearer access_token
Scope: contacts.write
One call changes one direction. enable_all / disable_all set or clear DND on every channel; enable_specific adds the named channels (and narrows an "all channels" DND to just those); disable_specific removes them. Automations that trigger on Contact Updated run when the settings actually change, as in the dashboard. The response is the contact's full DND afterwards.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | number | yes | The contact id. |
| direction | body | enum | yes | Which direction to change. |
| status | body | enum | yes | What to do. |
| channels | body | array<string> | no | For enable_specific / disable_specific: any of sms, whatsapp, imessage, rcs (or a comma-separated string). |
Responses
| Status | When |
|---|---|
200 | OK — the contact's DND now |
400 | Bad direction, status or channel |
401 | Missing or invalid token |
403 | Missing scope |
404 | Contact does not exist or is not owned by the installer (same response for both) |
RequestResponses
curl -X PATCH "https://backend.mysmsgateway.app/api/v1/ext/contacts/{id}/dnd" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"direction": "outbound",
"status": "enable_specific",
"channels": [
"sms",
"whatsapp"
]
}'OK — the contact's DND now
{
"success": true,
"message": "Contact DND updated",
"data": {
"contact_id": 1234,
"workspace_id": 7,
"dnd": {
"outbound": {
"all": false,
"channels": [
"sms",
"whatsapp"
]
},
"inbound": {
"all": false,
"channels": []
}
}
}
}Try It!
This endpoint needs a bearer token. Open Settings (top right) and paste your access_token.
Path parameters
The contact id.
Body (JSON)
Request URL
PATCHhttps://backend.mysmsgateway.app/api/v1/ext/contacts/%7Bid%7D/dnd
Previous
« Get DND
Next
List tags »
