Skip to main content
POST
/
ask_attention
/
v2
Ask Attention V2
curl --request POST \
  --url https://api.attention.tech/v2/ask_attention/v2 \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "conversations_ids": [],
  "deal_id": "conv_123",
  "prompt": "Customer mentioned budget constraints but showed interest in premium features"
}
'
import requests

url = "https://api.attention.tech/v2/ask_attention/v2"

payload = {
"conversations_ids": [],
"deal_id": "conv_123",
"prompt": "Customer mentioned budget constraints but showed interest in premium features"
}
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({
conversations_ids: [],
deal_id: 'conv_123',
prompt: 'Customer mentioned budget constraints but showed interest in premium features'
})
};

fetch('https://api.attention.tech/v2/ask_attention/v2', 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/ask_attention/v2",
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([
'conversations_ids' => [

],
'deal_id' => 'conv_123',
'prompt' => 'Customer mentioned budget constraints but showed interest in premium features'
]),
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/ask_attention/v2"

payload := strings.NewReader("{\n \"conversations_ids\": [],\n \"deal_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\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/ask_attention/v2")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"conversations_ids\": [],\n \"deal_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.attention.tech/v2/ask_attention/v2")

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 \"conversations_ids\": [],\n \"deal_id\": \"conv_123\",\n \"prompt\": \"Customer mentioned budget constraints but showed interest in premium features\"\n}"

response = http.request(request)
puts response.read_body
[
  {
    "output": "Yes, this is an example of an 'Ask Attention' response",
    "conversation_id": "conv_uuid_1",
    "error": "",
    "segments": [
      {
        "start_sec": 120.5,
        "end_sec": 135,
        "text": "Speaker A discusses pricing and discounts."
      }
    ]
  },
  {
    "output": "Yes, this is another example of an 'Ask Attention' response",
    "conversation_id": "conv_uuid_2",
    "error": "",
    "segments": [
      {
        "start_sec": 45,
        "end_sec": 62.5,
        "text": "Speaker B asks about the integration timeline."
      }
    ]
  }
]
{
"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"
}
}
{
"id": "not_found_error",
"status": "404",
"code": "404",
"title": "Not Found Error",
"detail": "The requested resource was not found",
"source": {
"pointer": "/data/attributes/id"
}
}
Choosing between deal_id and conversations_idsAlthough both deal_id and conversations_ids appear as required in the schema, the endpoint actually requires exactly one of them per request:
  • To analyze specific conversations, set conversations_ids to a non-empty array and pass deal_id as an empty string ("").
  • To analyze every conversation associated with a deal, set deal_id to the deal UUID and omit conversations_ids (or pass it as an empty array []).
Sending both a non-empty deal_id and a non-empty conversations_ids returns a 400 error: “you must provide either a deal ID or conversation IDs, not both”. Sending neither returns an error stating that at least one is required.

Example requests

Using conversations_ids (pass deal_id as an empty string):
{
  "conversations_ids": ["conv_uuid_1", "conv_uuid_2"],
  "deal_id": "",
  "prompt": "Did the customer mention budget concerns?"
}
Using deal_id (omit or empty conversations_ids):
{
  "conversations_ids": [],
  "deal_id": "deal_uuid_123",
  "prompt": "Summarize the next steps across all calls on this deal."
}

Authorizations

Authorization
string
header
required

Query Parameters

include_timestamps
boolean

When true, return timestamped segments (start/end seconds + excerpt) for each conversation alongside the textual answer.

summarize
boolean

When true, synthesize all per-conversation outputs into a single combined response appended with conversation_id "summary".

Body

Request containing the content to be analyzed and analysis parameters

conversations_ids
string[]
required
Maximum string length: 50
deal_id
string
required
prompt
string
required

Response

Content successfully analyzed with attention points identified

output
string
required
conversation_id
string
required
error
string
required
segments
object[]

Optional timestamped segments relevant to the answer (present when include_timestamps=true).

title
string

Conversation title

Example:
[
{
"output": "Yes, this is an example of an 'Ask Attention' response",
"conversation_id": "conv_uuid_1",
"error": "",
"segments": [
{
"start_sec": 120.5,
"end_sec": 135,
"text": "Speaker A discusses pricing and discounts."
}
]
},
{
"output": "Yes, this is another example of an 'Ask Attention' response",
"conversation_id": "conv_uuid_2",
"error": "",
"segments": [
{
"start_sec": 45,
"end_sec": 62.5,
"text": "Speaker B asks about the integration timeline."
}
]
}
]