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

# Recupera elemento della cronologia

GET https://api.elevenlabs.io/v1/history/{history_item_id}

Recupera un elemento della cronologia.

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

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

- `history_item_id` (string, required) — ID dell'elemento della cronologia da usare. Puoi usare l'endpoint [Get generated items](/docs/api-reference/history/list) per recuperare un elenco di elementi della cronologia.

## Response

### 200

Risposta riuscita

- `history_item_id` (string, required) — L'ID dell'elemento della cronologia.
- `date_unix` (integer, required) — Timestamp Unix di creazione dell'elemento.
- `character_count_change_from` (integer, required) — La variazione del conteggio dei caratteri di origine.
- `character_count_change_to` (integer, required) — La variazione del conteggio dei caratteri di destinazione.
- `content_type` (string, required) — Il tipo di contenuto dell'elemento generato.
- `state` (any, required)
- `request_id` (string, optional, nullable) — L'ID della richiesta.
- `voice_id` (string, optional, nullable) — L'ID della voce usata.
- `model_id` (string, optional, nullable) — L'ID del modello.
- `voice_name` (string, optional, nullable) — Il nome della voce.
- `voice_category` (enum, optional, nullable) — La categoria della voce: 'premade', 'cloned', 'generated' o 'professional'.
  - Allowed values: `premade`, `cloned`, `generated`, `professional`
- `text` (string, optional, nullable) — Il testo usato per generare l'elemento audio.
- `settings` (map from string to any, optional, nullable) — Le impostazioni dell'elemento della cronologia.
- `share_link_id` (string, optional, nullable) — L'ID del link di condivisione.
- `source` (enum, optional, nullable) — La sorgente dell'elemento della cronologia. Può essere TTS (text to speech), STS (speech to text), AN (audio native), Projects, Dubbing, PlayAPI, PD (dizionario di pronuncia) o ConvAI (piattaforma Agents).
  - Allowed values: `TTS`, `STS`, `Projects`, `PD`, `AN`, `Dubbing`, `PlayAPI`, `ConvAI`, `VoiceGeneration`, `InVPC`, `Flows`, `VoicePreview`
- `alignments` (HistoryAlignmentsResponseModel, optional, nullable) — Gli allineamenti dell'elemento della cronologia.
- `dialogue` (list of DialogueInputResponseModel, optional, nullable) — Il dialogo (coppie di voce e testo) usato per generare l'elemento audio. Se impostato, i campi di primo livello `text` e `voice_id` saranno vuoti.
- `output_format` (string, optional, nullable) — Il formato di output in cui l'audio è stato generato originariamente.

## Errors

### 422 Unprocessable Entity Error

Errore di convalida

- `detail` (list of ValidationError, optional)

## Types

### HistoryAlignmentsResponseModel

- `alignment` (HistoryAlignmentResponseModel, required) — L'allineamento del testo.
- `normalized_alignment` (HistoryAlignmentResponseModel, required) — L'allineamento normalizzato del testo.

### DialogueInputResponseModel

- `text` (string, required) — Il testo della riga di input del dialogo.
- `voice_id` (string, required) — L'ID della voce usata per questa riga di input del dialogo.
- `voice_name` (string, required) — Il nome della voce usata per questa riga di input del dialogo.

### ValidationError

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

### HistoryAlignmentResponseModel

- `characters` (list of string, required) — I caratteri nell'allineamento.
- `character_start_times_seconds` (list of double, required) — I tempi di inizio dei caratteri in secondi.
- `character_end_times_seconds` (list of double, required) — Le ore di fine dei caratteri in secondi.

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "history_item_id": "ja9xsmfGhxYcymxGcOGB",
  "date_unix": 1714650306,
  "character_count_change_from": 17189,
  "character_count_change_to": 17231,
  "content_type": "audio/mpeg",
  "state": null,
  "request_id": "BF0BZg4IwLGBlaVjv9Im",
  "voice_id": "21m00Tcm4TlvDq8ikWAM",
  "model_id": "eleven_multilingual_v2",
  "voice_name": "Rachel",
  "voice_category": "premade",
  "text": "Hello, world!",
  "settings": {
    "similarity_boost": 0.5,
    "stability": 0.71,
    "style": 0,
    "use_speaker_boost": true
  },
  "source": "TTS"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L';
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/history/VW7YKqPnjY4h39yTbx2L"

	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/history/VW7YKqPnjY4h39yTbx2L")

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/history/VW7YKqPnjY4h39yTbx2L")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L');

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/history/VW7YKqPnjY4h39yTbx2L");
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/history/VW7YKqPnjY4h39yTbx2L")! 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()
```