curl --request POST \
--url https://api.statisfy.com/v1/surveys/{survey_id}/duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/surveys/{survey_id}/duplicate"
payload = { "title": "<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({title: '<string>'})
};
fetch('https://api.statisfy.com/v1/surveys/{survey_id}/duplicate', 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/surveys/{survey_id}/duplicate",
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([
'title' => '<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/surveys/{survey_id}/duplicate"
payload := strings.NewReader("{\n \"title\": \"<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/surveys/{survey_id}/duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/surveys/{survey_id}/duplicate")
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 \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"definition": {},
"description": "<string>",
"email": {
"editor": "simple",
"html": "<string>",
"sender_email": "<string>",
"sender_name": "<string>",
"subject": "<string>"
},
"id": "<string>",
"state": "draft",
"theme": {},
"title": "<string>",
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}Duplicate a survey
Copies a survey, published or not, into a new draft with its questions, theme and email, as the app’s Duplicate action does. The copy gets its own email, so changing it leaves the original’s alone. Without a title, the copy is named Copy of <title>, numbered (2), (3) and on past the copies that exist.
curl --request POST \
--url https://api.statisfy.com/v1/surveys/{survey_id}/duplicate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>"
}
'import requests
url = "https://api.statisfy.com/v1/surveys/{survey_id}/duplicate"
payload = { "title": "<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({title: '<string>'})
};
fetch('https://api.statisfy.com/v1/surveys/{survey_id}/duplicate', 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/surveys/{survey_id}/duplicate",
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([
'title' => '<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/surveys/{survey_id}/duplicate"
payload := strings.NewReader("{\n \"title\": \"<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/surveys/{survey_id}/duplicate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.statisfy.com/v1/surveys/{survey_id}/duplicate")
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 \"title\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"definition": {},
"description": "<string>",
"email": {
"editor": "simple",
"html": "<string>",
"sender_email": "<string>",
"sender_name": "<string>",
"subject": "<string>"
},
"id": "<string>",
"state": "draft",
"theme": {},
"title": "<string>",
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
An API key, sent as Authorization: Bearer stfy_live_…. See Authentication for how to get one and which scopes it needs.
Body
Response
Successful Response
The survey's questions and pages: the SurveyJS JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition). Elements sit in pages[].elements (or top-level elements) and in panels' elements; panels nest at most 10 deep. An element's type is one of boolean, checkbox, comment, dropdown, expression, file, html, image, imagepicker, matrix, matrixdropdown, matrixdynamic, multipletext, panel, paneldynamic, radiogroup, ranking, rating, signaturepad, tagbox, text. A question's name is the key its answers carry, so every question needs one and names must be unique. At most 1,000,000 characters as JSON. HTML in it (html elements, completedHtml) is stored as sent and cleaned where the survey renders
The SurveyJS theme JSON the app's survey builder saves (https://help.statisfy.com/rest-api/survey_definition#theme)
Was this page helpful?