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

# Vorlage abrufen

GET https://api.elevenlabs.io/v1/flows/templates/{template_id}

Ein Flows-Template zusammen mit den Eingaben und Ausgaben jeder ausführbaren Version abrufen. `versions` ist leer, wenn keine veröffentlichte Version über diese API ausführbar ist. Funktioniert für jedes Template, das Sie öffnen können, einschließlich Templates, die per Link mit Ihnen geteilt oder aus einem anderen Workspace in Explore veröffentlicht wurden und die `GET /v1/flows/templates` nicht auflistet.

Reference: https://elevenlabs.io/docs/api-reference/flows/templates/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

- `template_id` (string, required) — Die ID der Vorlage, wie sie in der ElevenLabs-App oder über `GET /v1/flows/templates` angezeigt wird.

### Query parameters

- `versions_per_template` (integer, optional, default: 10) — Wie viele veröffentlichte Versionen jeder Vorlage zurückgegeben werden sollen, neueste zuerst. `has_more_versions` zeigt an, wenn eine Vorlage weitere Versionen hat.

## Response

### 200

Erfolgreiche Antwort

- `id` (string, required) — Als `template_id` bei `POST /v1/flows/templates/{template_id}/runs` übergeben.
- `name` (string, required) — Der Name des Templates.
- `versions` (list of TemplateVersion, required) — Die veröffentlichten Versionen, die dieser Aufrufer ausführen kann, neueste zuerst. Eine Version, deren Graph ein Modell verwendet, das Ihnen über die API nicht zur Verfügung steht, wird ausgelassen. Dasselbe gilt für eine Version, deren gespeicherter Snapshot nicht mehr vorhanden ist. Die Liste kann daher leer sein, obwohl die Vorlage weiterhin Versionen enthält, die die ElevenLabs-App ausführen kann.
- `has_more_versions` (boolean, required) — Ob diese Vorlage über die hier zurückgegebenen `versions_per_template` hinaus weitere veröffentlichte Versionen hat. Rufen Sie `GET /v1/flows/templates/{template_id}` mit einem größeren `versions_per_template` ab, um weitere anzuzeigen.
- `description` (string, optional, nullable) — Die Beschreibung des Templates, falls vorhanden.

## Errors

### 422 Unprocessable Entity Error

Validierungsfehler

- `detail` (list of ValidationError, optional)

## Types

### TemplateVersion

Ein veröffentlichtes Snapshot einer Vorlage und die Ports, mit denen sie ausgeführt wird.

- `version_id` (string, required) — Als `version_id` bei `POST /v1/flows/templates/{template_id}/runs` übergeben, um einen Durchlauf an diesen Snapshot zu binden.
- `published_at_unix` (integer, required) — Zeitpunkt der Veröffentlichung dieser Version als Unix-Zeitstempel in Sekunden.
- `is_latest` (boolean, required) — Ob dies die Version ist, die ein Durchlauf erhält, wenn `version_id` ausgelassen oder auf `latest` gesetzt wird.
- `inputs` (list of TemplatePort, required) — Die Eingaben, die diese Version in Canvas-Reihenfolge akzeptiert. Jede Eingabe ist für einen Durchlauf erforderlich.
- `outputs` (list of TemplatePort, required) — Die Ausgaben, die diese Version erzeugt, in Canvas-Reihenfolge.

### ValidationError

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

### TemplatePort

Ein Eingabe- oder Ausgabeport einer veröffentlichten Vorlagenversion.

- `id` (string, required) — Die Port-ID. Eingabe-IDs sind die Schlüssel der `inputs`-Map in `POST /v1/flows/templates/{template_id}/runs`; Ausgabe-IDs sind die Schlüssel der `outputs`-Map in der Run-Antwort.
- `content_schema` (ContentSchema, required) — Was dieser Port als `ContentSchema` akzeptiert oder erzeugt. Sein `title` ist der Anzeigename des Ports und seine `description` der vom Vorlagenautor verfasste Hilfetext. Bei einer Eingabe legt ihr `type` fest, welcher Wert akzeptiert wird: `string` akzeptiert eine einfache Zeichenfolge oder eine `generation`-Referenz, `voice` eine `voice`-Referenz und `image`/`video`/`audio` eine `asset`-, `generation`- oder `inline_base64`-Referenz. `number`, `integer` und `boolean` akzeptieren einen JSON-Wert dieses Typs. Eine `array`-Eingabe akzeptiert ein JSON-Array mit einem Wert pro Element, wobei jeder für ihre `items` zulässig ist. `object`-Eingaben können über diese API noch nicht gebunden werden. Ein `string`-Schema kann ein `enum` mit den einzig zulässigen Werten enthalten. Bei einer Ausgabe legt ihr `type` fest, welche `Template<Kind>Output`-Form die Ausführungsantwort unter der Port-ID enthält.

### ValidationErrorLocItems

### ContentSchema

- `type`: `array` (ArraySchema)
  - `items` (ContentSchema, required)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `audio` (AudioSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `boolean` (BooleanSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `image` (ImageSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `integer` (IntegerSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `number` (NumberSchema)
  - `description` (string, optional, nullable)
  - `enum` (list of double, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `object` (ObjectSchema)
  - `description` (string, optional, nullable)
  - `properties` (map from string to ContentSchema, optional)
  - `required` (list of string, optional)
  - `title` (string, optional, nullable)
- `type`: `string` (StringSchema)
  - `description` (string, optional, nullable)
  - `enum` (list of string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `video` (VideoSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)
- `type`: `voice` (VoiceSchema)
  - `description` (string, optional, nullable)
  - `title` (string, optional, nullable)

## Examples

**Response**

```json
{
  "id": "tmpl_abc123",
  "name": "Product shot",
  "versions": [
    {
      "version_id": "ver_01hxyz",
      "published_at_unix": 1,
      "is_latest": true,
      "inputs": [
        {
          "id": "prompt",
          "content_schema": {
            "type": "string",
            "description": "string",
            "enum": [
              "string"
            ],
            "title": "string"
          }
        }
      ],
      "outputs": [
        {
          "id": "prompt",
          "content_schema": {
            "type": "string",
            "description": "string",
            "enum": [
              "string"
            ],
            "title": "string"
          }
        }
      ]
    }
  ],
  "has_more_versions": true,
  "description": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/flows/templates/template_id"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/flows/templates/template_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/flows/templates/template_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/flows/templates/template_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/flows/templates/template_id")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/flows/templates/template_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/flows/templates/template_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()
```