Skip to content

Set or change the growth goal

POST
/mentor/set-goal
curl -X POST https://api.xholic.ai/v1/mentor/set-goal \
-H "Authorization: Bearer $XHOLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dryRun":true}'

Start the account’s growth goal after the user agreed to it (one active goal at a time), or change or close the active one (goalId with status DONE or DROPPED, or a new target, length or commitments). followers is the follower count to reach; impressions, replies_received and posts count what happens inside the window; engagement_rate is a percent. Xholic tracks it in every session’s brief and grades it when it closes. It posts nothing. Call it only when the user agreed in this conversation; never on your own initiative.

Media typeapplication/json
object
goalId

The active goal to change or close. Leave out to start a new goal.

string format: uuid
/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/
status

Close the active goal: DONE grades it now, DROPPED abandons it.

string
Allowed values: DONE DROPPED
metric

Required for a new goal.

string
Allowed values: followers impressions replies_received engagement_rate posts
target

Required for a new goal: a follower count (18), a total (2000) or a percent (4).

number
<= 100000000
days

How long it runs (default 7).

integer
>= 3 <= 31
startsAt

When it starts (default now), at most a week ahead.

string format: date-time
/^(?:(?:\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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
commitments

What the user agreed to do; defaults to the proposal’s.

object
postsPerDay

Original posts a day the user agreed to.

number
<= 10
repliesPerDay

Replies a day the user agreed to.

integer
<= 100
other

Anything else the user agreed to, in their words.

Array<string>
<= 4 items
note

Why this goal, in the user’s words.

string
<= 500 characters
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

{
"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 ACCOUNT_ON_HOLD UPSTREAM_UNAVAILABLE MAINTENANCE INCIDENT INTERNAL_ERROR
message
required
string
scope
required
string
Allowed values: account platform
retryAfterSeconds
integer
details

Example

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