curl --request POST \
--url https://api.attention.tech/v2/changeConversationOpportunity \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "conv-uuid-123",
"opportunity_id": "opp-uuid-456",
"remove_opportunity": false,
"skip_intelligence_calculation": false
}
'import requests
url = "https://api.attention.tech/v2/changeConversationOpportunity"
payload = {
"conversation_id": "conv-uuid-123",
"opportunity_id": "opp-uuid-456",
"remove_opportunity": False,
"skip_intelligence_calculation": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: 'conv-uuid-123',
opportunity_id: 'opp-uuid-456',
remove_opportunity: false,
skip_intelligence_calculation: false
})
};
fetch('https://api.attention.tech/v2/changeConversationOpportunity', 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.attention.tech/v2/changeConversationOpportunity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversation_id' => 'conv-uuid-123',
'opportunity_id' => 'opp-uuid-456',
'remove_opportunity' => false,
'skip_intelligence_calculation' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.attention.tech/v2/changeConversationOpportunity"
payload := strings.NewReader("{\n \"conversation_id\": \"conv-uuid-123\",\n \"opportunity_id\": \"opp-uuid-456\",\n \"remove_opportunity\": false,\n \"skip_intelligence_calculation\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.post("https://api.attention.tech/v2/changeConversationOpportunity")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"conv-uuid-123\",\n \"opportunity_id\": \"opp-uuid-456\",\n \"remove_opportunity\": false,\n \"skip_intelligence_calculation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attention.tech/v2/changeConversationOpportunity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"conv-uuid-123\",\n \"opportunity_id\": \"opp-uuid-456\",\n \"remove_opportunity\": false,\n \"skip_intelligence_calculation\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}Change Conversation Opportunity
Links, updates, or removes an opportunity associated with a conversation. When an opportunity is linked, CRM intelligence fields may be recalculated unless explicitly skipped.
curl --request POST \
--url https://api.attention.tech/v2/changeConversationOpportunity \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "conv-uuid-123",
"opportunity_id": "opp-uuid-456",
"remove_opportunity": false,
"skip_intelligence_calculation": false
}
'import requests
url = "https://api.attention.tech/v2/changeConversationOpportunity"
payload = {
"conversation_id": "conv-uuid-123",
"opportunity_id": "opp-uuid-456",
"remove_opportunity": False,
"skip_intelligence_calculation": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: 'conv-uuid-123',
opportunity_id: 'opp-uuid-456',
remove_opportunity: false,
skip_intelligence_calculation: false
})
};
fetch('https://api.attention.tech/v2/changeConversationOpportunity', 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.attention.tech/v2/changeConversationOpportunity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversation_id' => 'conv-uuid-123',
'opportunity_id' => 'opp-uuid-456',
'remove_opportunity' => false,
'skip_intelligence_calculation' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.attention.tech/v2/changeConversationOpportunity"
payload := strings.NewReader("{\n \"conversation_id\": \"conv-uuid-123\",\n \"opportunity_id\": \"opp-uuid-456\",\n \"remove_opportunity\": false,\n \"skip_intelligence_calculation\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.post("https://api.attention.tech/v2/changeConversationOpportunity")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"conv-uuid-123\",\n \"opportunity_id\": \"opp-uuid-456\",\n \"remove_opportunity\": false,\n \"skip_intelligence_calculation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.attention.tech/v2/changeConversationOpportunity")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"conv-uuid-123\",\n \"opportunity_id\": \"opp-uuid-456\",\n \"remove_opportunity\": false,\n \"skip_intelligence_calculation\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}Authorizations
Body
Request body with the conversation ID and opportunity details
UUID of the conversation to update
"conv_abc123"
UUID of the opportunity to link. Required when linking or updating an opportunity.
"opp_xyz789"
CRM entity code for the opportunity (e.g., 'salesforce', 'hubspot')
"salesforce"
When true, skips recalculating CRM intelligence fields after the opportunity change. Defaults to false.
When true, removes the current opportunity from the conversation instead of linking one. Defaults to false.
Response
Opportunity changed successfully
Indicates whether the opportunity was changed successfully
Was this page helpful?