Script sequences
Create a script sequence from a collection
/v1/script-sequences/from-collectionTurns a collection into a sequence, a starting point to refine: one step per script, in the order of the collection, titled with the name of the script, with that script as its only any option. Then add conditions and options with replace_script_sequence. The sequence is published as it is: chatters are offered this first version right away, until it is replaced. Tell the user before calling it.
write:scriptscurl -X POST 'https://api.fansquare.so/v1/script-sequences/from-collection' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"collection_id": "9b0b4f0e-3127-406b-a0f2-e7bf80e50779"
}'{
"id": "40a6e358-bd2a-4cff-a59e-5709874d3f5b",
"creator_id": "m81IhLxdhzDGYs54rNp2",
"name": "Lena",
"status": "draft",
"published_at": null,
"created_at": "2026-10-12T21:14:00.000Z",
"updated_at": "2026-10-12T21:14:00.000Z",
"steps": [
{
"id": "05d8446f-24ff-403e-acc9-c66c59b9ca74",
"title": "string",
"context_note": "string",
"options": [
{
"id": "59d4364a-a19e-4efb-a647-e8d32ade0d3c",
"condition": "any",
"label": "Orders to accounting",
"delay_hours": 12,
"context_note": "string",
"script_id": "7668136a-d6ea-4b9d-a45d-f8b902de321f",
"script_name": "string"
}
]
}
]
}Parameters
Headers
Fansquare-VersionstringrequiredAPI version to pin. Accepts the mineral name or the release date of a version.
Body
application/json
collection_idstringrequiredA script collection (see list_script_collections), of at most 30 scripts.
format uuid
Response
Created, application/json
idstringrequiredFansquare script sequence id. Path parameter of the /v1/script-sequences/{sequence_id} routes.
creator_idstringrequiredFansquare creator id (see GET /v1/creators).
namestringrequiredName of the sequence.
statusstringrequiredpublished(offered to chatters in the conversation) ordraft(visible in the app editor only, until published).Valuesdraftpublishedpublished_atstring | nullrequiredWhen the sequence was published (ISO 8601), null for a draft.
format date-timecreated_atstringrequiredWhen the sequence was created (ISO 8601).
format date-timeupdated_atstringrequiredWhen the sequence was last changed (ISO 8601).
format date-timestepsarray of objectsrequiredThe steps, in order: the conversation goes from one step to the next.
idstringrequiredStep id. Send it back in replace_script_sequence to keep the step (and the fans on it).
titlestringrequiredTitle of the step, the stage of the conversation ("Premium content").
context_notestring | nullrequiredNote for the chatters about this step. Never sent to the fan.
optionsarray of objectsrequiredThe scripts a chatter can send at this step, each with its condition.
idstringrequiredOption id. Send it back in replace_script_sequence to keep the option (and the fans on it).
conditionstringrequiredWhen the chatter is offered this option, judged on what the fan did since the message of the PREVIOUS step:
any(always offered; the only one allowed on the first step),no_reply(the fan has not answered, afterdelay_hoursif set),bought(the fan bought the media of the previous step),not_bought(the fan has not bought it, afterdelay_hoursif set),other(a case of your own, described bylabel).Valuesanyno_replyboughtnot_boughtotherlabelstring | nullrequiredDescription of the case, for the
othercondition. null otherwise.delay_hoursinteger | nullrequiredHours to wait before the option is offered, for
no_replyandnot_bought. null otherwise.context_notestring | nullrequiredNote for the chatters about this option. Never sent to the fan.
script_idstring | nullrequiredThe script sent with this option (see get_script). null when that script was deleted: replace the option.
script_namestring | nullrequiredName of that script, null when it was deleted.
curl -X POST 'https://api.fansquare.so/v1/script-sequences/from-collection' \
-H "Authorization: Bearer $API_KEY" \
-H "Fansquare-Version: Amethyste" \
-H "Content-Type: application/json" \
-d '{
"collection_id": "9b0b4f0e-3127-406b-a0f2-e7bf80e50779"
}'{
"id": "40a6e358-bd2a-4cff-a59e-5709874d3f5b",
"creator_id": "m81IhLxdhzDGYs54rNp2",
"name": "Lena",
"status": "draft",
"published_at": null,
"created_at": "2026-10-12T21:14:00.000Z",
"updated_at": "2026-10-12T21:14:00.000Z",
"steps": [
{
"id": "05d8446f-24ff-403e-acc9-c66c59b9ca74",
"title": "string",
"context_note": "string",
"options": [
{
"id": "59d4364a-a19e-4efb-a647-e8d32ade0d3c",
"condition": "any",
"label": "Orders to accounting",
"delay_hours": 12,
"context_note": "string",
"script_id": "7668136a-d6ea-4b9d-a45d-f8b902de321f",
"script_name": "string"
}
]
}
]
}