Skip to content

Change DM settings

POST
/dm/update-settings
curl -X POST https://api.xholic.ai/v1/dm/update-settings \
-H "Authorization: Bearer $XHOLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"defaults":{},"assistedDailyLimit":1,"optOutPhrases":["<optOutPhrase>"],"dryRun":true}'

Replace the DM settings: send all of them (read them with dm.settings first). Call it only when the user asked for this in the conversation; never on your own initiative.

Media typeapplication/json
object
defaults
required
object
deliveryMode
string
default: AUTOMATIC
Allowed values: AUTOMATIC ASSISTED
schedule
object
timezone
required
string
>= 1 characters <= 64 characters
sendDays
required
integer
>= 1 <= 127
windowStartMinutes
required
integer
<= 1439
windowEndMinutes
required
integer
>= 1 <= 1440
dailyLimit
required
integer
>= 1 <= 100
rampStart
required
integer
nullable >= 1 <= 100
rampStep
required
integer
nullable >= 1 <= 50
minGapSeconds
required
integer
>= 75 <= 3600
maxGapSeconds
required
integer
>= 75 <= 3600
startsAt
required
string format: date-time
nullable /^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$/
rules
object
recontactAfterDays
Any of:
number
Allowed values: 30
excludeCampaignIds
Array<string>
default: <= 20 items
excludeListIds
Array<string>
default: <= 20 items
skipFollowers
boolean
skipFollowing
boolean
skipExistingConversation
boolean
default: true
assistedDailyLimit
required
integer
>= 1 <= 100
optOutPhrases
required

Replies containing one of these stop all messages to that person.

Array<string>
<= 20 items
account

X account to act on, as @handle. Leave it out to use the connection’s default account.

string
>= 1 characters <= 64 characters
dryRun

Return exactly what would happen without doing it.

boolean
idempotencyKey

A unique key for this write. Repeating a call with the same key returns the first result instead of acting twice.

string
>= 8 characters <= 200 characters

Example

{
"defaults": {},
"assistedDailyLimit": 1,
"optOutPhrases": [
"<optOutPhrase>"
],
"dryRun": true
}

Success

Media typeapplication/json
object
ok
required
boolean
summary
required

One or two readable sentences about the result.

string
data
required

The result. Its shape depends on the action.

ids
object
key
additional properties
any
next
Array<string>
creditsCharged
number
dryRun
boolean

Example

{
"ok": true
}

Error

Media typeapplication/json
object
ok
required
boolean
error
required
object
code
required
string
Allowed values: UNAUTHENTICATED INVALID_CREDENTIAL SCOPE_MISSING ROLE_NOT_PERMITTED ACCOUNT_NOT_FOUND SUBSCRIPTION_REQUIRED FEATURE_NOT_INCLUDED APP_ONLY INVALID_INPUT NOT_FOUND CONFLICT CREDITS_CONFIRMATION_REQUIRED INSUFFICIENT_CREDITS RATE_LIMITED IDEMPOTENCY_KEY_REUSED IDEMPOTENCY_IN_PROGRESS X_DATA_LIMIT_REACHED UPSTREAM_UNAVAILABLE INTERNAL_ERROR
message
required
string
scope
required
string
Allowed values: account platform
retryAfterSeconds
integer
details

Example

{
"ok": false,
"error": {
"code": "UNAUTHENTICATED",
"scope": "account"
}
}