Corrects an existing survey response in the authenticated organization.
/api/surveys/{id}Corrects an existing survey response in the authenticated organization. The partial request body may contain rating, comment, or both; ratings are integers from 1 through 3. New visitor responses use the separate visitor-token protocol and cannot be submitted with an organization API key.
Bearer API key or X-API-Key header.surveys:writeautomation_api)Resource identifier.
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Request body accepted by this operation.
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
{
"id": "11111111-1111-4111-8111-111111111111",
"orgId": "55555555-5555-4555-8555-555555555555",
"conversationId": "22222222-2222-4222-8222-222222222222",
"visitorId": "33333333-3333-4333-8333-333333333333",
"rating": 2,
"comment": "Helpful, but the resolution took longer than expected.",
"createdAt": "2030-06-15T09:15:00.000Z",
"updatedAt": "2030-06-15T09:20:00.000Z",
"isActive": true
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"fields": {
"property1": "string",
"property2": "string"
},
"details": {},
"correlationId": "string"
}
}curl --request PATCH \
'https://api.convor.io/api/surveys/11111111-1111-4111-8111-111111111111' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer convor_sk_...' \
--header 'Content-Type: application/json' \
--data '{
"rating": 2,
"comment": "Helpful, but the resolution took longer than expected."
}'const response = await fetch("https://api.convor.io/api/surveys/11111111-1111-4111-8111-111111111111", {
method: "PATCH",
headers: {
"Accept": "application/json",
"Authorization": "Bearer convor_sk_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"rating": 2,
"comment": "Helpful, but the resolution took longer than expected."
}),
});
const contentType = response.headers.get("content-type") ?? "";
const data = response.status === 204
? null
: contentType.includes("json")
? await response.json()
: contentType.startsWith("text/")
? await response.text()
: await response.blob();
if (!response.ok) {
const message = typeof data === "object" && data !== null
&& "error" in data && typeof data.error === "object"
&& data.error !== null && "message" in data.error
? String(data.error.message)
: "Convor API request failed (" + response.status + ")";
throw new Error(message);
}
console.log(data);Was this page helpful?
Value of rating.
Optional comment text.