curl --request DELETE \
--url https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_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>"
}
]
}
}
}{
"error": "<string>"
}Delete Draft
Discard the scenario’s current draft.
curl --request DELETE \
--url https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{projectID}.texterchat.com/server/api/v2/scenarios/manage/{scenarioId}/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"_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>"
}
]
}
}
}{
"error": "<string>"
}Edit scenarios, Manage scenarios on behalf of user (both are required)
Optionally, you can include an authorUid body field (a Texter user UID) to attribute the action to a specific user; when omitted, it is attributed automatically.Authorizations
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.
Path Parameters
The unique identifier of the subscription (scenario). Use List All Subscriptions to find it under scenarios[]._id
Response
The scenario without the draft. Field-by-field reference: The Scenario object
An event subscription (scenario) in Texter
Unique identifier of the subscription/scenario
System scenario identifier. Present only on built-in system scenarios (returned when includeSystem=true)
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
Inactive revisions
Show child attributes
Show child attributes
The currently active version of the scenario
Show child attributes
Show child attributes