דלג לתוכן הראשי
POST
/
scenarios
/
manage
/
{scenarioId}
/
copy
Copy Scenario
curl --request POST \
  --url https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/copy \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fromVersion": 2,
  "newName": "(SUB) All Messages - staging"
}
'
{
  "_id": "<string>",
  "system": "<string>",
  "drafts": [
    {}
  ],
  "inactiveRevisions": [
    {
      "_id": "<string>",
      "scenarioId": "<string>",
      "name": "<string>",
      "description": "<string>",
      "version": 123,
      "parentVersion": 123,
      "revisionComment": "<string>",
      "triggerEvents": [
        "<string>"
      ],
      "conditions": [
        [
          {
            "name": "<string>",
            "params": "<unknown>",
            "confidentialData": true
          }
        ]
      ],
      "loaders": {
        "beforeConditions": [
          {
            "name": "<string>",
            "alias": "<string>",
            "params": "<unknown>",
            "confidentialData": true
          }
        ],
        "afterConditions": [
          {
            "name": "<string>",
            "alias": "<string>",
            "params": "<unknown>",
            "confidentialData": true
          }
        ]
      },
      "actions": [
        {
          "name": "<string>",
          "params": "<unknown>",
          "confidentialData": true
        }
      ],
      "loops": [
        {
          "loop": {}
        }
      ],
      "tags": [
        "<string>"
      ],
      "attachedData": {},
      "system": "<string>",
      "options": {
        "unorderedActions": true
      },
      "metadata": {
        "authorUid": "<string>",
        "created": 123,
        "modified": 123,
        "activated": 123,
        "activations": [
          {
            "timestamp": 123,
            "userUid": "<string>"
          }
        ]
      }
    }
  ],
  "activeRevision": {
    "_id": "<string>",
    "scenarioId": "<string>",
    "name": "<string>",
    "description": "<string>",
    "version": 123,
    "parentVersion": 123,
    "revisionComment": "<string>",
    "triggerEvents": [
      "<string>"
    ],
    "conditions": [
      [
        {
          "name": "<string>",
          "params": "<unknown>",
          "confidentialData": true
        }
      ]
    ],
    "loaders": {
      "beforeConditions": [
        {
          "name": "<string>",
          "alias": "<string>",
          "params": "<unknown>",
          "confidentialData": true
        }
      ],
      "afterConditions": [
        {
          "name": "<string>",
          "alias": "<string>",
          "params": "<unknown>",
          "confidentialData": true
        }
      ]
    },
    "actions": [
      {
        "name": "<string>",
        "params": "<unknown>",
        "confidentialData": true
      }
    ],
    "loops": [
      {
        "loop": {}
      }
    ],
    "tags": [
      "<string>"
    ],
    "attachedData": {},
    "system": "<string>",
    "options": {
      "unorderedActions": true
    },
    "metadata": {
      "authorUid": "<string>",
      "created": 123,
      "modified": 123,
      "activated": 123,
      "activations": [
        {
          "timestamp": 123,
          "userUid": "<string>"
        }
      ]
    }
  }
}

הרשאות

Authorization
string
header
נדרש

API token generated in Texter: gear icon → Developers → API Tokens. When creating a token, assign it the scopes required by the endpoints you plan to call - each endpoint lists its required scopes.

פרמטרי נתיב

scenarioId
string
נדרש

The unique identifier of the subscription (scenario). Use List All Subscriptions to find it under scenarios[]._id

גוף

application/json
fromVersion
integer
נדרש

The revision version to copy from

טווח נדרש: x >= 1
newName
string

Name for the copy. Defaults to a variation of the original name

authorUid
string

Optional - Texter user ID (UID) to attribute the copy to

תגובה

The new scenario created from the copy. Field-by-field reference: The Scenario object

An event subscription (scenario) in Texter

_id
string

Unique identifier of the subscription/scenario

system
string

System scenario identifier. Present only on built-in system scenarios (returned when includeSystem=true)

drafts
object[]

Draft revisions of this scenario being edited. Same shape as a revision, but with status: "draft", no version/revisionComment, and metadata limited to authorUid/created/modified

inactiveRevisions
object[]

Inactive revisions

activeRevision
object

The currently active version of the scenario