Save a flow of the Templates folder as a template
curl --request POST \
--url https://api.statisfy.com/v1/automations/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"categories": [
"<string>"
],
"flow_id": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/automations/templates"
payload = {
"categories": ["<string>"],
"flow_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({categories: ['<string>'], flow_id: '<string>'})
};
fetch('https://api.statisfy.com/v1/automations/templates', 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://api.statisfy.com/v1/automations/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'categories' => [
'<string>'
],
'flow_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.statisfy.com/v1/automations/templates"
payload := strings.NewReader("{\n \"categories\": [\n \"<string>\"\n ],\n \"flow_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.statisfy.com/v1/automations/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"categories\": [\n \"<string>\"\n ],\n \"flow_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/automations/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"categories\": [\n \"<string>\"\n ],\n \"flow_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"categories": [
"<string>"
],
"components": [
"<string>"
],
"description": "<string>",
"id": "<string>",
"name": "<string>",
"result": "created",
"steps": [
{
"id": "<string>",
"name": "<string>",
"next": [
"<string>"
],
"settings": {},
"type": "trigger"
}
],
"to_fill": [
{
"input": "<string>",
"label": "<string>",
"step": "<string>"
}
],
"trigger": {
"object": "account",
"type": "schedule"
},
"updated_at": "<string>"
}{
"categories": [
"<string>"
],
"components": [
"<string>"
],
"description": "<string>",
"id": "<string>",
"name": "<string>",
"result": "created",
"steps": [
{
"id": "<string>",
"name": "<string>",
"next": [
"<string>"
],
"settings": {},
"type": "trigger"
}
],
"to_fill": [
{
"input": "<string>",
"label": "<string>",
"step": "<string>"
}
],
"trigger": {
"object": "account",
"type": "schedule"
},
"updated_at": "<string>"
}automations
Save a flow of the Templates folder as a template
Saves the flow as a template filed under `categories`, as the editor's "Save as Template" does: the template takes the flow's id, name, description and steps. A flow whose template exists (or was deleted) refreshes it from the flow and restores it (200, `result` updated); a new one is 201. Only a flow in Agent Studio's Templates folder can be saved (403 otherwise): build it there with POST /v1/automations/flows {"folder": ...} and test it first. To change a template's steps, name or description, change its flow and save it again. Templates are managed from Agent Studio's Templates folder: only a workspace that has it can save, change or delete them (403 elsewhere), and changes reach every workspace.
POST
/
v1
/
automations
/
templates
Save a flow of the Templates folder as a template
curl --request POST \
--url https://api.statisfy.com/v1/automations/templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"categories": [
"<string>"
],
"flow_id": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/automations/templates"
payload = {
"categories": ["<string>"],
"flow_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({categories: ['<string>'], flow_id: '<string>'})
};
fetch('https://api.statisfy.com/v1/automations/templates', 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://api.statisfy.com/v1/automations/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'categories' => [
'<string>'
],
'flow_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.statisfy.com/v1/automations/templates"
payload := strings.NewReader("{\n \"categories\": [\n \"<string>\"\n ],\n \"flow_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.statisfy.com/v1/automations/templates")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"categories\": [\n \"<string>\"\n ],\n \"flow_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/automations/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"categories\": [\n \"<string>\"\n ],\n \"flow_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"categories": [
"<string>"
],
"components": [
"<string>"
],
"description": "<string>",
"id": "<string>",
"name": "<string>",
"result": "created",
"steps": [
{
"id": "<string>",
"name": "<string>",
"next": [
"<string>"
],
"settings": {},
"type": "trigger"
}
],
"to_fill": [
{
"input": "<string>",
"label": "<string>",
"step": "<string>"
}
],
"trigger": {
"object": "account",
"type": "schedule"
},
"updated_at": "<string>"
}{
"categories": [
"<string>"
],
"components": [
"<string>"
],
"description": "<string>",
"id": "<string>",
"name": "<string>",
"result": "created",
"steps": [
{
"id": "<string>",
"name": "<string>",
"next": [
"<string>"
],
"settings": {},
"type": "trigger"
}
],
"to_fill": [
{
"input": "<string>",
"label": "<string>",
"step": "<string>"
}
],
"trigger": {
"object": "account",
"type": "schedule"
},
"updated_at": "<string>"
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
application/json
Response
Successful Response
Was this page helpful?