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

# Gespreksbeurt ophalen

GET https://api.elevenlabs.io/v1/convai/conversations/{conversation_id}/turns/{turn_id}

Haal de status en output van een beurt op. De status komt uit het opgeslagen transcript, dus een beurt die is mislukt nadat de agent is gestart, kan als voltooid worden weergegeven. Alleen het event `stream_ended` bevat de werkelijke uitkomst. Dit endpoint is in alpha en kan veranderen.

Reference: https://elevenlabs.io/docs/api-reference/conversations/get-turn

## 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

### Path parameters

- `conversation_id` (string, required) — De conversatie-ID
- `turn_id` (string, required) — De beurt-ID

## Response

### 200

Geslaagde response

- `turn_id` (string, required)
- `status` (enum, required)
  - Allowed values: `in_progress`, `completed`, `requires_action`, `failed`, `timed_out`
- `output` (list of TextOutputItem, optional)
- `error` (AgentOutputError, optional, nullable)
- `required_actions` (list of ClientToolCallRequiredAction, optional) — De acties waarop de agent wacht. Beantwoord elke `client_tool_call` met een `client_tool_result`-item in `input` om door te gaan.
- `stream_cursor` (string, optional, nullable) — Hervattingstoken voor de eventstream van deze beurt. Aanwezig zolang de beurt bezig is; geef dit door als Last-Event-ID om de events van de beurt te streamen.

## Errors

### 422 Unprocessable Entity Error

Validatiefout

- `detail` (list of ValidationError, optional)

## Types

### TextOutputItem

- `role` ("agent", required)
- `text` (string, required)
- `type` ("text", optional, default: text)
- `id` (string, optional, nullable)
- `created_at_unix_ms` (integer, optional, nullable)

### AgentOutputError

- `type` (string, required)
- `code` (string, required)
- `message` (string, required)

### ClientToolCallRequiredAction

- `tool_call_id` (string, required)
- `tool_name` (string, required)
- `parameters` (map from string to any, required)
- `type` ("client_tool_call", optional, default: client_tool_call)

### ValidationError

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

### ValidationErrorLocItems

- string
- integer

## Examples

**Response**

```json
{
  "turn_id": "string",
  "status": "in_progress",
  "output": [
    {
      "role": "string",
      "text": "string",
      "type": "text",
      "id": "string",
      "created_at_unix_ms": 1
    }
  ],
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  },
  "required_actions": [
    {
      "tool_call_id": "string",
      "tool_name": "string",
      "parameters": {},
      "type": "client_tool_call"
    }
  ],
  "stream_cursor": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/conversations/conversation_id/turns/turn_id"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/convai/conversations/conversation_id/turns/turn_id';
const options = {method: 'GET'};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/convai/conversations/conversation_id/turns/turn_id"

	req, _ := http.NewRequest("GET", url, nil)

	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/conversations/conversation_id/turns/turn_id")

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

request = Net::HTTP::Get.new(url)

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.get("https://api.elevenlabs.io/v1/convai/conversations/conversation_id/turns/turn_id")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/convai/conversations/conversation_id/turns/turn_id');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/convai/conversations/conversation_id/turns/turn_id");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/convai/conversations/conversation_id/turns/turn_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```