curl --request PUT \
--url https://app.formbricks.com/api/v2/management/responses/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"finished": true,
"endingId": "<string>",
"data": {},
"variables": {},
"ttc": {},
"language": "<string>"
}
'import requests
url = "https://app.formbricks.com/api/v2/management/responses/{id}"
payload = {
"finished": True,
"endingId": "<string>",
"data": {},
"variables": {},
"ttc": {},
"language": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
finished: true,
endingId: '<string>',
data: {},
variables: {},
ttc: {},
language: '<string>'
})
};
fetch('https://app.formbricks.com/api/v2/management/responses/{id}', 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://app.formbricks.com/api/v2/management/responses/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'finished' => true,
'endingId' => '<string>',
'data' => [
],
'variables' => [
],
'ttc' => [
],
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://app.formbricks.com/api/v2/management/responses/{id}"
payload := strings.NewReader("{\n \"finished\": true,\n \"endingId\": \"<string>\",\n \"data\": {},\n \"variables\": {},\n \"ttc\": {},\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.put("https://app.formbricks.com/api/v2/management/responses/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"finished\": true,\n \"endingId\": \"<string>\",\n \"data\": {},\n \"variables\": {},\n \"ttc\": {},\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.formbricks.com/api/v2/management/responses/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"finished\": true,\n \"endingId\": \"<string>\",\n \"data\": {},\n \"variables\": {},\n \"ttc\": {},\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "2021-01-01T00:00:00.000Z",
"updatedAt": "2021-01-01T00:00:00.000Z",
"finished": true,
"surveyId": "<string>",
"contactId": "<string>",
"endingId": "<string>",
"data": {
"question1": "answer1",
"question2": 2,
"question3": [
"answer3",
"answer4"
],
"question4": {
"subquestion1": "answer5"
}
},
"variables": {
"variable1": "answer1",
"variable2": 2
},
"ttc": {
"question1": 10,
"question2": 20
},
"meta": {
"source": "https://example.com",
"url": "https://example.com",
"userAgent": {
"browser": "Chrome",
"os": "Windows",
"device": "Desktop"
},
"country": "US",
"action": "click"
},
"contactAttributes": {
"attribute1": "value1",
"attribute2": "value2"
},
"singleUseId": "<string>",
"language": "en",
"displayId": "<string>"
}Update a response
Updates a response in the database. This will trigger the response pipeline, including webhooks, integrations, follow-up emails (if the response is marked as finished), and other configured actions.
curl --request PUT \
--url https://app.formbricks.com/api/v2/management/responses/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"finished": true,
"endingId": "<string>",
"data": {},
"variables": {},
"ttc": {},
"language": "<string>"
}
'import requests
url = "https://app.formbricks.com/api/v2/management/responses/{id}"
payload = {
"finished": True,
"endingId": "<string>",
"data": {},
"variables": {},
"ttc": {},
"language": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
finished: true,
endingId: '<string>',
data: {},
variables: {},
ttc: {},
language: '<string>'
})
};
fetch('https://app.formbricks.com/api/v2/management/responses/{id}', 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://app.formbricks.com/api/v2/management/responses/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'finished' => true,
'endingId' => '<string>',
'data' => [
],
'variables' => [
],
'ttc' => [
],
'language' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://app.formbricks.com/api/v2/management/responses/{id}"
payload := strings.NewReader("{\n \"finished\": true,\n \"endingId\": \"<string>\",\n \"data\": {},\n \"variables\": {},\n \"ttc\": {},\n \"language\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.put("https://app.formbricks.com/api/v2/management/responses/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"finished\": true,\n \"endingId\": \"<string>\",\n \"data\": {},\n \"variables\": {},\n \"ttc\": {},\n \"language\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.formbricks.com/api/v2/management/responses/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"finished\": true,\n \"endingId\": \"<string>\",\n \"data\": {},\n \"variables\": {},\n \"ttc\": {},\n \"language\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"createdAt": "2021-01-01T00:00:00.000Z",
"updatedAt": "2021-01-01T00:00:00.000Z",
"finished": true,
"surveyId": "<string>",
"contactId": "<string>",
"endingId": "<string>",
"data": {
"question1": "answer1",
"question2": 2,
"question3": [
"answer3",
"answer4"
],
"question4": {
"subquestion1": "answer5"
}
},
"variables": {
"variable1": "answer1",
"variable2": 2
},
"ttc": {
"question1": 10,
"question2": 20
},
"meta": {
"source": "https://example.com",
"url": "https://example.com",
"userAgent": {
"browser": "Chrome",
"os": "Windows",
"device": "Desktop"
},
"country": "US",
"action": "click"
},
"contactAttributes": {
"attribute1": "value1",
"attribute2": "value2"
},
"singleUseId": "<string>",
"language": "en",
"displayId": "<string>"
}Authorizations
Use your Formbricks x-api-key to authenticate.
Path Parameters
The ID of the response
Body
The response fields to update
Response
Response updated successfully.
The ID of the response
The date and time the response was created
"2021-01-01T00:00:00.000Z"
The date and time the response was last updated
"2021-01-01T00:00:00.000Z"
Whether the response is finished
true
The ID of the survey
The ID of the contact
The ID of the ending
The data of the response
Show child attributes
Show child attributes
{ "question1": "answer1", "question2": 2, "question3": ["answer3", "answer4"], "question4": { "subquestion1": "answer5" } }
The variables of the response
Show child attributes
Show child attributes
{ "variable1": "answer1", "variable2": 2 }
The TTC of the response
Show child attributes
Show child attributes
{ "question1": 10, "question2": 20 }
The meta data of the response
Show child attributes
Show child attributes
{ "source": "https://example.com", "url": "https://example.com", "userAgent": { "browser": "Chrome", "os": "Windows", "device": "Desktop" }, "country": "US", "action": "click" }
The attributes of the contact
Show child attributes
Show child attributes
{ "attribute1": "value1", "attribute2": "value2" }
The single use ID of the response
The language of the response
"en"
The display ID of the response
Was this page helpful?