FansquareAPI reference
Open the app

Script sequences

Create a script sequence

POST/v1/script-sequences

Creates a whole sequence in one call, from existing scripts of one creator (it points to them, it never copies them). Each step has a title and 1 to 5 options; each option sends a script under a condition, judged on what the fan did since the message of the previous step. The first step only takes any options. The sequence is published: chatters are offered it in the conversation right away. Show the user the sequence before creating it.

Required scopewrite:scripts
Rate limit30 requests per minute
curl -X POST 'https://api.fansquare.so/v1/script-sequences' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "creator_id": "m81IhLxdhzDGYs54rNp2",
  "name": "Lena",
  "steps": [
    {
      "id": "05d8446f-24ff-403e-acc9-c66c59b9ca74",
      "title": "string",
      "context_note": "string",
      "options": [
        {
          "id": "59d4364a-a19e-4efb-a647-e8d32ade0d3c",
          "script_id": "7668136a-d6ea-4b9d-a45d-f8b902de321f",
          "condition": "any",
          "label": "Orders to accounting",
          "delay_hours": 12,
          "context_note": "string"
        }
      ]
    }
  ]
}'
{
  "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",
          "script_id": "7668136a-d6ea-4b9d-a45d-f8b902de321f",
          "condition": "any",
          "label": "Orders to accounting",
          "delay_hours": 12,
          "context_note": "string"
        }
      ]
    }
  ]
}

Parameters

Headers

  • Fansquare-Versionstringrequired

    API version to pin. Accepts the mineral name or the release date of a version.

Body

application/json

  • creator_idstringrequired

    Fansquare creator id (see GET /v1/creators).

    min length 1
  • namestringrequired

    Name of the sequence (1 to 60 characters).

    min length 1max length 60
  • stepsarray of objectsrequired

    The steps, in order (1 to 30).

    min items 1max items 30
    • idstring

      Id of an existing step, to keep it and the fans on it (replace only). Omit for a new step.

      format uuid
    • titlestringrequired

      Title of the step (1 to 60 characters).

      min length 1max length 60
    • context_notestring | null

      Note for the chatters (1000 characters max). Never sent to the fan.

      max length 1000
    • optionsarray of objectsrequired

      What the chatter can send at this step: 1 to 5 options, none of them the main one.

      min items 1max items 5
      • idstring

        Id of an existing option of this step, to keep it and its fans (replace only). Omit for a new option.

        format uuid
      • script_idstringrequired

        A script of the same creator (see list_scripts). Several options and sequences may share a script.

        format uuid
      • conditionstringrequired

        When 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, after delay_hours if set), bought (the fan bought the media of the previous step), not_bought (the fan has not bought it, after delay_hours if set), other (a case of your own, described by label).

        Valuesanyno_replyboughtnot_boughtother
      • labelstring | null

        Required for other: the case, as the chatter reads it (80 characters max). Ignored otherwise.

        max length 80
      • delay_hoursinteger | null

        For no_reply and not_bought: hours to wait first (1 to 720). Ignored otherwise.

        min 1max 720
      • context_notestring | null

        Note for the chatters (1000 characters max). Never sent to the fan.

        max length 1000

Response

Created, application/json

  • idstringrequired

    Fansquare script sequence id. Path parameter of the /v1/script-sequences/{sequence_id} routes.

  • creator_idstringrequired

    Fansquare creator id (see GET /v1/creators).

  • namestringrequired

    Name of the sequence.

  • statusstringrequired

    published (offered to chatters in the conversation) or draft (visible in the app editor only, until published).

    Valuesdraftpublished
  • published_atstring | nullrequired

    When the sequence was published (ISO 8601), null for a draft.

    format date-time
  • created_atstringrequired

    When the sequence was created (ISO 8601).

    format date-time
  • updated_atstringrequired

    When the sequence was last changed (ISO 8601).

    format date-time
  • stepsarray of objectsrequired

    The steps, in order: the conversation goes from one step to the next.

    • idstringrequired

      Step id. Send it back in replace_script_sequence to keep the step (and the fans on it).

    • titlestringrequired

      Title of the step, the stage of the conversation ("Premium content").

    • context_notestring | nullrequired

      Note for the chatters about this step. Never sent to the fan.

    • optionsarray of objectsrequired

      The scripts a chatter can send at this step, each with its condition.

      • idstringrequired

        Option id. Send it back in replace_script_sequence to keep the option (and the fans on it).

      • conditionstringrequired

        When 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, after delay_hours if set), bought (the fan bought the media of the previous step), not_bought (the fan has not bought it, after delay_hours if set), other (a case of your own, described by label).

        Valuesanyno_replyboughtnot_boughtother
      • labelstring | nullrequired

        Description of the case, for the other condition. null otherwise.

      • delay_hoursinteger | nullrequired

        Hours to wait before the option is offered, for no_reply and not_bought. null otherwise.

      • context_notestring | nullrequired

        Note for the chatters about this option. Never sent to the fan.

      • script_idstring | nullrequired

        The script sent with this option (see get_script). null when that script was deleted: replace the option.

      • script_namestring | nullrequired

        Name of that script, null when it was deleted.

curl -X POST 'https://api.fansquare.so/v1/script-sequences' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste" \
  -H "Content-Type: application/json" \
  -d '{
  "creator_id": "m81IhLxdhzDGYs54rNp2",
  "name": "Lena",
  "steps": [
    {
      "id": "05d8446f-24ff-403e-acc9-c66c59b9ca74",
      "title": "string",
      "context_note": "string",
      "options": [
        {
          "id": "59d4364a-a19e-4efb-a647-e8d32ade0d3c",
          "script_id": "7668136a-d6ea-4b9d-a45d-f8b902de321f",
          "condition": "any",
          "label": "Orders to accounting",
          "delay_hours": 12,
          "context_note": "string"
        }
      ]
    }
  ]
}'
{
  "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",
          "script_id": "7668136a-d6ea-4b9d-a45d-f8b902de321f",
          "condition": "any",
          "label": "Orders to accounting",
          "delay_hours": 12,
          "context_note": "string"
        }
      ]
    }
  ]
}