API Docs

surveys

AdminUpdated Sep 19, 2026
GEThttps://api.chatlychat.com/v1/surveys
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.
Responses
200
Code samples
cURL
curl -X GET "https://api.chatlychat.com/v1/surveys" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/surveys', {
  method: 'GET',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "GET",
    "https://api.chatlychat.com/v1/surveys",
    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/surveys", 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/surveys');
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/surveys')
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/surveys"))
    .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/surveys
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
{
  "name": "string",
  "kind": "csat",
  "status": "draft",
  "questions": [
    {
      "id": "string",
      "type": "rating",
      "label": "string",
      "help": "string",
      "required": false,
      "options": [
        "string"
      ],
      "primary": false,
      "display": "stars"
    }
  ],
  "intro": "string",
  "thankYou": "string",
  "triggerConfig": {
    "on": "conversation_closed",
    "delayMinutes": 0,
    "channelTypes": [
      "string"
    ]
  },
  "throttleDays": 0,
  "expiresAfterDays": 0,
  "config": {}
}
Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/surveys" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/surveys', {
  method: 'POST',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "POST",
    "https://api.chatlychat.com/v1/surveys",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"name": "string", "kind": "csat", "status": "draft", "questions": [{"id": "string", "type": "rating", "label": "string", "help": "string", "required": False, "options": ["string"], "primary": False, "display": "stars"}], "intro": "string", "thankYou": "string", "triggerConfig": {"on": "conversation_closed", "delayMinutes": 0, "channelTypes": ["string"]}, "throttleDays": 0, "expiresAfterDays": 0, "config": {}},
)
data = res.json()
Go
package main

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

func main() {
	req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/surveys", strings.NewReader(`{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}`))
	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/surveys');
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, '{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/surveys')
req = Net::HTTP::Post.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}'
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/surveys"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"name\":\"string\",\"kind\":\"csat\",\"status\":\"draft\",\"questions\":[{\"id\":\"string\",\"type\":\"rating\",\"label\":\"string\",\"help\":\"string\",\"required\":false,\"options\":[\"string\"],\"primary\":false,\"display\":\"stars\"}],\"intro\":\"string\",\"thankYou\":\"string\",\"triggerConfig\":{\"on\":\"conversation_closed\",\"delayMinutes\":0,\"channelTypes\":[\"string\"]},\"throttleDays\":0,\"expiresAfterDays\":0,\"config\":{}}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
GEThttps://api.chatlychat.com/v1/surveys/{id}/results
Parameters
NameInTypeRequiredDescription
idpathstringyes
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/surveys/{id}/results" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/surveys/{id}/results', {
  method: 'GET',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "GET",
    "https://api.chatlychat.com/v1/surveys/{id}/results",
    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/surveys/{id}/results", 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/surveys/{id}/results');
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/surveys/{id}/results')
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/surveys/{id}/results"))
    .header("Idempotency-Key", "<value>")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
GEThttps://api.chatlychat.com/v1/surveys/{id}/results.csv
Parameters
NameInTypeRequiredDescription
idpathstringyes
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/surveys/{id}/results.csv" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/surveys/{id}/results.csv', {
  method: 'GET',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "GET",
    "https://api.chatlychat.com/v1/surveys/{id}/results.csv",
    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/surveys/{id}/results.csv", 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/surveys/{id}/results.csv');
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/surveys/{id}/results.csv')
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/surveys/{id}/results.csv"))
    .header("Idempotency-Key", "<value>")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
PATCHhttps://api.chatlychat.com/v1/surveys/{id}
Edit a survey — questions, trigger, status
Parameters
NameInTypeRequiredDescription
idpathstringyes
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
{
  "name": "string",
  "kind": "csat",
  "status": "draft",
  "questions": [
    {
      "id": "string",
      "type": "rating",
      "label": "string",
      "help": "string",
      "required": false,
      "options": [
        "string"
      ],
      "primary": false,
      "display": "stars"
    }
  ],
  "intro": "string",
  "thankYou": "string",
  "triggerConfig": {
    "on": "conversation_closed",
    "delayMinutes": 0,
    "channelTypes": [
      "string"
    ]
  },
  "throttleDays": 0,
  "expiresAfterDays": 0,
  "config": {}
}
Responses
200
Code samples
cURL
curl -X PATCH "https://api.chatlychat.com/v1/surveys/{id}" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/surveys/{id}', {
  method: 'PATCH',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "PATCH",
    "https://api.chatlychat.com/v1/surveys/{id}",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"name": "string", "kind": "csat", "status": "draft", "questions": [{"id": "string", "type": "rating", "label": "string", "help": "string", "required": False, "options": ["string"], "primary": False, "display": "stars"}], "intro": "string", "thankYou": "string", "triggerConfig": {"on": "conversation_closed", "delayMinutes": 0, "channelTypes": ["string"]}, "throttleDays": 0, "expiresAfterDays": 0, "config": {}},
)
data = res.json()
Go
package main

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

func main() {
	req, _ := http.NewRequest("PATCH", "https://api.chatlychat.com/v1/surveys/{id}", strings.NewReader(`{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}`))
	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/surveys/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/surveys/{id}')
req = Net::HTTP::Patch.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"name":"string","kind":"csat","status":"draft","questions":[{"id":"string","type":"rating","label":"string","help":"string","required":false,"options":["string"],"primary":false,"display":"stars"}],"intro":"string","thankYou":"string","triggerConfig":{"on":"conversation_closed","delayMinutes":0,"channelTypes":["string"]},"throttleDays":0,"expiresAfterDays":0,"config":{}}'
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/surveys/{id}"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("PATCH", BodyPublishers.ofString("{\"name\":\"string\",\"kind\":\"csat\",\"status\":\"draft\",\"questions\":[{\"id\":\"string\",\"type\":\"rating\",\"label\":\"string\",\"help\":\"string\",\"required\":false,\"options\":[\"string\"],\"primary\":false,\"display\":\"stars\"}],\"intro\":\"string\",\"thankYou\":\"string\",\"triggerConfig\":{\"on\":\"conversation_closed\",\"delayMinutes\":0,\"channelTypes\":[\"string\"]},\"throttleDays\":0,\"expiresAfterDays\":0,\"config\":{}}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
GEThttps://api.chatlychat.com/v1/surveys/{id}/stats
Headline score, response rate and per-question breakdown
Parameters
NameInTypeRequiredDescription
idpathstringyes
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/surveys/{id}/stats" \
  -H "Idempotency-Key: <value>"
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/surveys/{id}/stats', {
  method: 'GET',
  headers: {
    'Idempotency-Key': '<value>',
  },
});
const data = await res.json();
Python
import requests

res = requests.request(
    "GET",
    "https://api.chatlychat.com/v1/surveys/{id}/stats",
    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/surveys/{id}/stats", 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/surveys/{id}/stats');
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/surveys/{id}/stats')
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/surveys/{id}/stats"))
    .header("Idempotency-Key", "<value>")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
PUThttps://api.chatlychat.com/v1/survey-responses/{id}/review-notes
Write or clear the internal review note on a survey response
Parameters
NameInTypeRequiredDescription
idpathstringyes
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
{
  "notes": "string"
}
Responses
200
Code samples
cURL
curl -X PUT "https://api.chatlychat.com/v1/survey-responses/{id}/review-notes" \
  -H "Idempotency-Key: <value>" \
  -H "Content-Type: application/json" \
  -d '{"notes":"string"}'
TypeScript
const res = await fetch('https://api.chatlychat.com/v1/survey-responses/{id}/review-notes', {
  method: 'PUT',
  headers: {
    'Idempotency-Key': '<value>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"notes":"string"}),
});
const data = await res.json();
Python
import requests

res = requests.request(
    "PUT",
    "https://api.chatlychat.com/v1/survey-responses/{id}/review-notes",
    headers={
    "Idempotency-Key": "<value>",
    "Content-Type": "application/json",
    },
    json={"notes": "string"},
)
data = res.json()
Go
package main

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

func main() {
	req, _ := http.NewRequest("PUT", "https://api.chatlychat.com/v1/survey-responses/{id}/review-notes", strings.NewReader(`{"notes":"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/survey-responses/{id}/review-notes');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"notes":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Ruby
require 'net/http'
require 'uri'

uri = URI('https://api.chatlychat.com/v1/survey-responses/{id}/review-notes')
req = Net::HTTP::Put.new(uri)
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"notes":"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/survey-responses/{id}/review-notes"))
    .header("Idempotency-Key", "<value>")
    .header("Content-Type", "application/json")
    .method("PUT", BodyPublishers.ofString("{\"notes\":\"string\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
Was this page helpful?