Skip to content

Save sub-topics

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

Change the user’s sub-topics in one call: approve suggested or trial ones (a trial lane approved stays in the plan for good), remove or restore, add the user’s own (active at once), edit a name, description or keywords, or set weights (how much the weekly plan leans on each; 1 is normal). Removed ones are never suggested again. Xholic re-plans around the change within minutes. Call it only when the user asked for this in the conversation; never on your own initiative. Returns the updated list.

Media typeapplication/json
object
approve

Suggested sub-topics to approve (they become active).

Array<string>
<= 20 items
remove

Sub-topics to remove; Xholic won’t suggest them again.

Array<string>
<= 20 items
restore

Removed sub-topics to bring back as active.

Array<string>
<= 20 items
add

The user’s own sub-topics, active at once.

Array<object>
<= 8 items
object
name
required

Short name, up to 40 characters.

string
>= 2 characters <= 40 characters
description

One line on what posts in it are about.

string
<= 160 characters
keywords

Up to 8 words a post on it would contain.

Array<string>
<= 8 items
edit

Changes to existing sub-topics; an edited one becomes the user’s own.

Array<object>
<= 12 items
object
id
required

A sub-topic id from subtopics.list.

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)$/
name

Short name, up to 40 characters.

string
>= 2 characters <= 40 characters
description

One line on what posts in it are about.

string
<= 160 characters
keywords

Up to 8 words a post on it would contain.

Array<string>
<= 8 items
weights

How much the weekly plan leans on each sub-topic.

Array<object>
<= 12 items
object
id
required

A sub-topic id from subtopics.list.

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)$/
weight
required

1 is normal; 2 gets about twice the posts, 0.5 half.

number
>= 0.2 <= 3
account

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

string
>= 1 characters <= 64 characters
note

Optional, on any tool: one or two sentences for Xholic’s shared memory about what the user just decided, asked for or said about themselves or their plans (e.g. “Dropping threads for now; focusing on replies to founders”). Every AI the user connects reads it, so they never repeat themselves. In your words, never other people’s posts. Leave it out when nothing new was said.

string
<= 20000 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"
}
}