Update status & outcome
curl --request PATCH \
--url https://api.custral.com/v1/conversations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outcome": "<string>"
}
'import requests
url = "https://api.custral.com/v1/conversations/{id}"
payload = { "outcome": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({outcome: '<string>'})
};
fetch('https://api.custral.com/v1/conversations/{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://api.custral.com/v1/conversations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'outcome' => '<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.custral.com/v1/conversations/{id}"
payload := strings.NewReader("{\n \"outcome\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.custral.com/v1/conversations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/conversations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outcome\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "conv_123",
"title": "Jane Doe",
"status": "open",
"outcome": "won",
"summary": "<string>",
"sourceType": "imessage",
"channelId": "chan_123",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"messages": [
{
"id": "msg_123",
"text": "On my way!",
"author": "Jane Doe",
"authorId": "+15551234567",
"sourceType": "imessage",
"direction": "inbound",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"participants": [
{
"type": "record",
"name": "Jane Doe",
"email": "jane@acme.com",
"recordId": "rec_123"
}
]
},
"reqId": "req_2a1f9c8e7b6d5"
}{
"error": {
"code": "invalid_api_key"
},
"reqId": "req_2a1f9c8e7b6d5"
}{
"error": {
"code": "insufficient_scope"
},
"reqId": "req_2a1f9c8e7b6d5"
}{
"error": {
"code": "not_found"
},
"reqId": "req_2a1f9c8e7b6d5"
}Conversations
Update status & outcome
Set a conversation’s status and/or outcome directly — the value you send is the value that sticks (no re-analysis). Requires scope: conversations:write.
PATCH
/
v1
/
conversations
/
{id}
Update status & outcome
curl --request PATCH \
--url https://api.custral.com/v1/conversations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"outcome": "<string>"
}
'import requests
url = "https://api.custral.com/v1/conversations/{id}"
payload = { "outcome": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({outcome: '<string>'})
};
fetch('https://api.custral.com/v1/conversations/{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://api.custral.com/v1/conversations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'outcome' => '<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.custral.com/v1/conversations/{id}"
payload := strings.NewReader("{\n \"outcome\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.custral.com/v1/conversations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"outcome\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custral.com/v1/conversations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"outcome\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "conv_123",
"title": "Jane Doe",
"status": "open",
"outcome": "won",
"summary": "<string>",
"sourceType": "imessage",
"channelId": "chan_123",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"messages": [
{
"id": "msg_123",
"text": "On my way!",
"author": "Jane Doe",
"authorId": "+15551234567",
"sourceType": "imessage",
"direction": "inbound",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"participants": [
{
"type": "record",
"name": "Jane Doe",
"email": "jane@acme.com",
"recordId": "rec_123"
}
]
},
"reqId": "req_2a1f9c8e7b6d5"
}{
"error": {
"code": "invalid_api_key"
},
"reqId": "req_2a1f9c8e7b6d5"
}{
"error": {
"code": "insufficient_scope"
},
"reqId": "req_2a1f9c8e7b6d5"
}{
"error": {
"code": "not_found"
},
"reqId": "req_2a1f9c8e7b6d5"
}Authorizations
A Custral secret API key (sk_…), created in Settings → Applications. Sent as Authorization: Bearer sk_…. The X-Api-Key: sk_… header is also accepted and takes precedence. Never expose a secret key in a browser.
Path Parameters
The conversation id (conv_…).
Body
application/json
Was this page helpful?