> This is a page from the ElevenLabs documentation. For an index of the documentation, fetch https://elevenlabs.io/docs/llms.txt.

# Crear ticket de conversación del agente

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

Informa de un problema sobre el rendimiento de un agente en una conversación para trabajarlo con Architect. Incluye un comentario general o comentarios por turno que describan qué ha fallado.

Reference: https://elevenlabs.io/docs/api-reference/issues/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 a CreateAgentConversationTicketRequestModel.

- `conversation_id` (string, required) — Conversación a la que se refiere este problema del agente.
- `title` (string, optional, nullable) — Título de una línea que se muestra en la lista de problemas. De forma predeterminada, se genera a partir de los comentarios y, si no es posible, se usa el título del resumen de la conversación. Se ignora cuando el comentario se añade al problema abierto de la conversación.
- `qa_comment` (string, optional, nullable) — El problema al que se refiere esta incidencia del agente, que abarca toda la conversación en lugar de un único turno.
- `turn_comments` (list of TurnCommentRequestModel, optional) — Comentarios opcionales por turno sobre lo que ha salido mal.
- `priority` (enum, optional, nullable) — Con qué urgencia requiere atención la incidencia del agente. Si la conversación ya tiene una incidencia abierta, se eleva a esta prioridad si tiene una inferior.
  - Allowed values: `low`, `medium`, `high`, `urgent`

## Response

### 200

Respuesta correcta.

- `agentqa_ticket_id` (string, required)
- `workspace_id` (string, required)
- `owner_user_id` (string, required)
- `agent_id` (string, required)
- `needs_clustering` (boolean, required)
- `title` (string, required, nullable) — Título de una línea para el problema del agente. None solo para problemas creados antes de que existieran los títulos.
- `labels` (list of string, required)
- `conversation_ids` (list of string, required)
- `first_seen_unix_secs` (integer, required, nullable)
- `last_seen_unix_secs` (integer, required, nullable)
- `qa_comment` (string, required, nullable)
- `ticket_comments` (list of TicketCommentResponseModel, required)
- `turn_comments` (list of TurnCommentResponseModel, required)
- `status` (enum, required)
  - Allowed values: `open`, `in_progress`, `resolved`, `cancelled`, `merged`
- `priority` (enum, required, nullable)
  - Allowed values: `low`, `medium`, `high`, `urgent`
- `priority_changes` (list of TicketPriorityChangeResponseModel, required)
- `status_changes` (list of TicketStatusChangeResponseModel, required)
- `source` (enum, required)
  - Allowed values: `qa`, `agent`, `manual`
- `assignee_user_id` (string, required, nullable)
- `created_at_unix_secs` (integer, required)
- `updated_at_unix_secs` (integer, required)
- `merged_into_ticket_id` (string, optional, nullable) — Problema de agente con el que se fusionó este, establecido mientras su estado es 'merged'.
- `search_match` (TicketSearchMatchResponseModel, optional, nullable) — Dónde ha coincidido la consulta `search` de la lista. Se establece solo en listas con búsqueda.
- `issue_type` (any, optional, deprecated) — Always null. Issue types are labels, written as `issue_type:<value>`.

## Errors

### 422 Unprocessable Entity Error

Error de validación

- `detail` (list of ValidationError, optional)

## Types

### TurnCommentRequestModel

- `turn_index` (integer, required) — Índice basado en cero del turno de la transcripción al que se refiere este comentario.
- `comment` (string, required) — Qué salió mal en este turno.

### TicketCommentResponseModel

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

### TurnCommentResponseModel

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

### TicketPriorityChangeResponseModel

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

### TicketStatusChangeResponseModel

- `status` (enum, required)
  - Allowed values: `open`, `in_progress`, `resolved`, `cancelled`, `merged`
- `changed_by_user_id` (string, required, nullable)
- `changed_at_unix_secs` (integer, required)

### TicketSearchMatchResponseModel

- `field` (enum, required) — Qué texto del problema del agente ha coincidido.
  - Allowed values: `title`, `description`, `comment`, `turn_comment`
- `snippet` (string, required) — Extracto alrededor de la coincidencia con los espacios en blanco reducidos, con puntos suspensivos donde se ha recortado.
- `highlight_start` (integer, required) — Desplazamiento de la coincidencia en `snippet`.
- `highlight_end` (integer, required) — Desplazamiento final exclusivo de la coincidencia en `snippet`.
- `turn_index` (integer, optional, nullable) — El turno comentado, establecido cuando `field` es 'turn_comment'.

### ValidationError

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

### ValidationErrorLocItems

- string
- integer

## Examples

**Request**

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

**Response**

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

**SDK Code**

```python
import requests

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

payload = { "conversation_id": "string" }
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":"string"}'
};

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\": \"string\"\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\": \"string\"\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\": \"string\"\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": "string"
}',
  '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\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["conversation_id": "string"] 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()
```