Skip to content

Done, dismiss or snooze a Home card

POST
/home/card-action
curl -X POST https://api.xholic.ai/v1/home/card-action \
-H "Authorization: Bearer $XHOLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"workspaceId":"<workspaceId>","key":"<key>","type":"mention","action":"done","dryRun":true}'

Mark a Home card done, dismiss it, snooze it or restore it, by the key and type home.feed returned. Call it only when the user asked for this in the conversation; never on your own initiative.

Media typeapplication/json
object
workspaceId
required

WorkspaceUserId from home.feed, so a stale call never acts on another account.

string
>= 1 characters <= 160 characters
key
required

The card’s key from home.feed.

string
>= 3 characters <= 160 characters
type
required
string
Allowed values: mention post_reply close_account_post contact_repost breaking_post recycle_post post_alert queue_gap draft signal_lead new_follower niche_trend reply_goal saved_post market_brief growth_step giveaway_ready learned_check
action
required
string
Allowed values: done dismiss snooze restore
tweetIds

For conversation cards: the post ids the card shows.

Array<string>
<= 3 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

{
"workspaceId": "<workspaceId>",
"key": "<key>",
"type": "mention",
"action": "done",
"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"
}
}