> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Crea ticket di conversazione dell'agente

POST https://api.elevenlabs.io/v1/convai/triage-tickets
Content-Type: application/json

Apri un ticket sulle prestazioni di un agente in una conversazione, per il triage con Architect. Fornisci un commento generale e/o commenti a livello di turno che descrivano cosa non ha funzionato.

Reference: https://elevenlabs.io/docs/eleven-agents/api-reference/triage-tickets/create

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Body (application/json)

This endpoint expects an object.

- `conversation_id` (string, required) — Conversazione a cui si riferisce questo ticket.
- `title` (string, optional) — Titolo di una riga visualizzato nell'elenco di triage. Per impostazione predefinita, viene ricavato dai commenti oppure, in alternativa, dal titolo riepilogativo della conversazione. Ignorato quando il commento viene aggiunto al ticket aperto della conversazione.
- `qa_comment` (string, optional) — Il problema a cui si riferisce questo ticket, relativo all'intera conversazione anziché a un singolo turno.
- `turn_comments` (list of TurnCommentRequestModel, optional) — Commenti facoltativi a livello di turno su cosa non ha funzionato.
- `priority` (enum, optional) — Quanto urgentemente il ticket richiede attenzione. Se la conversazione ha già un ticket aperto, la sua priorità viene elevata a questo livello se inferiore.
  - Allowed values: `low`, `medium`, `high`, `urgent`

## Response

### 200

Risposta riuscita

- `agentqa_ticket_id` (string, required)
- `workspace_id` (string, required)
- `owner_user_id` (string, required)
- `agent_id` (string, required)
- `needs_clustering` (boolean, required)
- `labels` (list of string, required)
- `conversation_ids` (list of string, required)
- `ticket_comments` (list of TicketCommentResponseModel, required)
- `turn_comments` (list of TurnCommentResponseModel, required)
- `status` (enum, required)
  - Allowed values: `open`, `in_progress`, `resolved`, `cancelled`, `merged`
- `priority_changes` (list of TicketPriorityChangeResponseModel, required)
- `source` (enum, required)
  - Allowed values: `qa`, `agent`, `manual`
- `created_at_unix_secs` (integer, required)
- `updated_at_unix_secs` (integer, required)
- `title` (string, optional) — Titolo di una riga per il ticket. None è previsto solo per i ticket creati prima dell'introduzione dei titoli.
- `issue_type` (enum, optional)
  - Allowed values: `knowledge_gap`, `incorrect_information`, `documentation_gap`, `product_feedback`, `platform_bug`, `tool_issue`, `missing_tool`, `unnecessary_escalation`, `wrong_action`
- `first_seen_unix_secs` (integer, optional)
- `last_seen_unix_secs` (integer, optional)
- `qa_comment` (string, optional)
- `priority` (enum, optional)
  - Allowed values: `low`, `medium`, `high`, `urgent`
- `merged_into_ticket_id` (string, optional) — Il ticket in cui è stato unito questo ticket, impostato quando il suo stato è 'merged'.
- `assignee_user_id` (string, optional)
- `search_match` (TicketSearchMatchResponseModel, optional) — Indica dove ha trovato corrispondenza la query `search` dell'elenco. Impostato solo negli elenchi sottoposti a ricerca.

## Errors

### 422 Triage Tickets Create Request Unprocessable Entity Error

Errore di convalida

- `detail` (list of ValidationError, optional)

## Types

### TurnCommentRequestModel

- `turn_index` (integer, required) — Indice con base zero del turno della trascrizione a cui si riferisce questo commento.
- `comment` (string, required) — Cosa non ha funzionato in questo turno.

### TicketCommentResponseModel

- `comment` (string, required)
- `created_at_unix_secs` (integer, required)
- `owner_user_id` (string, optional)

### TurnCommentResponseModel

- `turn_index` (integer, required)
- `comment` (string, required)
- `created_at_unix_secs` (integer, required)
- `owner_user_id` (string, optional)

### TicketPriorityChangeResponseModel

- `changed_by_user_id` (string, required)
- `changed_at_unix_secs` (integer, required)
- `priority` (enum, optional)
  - Allowed values: `low`, `medium`, `high`, `urgent`

### TicketSearchMatchResponseModel

- `field` (enum, required) — Quale dei testi del ticket ha trovato una corrispondenza.
  - Allowed values: `title`, `description`, `comment`, `turn_comment`
- `snippet` (string, required) — Estratto attorno alla corrispondenza con gli spazi compressi, con puntini di sospensione nel punto in cui è stato troncato.
- `highlight_start` (integer, required) — Offset della corrispondenza in `snippet`.
- `highlight_end` (integer, required) — Offset finale esclusivo della corrispondenza in `snippet`.
- `turn_index` (integer, optional) — Il turno commentato, impostato quando `field` è 'turn_comment'.

### ValidationError

- `loc` (list of ValidationErrorLocItem, required)
- `msg` (string, required)
- `type` (string, required)

### ValidationErrorLocItem

## Examples

**Request**

```json
{
  "conversation_id": "conversation_id"
}
```

**Response**

```json
{
  "agentqa_ticket_id": "agentqa_ticket_id",
  "workspace_id": "workspace_id",
  "owner_user_id": "owner_user_id",
  "agent_id": "agent_id",
  "needs_clustering": true,
  "labels": [
    "labels"
  ],
  "conversation_ids": [
    "conversation_ids"
  ],
  "ticket_comments": [
    {
      "comment": "comment",
      "created_at_unix_secs": 1,
      "owner_user_id": "owner_user_id"
    }
  ],
  "turn_comments": [
    {
      "turn_index": 1,
      "comment": "comment",
      "created_at_unix_secs": 1,
      "owner_user_id": "owner_user_id"
    }
  ],
  "status": "open",
  "priority_changes": [
    {
      "changed_by_user_id": "changed_by_user_id",
      "changed_at_unix_secs": 1,
      "priority": "low"
    }
  ],
  "source": "qa",
  "created_at_unix_secs": 1,
  "updated_at_unix_secs": 1,
  "title": "title",
  "issue_type": "knowledge_gap",
  "first_seen_unix_secs": 1,
  "last_seen_unix_secs": 1,
  "qa_comment": "qa_comment",
  "priority": "low",
  "merged_into_ticket_id": "merged_into_ticket_id",
  "assignee_user_id": "assignee_user_id",
  "search_match": {
    "field": "title",
    "snippet": "snippet",
    "highlight_start": 1,
    "highlight_end": 1,
    "turn_index": 1
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/triage-tickets"

payload = { "conversation_id": "conversation_id" }
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/triage-tickets';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"conversation_id":"conversation_id"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.elevenlabs.io/v1/convai/triage-tickets"

	payload := strings.NewReader("{\n  \"conversation_id\": \"conversation_id\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/convai/triage-tickets")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"conversation_id\": \"conversation_id\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.elevenlabs.io/v1/convai/triage-tickets")
  .header("Content-Type", "application/json")
  .body("{\n  \"conversation_id\": \"conversation_id\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.elevenlabs.io/v1/convai/triage-tickets', [
  'body' => '{
  "conversation_id": "conversation_id"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/triage-tickets");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"conversation_id\": \"conversation_id\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["conversation_id": "conversation_id"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/triage-tickets")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```