Skip to content

Review a Worker draft

POST
/workers/review-draft
curl -X POST https://api.xholic.ai/v1/workers/review-draft \
-H "Authorization: Bearer $XHOLIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"<id>","status":"TO_REVIEW","dryRun":true}'

Move a Worker draft: DRAFT keeps it in the user’s drafts, DISMISSED throws it away, TO_REVIEW puts it back in review. When dismissing because it isn’t the user’s opinion, pass reason NOT_MY_OPINION so Workers learn. To post or schedule it, use schedule_post with its text. Call it only when the user asked for this in the conversation; never on your own initiative.

Media typeapplication/json
object
id
required

Worker draft id from get_worker_drafts.

string
>= 1 characters <= 160 characters
status
required
string
Allowed values: TO_REVIEW DRAFT DISMISSED
reason

Only with DISMISSED: why, when it teaches the Workers something.

string
Allowed values: NOT_MY_OPINION
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

{
"id": "<id>",
"status": "TO_REVIEW",
"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"
}
}