API Docs

surveys:public

AdminUpdated Sep 19, 2026
POSThttps://api.chatlychat.com/v1/public/surveys/responses
Parameters
NameInTypeRequiredDescription
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Request body application/json
{
  "workspaceId": "string",
  "surveyId": "string",
  "conversationId": "string",
  "contactId": "string",
  "score": 0,
  "comment": "string"
}
Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/public/surveys/responses" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"string","surveyId":"string","conversationId":"string","contactId":"string","score":0,"comment":"string"}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/public/surveys/responses', {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"workspaceId":"string","surveyId":"string","conversationId":"string","contactId":"string","score":0,"comment":"string"}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "POST",
    "https://api.chatlychat.com/v1/public/surveys/responses",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"workspaceId": "string", "surveyId": "string", "conversationId": "string", "contactId": "string", "score": 0, "comment": "string"},
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/public/surveys/responses", strings.NewReader(`{"workspaceId":"string","surveyId":"string","conversationId":"string","contactId":"string","score":0,"comment":"string"}`))
	req.Header.Set("Idempotency-Key", "<value>")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/public/surveys/responses');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"workspaceId":"string","surveyId":"string","conversationId":"string","contactId":"string","score":0,"comment":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/public/surveys/responses')
req = Net::HTTP::Post.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"workspaceId":"string","surveyId":"string","conversationId":"string","contactId":"string","score":0,"comment":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/public/surveys/responses"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"workspaceId\":\"string\",\"surveyId\":\"string\",\"conversationId\":\"string\",\"contactId\":\"string\",\"score\":0,\"comment\":\"string\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
GEThttps://api.chatlychat.com/v1/public/surveys/{token}
The survey behind a link
Parameters
NameInTypeRequiredDescription
tokenpathstringyes
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Responses
200
Code samples
cURL
curl -X GET "https://api.chatlychat.com/v1/public/surveys/{token}" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/public/surveys/{token}', {
  method: 'GET',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "GET",
    "https://api.chatlychat.com/v1/public/surveys/{token}",
    headers={
    "Idempotency-Key": "<value>",
    },
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.chatlychat.com/v1/public/surveys/{token}", nil)
	req.Header.Set("Idempotency-Key", "<value>")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/public/surveys/{token}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/public/surveys/{token}')
req = Net::HTTP::Get.new(uri)
req['Idempotency-Key'] = '<value>'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/public/surveys/{token}"))
    .header("Idempotency-Key", "<value>")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
POSThttps://api.chatlychat.com/v1/public/surveys/{token}/submit
Answer a survey
Parameters
NameInTypeRequiredDescription
tokenpathstringyes
Idempotency-KeyheaderstringnoUUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict.
Request body application/json
{
  "answers": {}
}
Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/public/surveys/{token}/submit" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"answers":{}}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/public/surveys/{token}/submit', {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"answers":{}}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "POST",
    "https://api.chatlychat.com/v1/public/surveys/{token}/submit",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"answers": {}},
)
data = res.json()
Go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/public/surveys/{token}/submit", strings.NewReader(`{"answers":{}}`))
	req.Header.Set("Idempotency-Key", "<value>")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/public/surveys/{token}/submit');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"answers":{}}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/public/surveys/{token}/submit')
req = Net::HTTP::Post.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"answers":{}}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
Java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.chatlychat.com/v1/public/surveys/{token}/submit"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"answers\":{}}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Was this page helpful?