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

# टेम्पलेट रन की सूची दें

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

इस API के ज़रिए बनाए गए इस टेम्पलेट के रन की सूची दिखाता है, जिसमें सबसे नए रन पहले होते हैं।

Reference: https://elevenlabs.io/docs/api-reference/flows/templates/runs/list

## 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) — टेम्प्लेट की ID, जैसा ElevenLabs ऐप में या `GET /v1/flows/templates` द्वारा दिखाया गया है।

### Query parameters

- `cursor` (string, optional, nullable) — Pagination cursor: पिछले page के response का `next_cursor` मान। पहले page के लिए इसे छोड़ दें।
- `page_size` (integer, optional, default: 30) — हर पेज पर कितने रन लौटाने हैं।
- `version_id` (string, optional, nullable) — केवल इस template version id के runs लौटाएं।

## Response

### 200

सफल रिस्पॉन्स

- `runs` (list of TemplateRunResponse, required) — इस पेज के रन, सबसे नए पहले। हर आइटम का फ़ॉर्मैट `GET /v1/flows/templates/{template_id}/runs/{run_id}` जैसा ही है।
- `next_cursor` (string, required, nullable) — अगला page पाने के लिए `cursor` के रूप में पास करें। आगे कोई page न होने पर `null`।
- `has_more` (boolean, required) — क्या इस पेज के बाद और runs मौजूद हैं।

## Errors

### 422 Unprocessable Entity Error

वैलिडेशन एरर

- `detail` (list of ValidationError, optional)

## Types

### TemplateRunResponse

एक टेम्पलेट रन और उसके आउटपुट। हर आउटपुट रन बनाए जाने के क्षण से मौजूद होता है और अपना `status` बताता है; रन का `status` इन्हें समेकित करता है, और रन `completed` या `failed` होने पर समाप्त होता है।

- `id` (string, required) — रन का यूनीक आइडेंटिफ़ायर।
- `template_id` (string, required) — वह टेम्पलेट जिसे इस रन ने चलाया, ताकि कई टेम्पलेट चलाने वाला वेबहुक कंज़्यूमर रन-टू-टेम्पलेट मैप रखे बिना उनके रनों में अंतर कर सके।
- `version_id` (string, required) — वह टेम्पलेट वर्ज़न जिसे इस रन ने चलाया। रन बनते समय इसका समाधान हो जाता है, इसलिए `latest` से शुरू किया गया रन उस वास्तविक वर्ज़न को रिकॉर्ड करता है जो उसने चलाया।
- `status` (enum, required) — रन का स्टेटस, जो उसके आउटपुट्स से समेकित होता है: आउटपुट शुरू होने तक `pending`, कोई आउटपुट अधूरा होने तक `generating`, सभी आउटपुट पूरे होने पर `completed`, और सभी आउटपुट समाप्त होने व कम से कम एक के विफल होने पर `failed`। `completed` और `failed` अंतिम स्टेटस हैं: रन के इनमें से किसी एक तक पहुंचने पर `flows_template_run` वेबहुक ट्रिगर होता है।
  - Allowed values: `pending`, `generating`, `completed`, `failed`
- `outputs` (map from string to TemplateOutput, required) — The run's outputs, keyed by output port id. Each is a `TemplateOutput` discriminated on `type`, the `type` of its port's `content_schema`.

### ValidationError

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

### TemplateOutput

template run का एक output, `type` के आधार पर अलग किया गया: port के `content_schema` का `type`। इसके lifecycle में इसकी स्थिति जानने के लिए `status` देखें।

- `type`: `array` (TemplateArrayOutput)
  - `has_more` (boolean, required) — क्या सूची में `content` के अलावा और elements हैं।
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content` (list of TemplateOutput, optional, nullable) — सूची के शुरुआती एलिमेंट, क्रम में; हर एक schema के `items` के आकार का पालन करता है। केवल तब मौजूद होता है, जब `status` `completed` हो। `has_more` true होने पर यह पूरी सूची नहीं है। आरक्षित: अभी कोई टेम्प्लेट इस प्रकार का आउटपुट नहीं बनाता; इसे प्रकाशित किया गया है ताकि ऐसा करने वाले टेम्प्लेट एक ही क्लाइंट के साथ चलाए जा सकें।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
  - `next_cursor` (string, optional, nullable) — `content` के बाद के elements पाने के लिए बाद के endpoint में `cursor` के रूप में पास करें। जब `content` में पूरी सूची हो या output पूरा होने से पहले, तो `null`। आरक्षित: अभी कोई template ऐसा output नहीं बनाता; इसे इसलिए प्रकाशित किया गया है ताकि भविष्य में ऐसे templates को उसी client के साथ चलाया जा सके।
- `type`: `audio` (TemplateAudioOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content_mime_type` (string, optional, nullable) — जनरेट किए गए मीडिया का MIME प्रकार। केवल `status` के `completed` होने पर मौजूद होता है।
  - `content_url` (string, optional, nullable) — जनरेट किया गया मीडिया डाउनलोड करने के लिए एक साइन किया हुआ URL। यह केवल तब मौजूद होता है जब `status`, `completed` हो। यह जवाब लौटने के लगभग एक घंटे बाद समाप्त हो जाता है; नया URL पाने के लिए रन को फिर से फ़ेच करें।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
- `type`: `boolean` (TemplateBooleanOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content` (boolean, optional, nullable) — जनरेट किया गया boolean। केवल तब मौजूद होता है, जब `status` `completed` हो। आरक्षित: अभी कोई टेम्प्लेट इस प्रकार का आउटपुट नहीं बनाता; इसे प्रकाशित किया गया है ताकि ऐसा करने वाले टेम्प्लेट एक ही क्लाइंट के साथ चलाए जा सकें।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
- `type`: `image` (TemplateImageOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content_mime_type` (string, optional, nullable) — जनरेट किए गए मीडिया का MIME प्रकार। केवल `status` के `completed` होने पर मौजूद होता है।
  - `content_url` (string, optional, nullable) — जनरेट किया गया मीडिया डाउनलोड करने के लिए एक साइन किया हुआ URL। यह केवल तब मौजूद होता है जब `status`, `completed` हो। यह जवाब लौटने के लगभग एक घंटे बाद समाप्त हो जाता है; नया URL पाने के लिए रन को फिर से फ़ेच करें।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
- `type`: `integer` (TemplateIntegerOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content` (integer, optional, nullable) — जनरेट किया गया integer। केवल तब मौजूद होता है, जब `status` `completed` हो। आरक्षित: अभी कोई टेम्प्लेट इस प्रकार का आउटपुट नहीं बनाता; इसे प्रकाशित किया गया है ताकि ऐसा करने वाले टेम्प्लेट एक ही क्लाइंट के साथ चलाए जा सकें।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
- `type`: `number` (TemplateNumberOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content` (double, optional, nullable) — जनरेट किया गया number। केवल तब मौजूद होता है, जब `status` `completed` हो। आरक्षित: अभी कोई टेम्प्लेट इस प्रकार का आउटपुट नहीं बनाता; इसे प्रकाशित किया गया है ताकि ऐसा करने वाले टेम्प्लेट एक ही क्लाइंट के साथ चलाए जा सकें।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
- `type`: `object` (TemplateObjectOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content` (map from string to TemplateOutput, optional, nullable) — हर field के लिए एक output, field name के आधार पर key किया गया, और हर output उस field के schema के स्वरूप का अनुसरण करता है। केवल `status` के `completed` होने पर मौजूद होता है। आरक्षित: अभी कोई template इस तरह का output नहीं बनाता; इसे प्रकाशित किया गया है ताकि ऐसा करने वाले templates को उसी client से चलाया जा सके।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
- `type`: `string` (TemplateStringOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content` (string, optional, nullable) — जनरेट किया गया टेक्स्ट। केवल तब मौजूद होता है, जब `status` `completed` हो।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`
- `type`: `video` (TemplateVideoOutput)
  - `id` (string, required) — इस आउटपुट के पीछे की जनरेशन की id। आउटपुट को कहीं और इनपुट के रूप में इस्तेमाल करने के लिए इसे `generation` रेफ़रेंस के रूप में पास करें।
  - `status` (enum, required) — आउटपुट की लाइफ़साइकल स्थिति। जब आउटपुट के कॉन्टेंट फ़ील्ड सेट होते हैं, तब यह `completed` पर समाप्त होती है; या जब `failure_reason` और `error_message` सेट होते हैं, तब `failed` पर।
    - Allowed values: `pending`, `generating`, `completed`, `failed`
  - `content_mime_type` (string, optional, nullable) — जनरेट किए गए मीडिया का MIME प्रकार। केवल `status` के `completed` होने पर मौजूद होता है।
  - `content_url` (string, optional, nullable) — जनरेट किया गया मीडिया डाउनलोड करने के लिए एक साइन किया हुआ URL। यह केवल तब मौजूद होता है जब `status`, `completed` हो। यह जवाब लौटने के लगभग एक घंटे बाद समाप्त हो जाता है; नया URL पाने के लिए रन को फिर से फ़ेच करें।
  - `error_message` (string, optional, nullable) — विफलता का इंसानों के पढ़ने योग्य विवरण। केवल तब मौजूद होता है जब `status` `failed` हो। विफल जनरेशन के लिए शुल्क नहीं लिया जाता।
  - `failure_reason` (enum, optional, nullable) — विफलता की कैटेगरी। यह केवल तब मौजूद होती है जब `status`, `failed` हो।
    - Allowed values: `timeout`, `model_error`, `moderated`, `invalid_parameters`, `dependency_failed`, `charging_failed`, `internal_error`

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "runs": [
    {
      "id": "sess_JWr5N6X9ZTqf8jD2LmQb",
      "template_id": "tmpl_abc123",
      "version_id": "ver_01hxyz",
      "status": "generating",
      "outputs": {
        "marketing_title": {
          "type": "string",
          "id": "Kx2mP7Y4WVrg9kE3NnRc",
          "status": "completed",
          "content": "Ride the wave."
        },
        "product_demo": {
          "type": "video",
          "id": "QWr5N6X9ZTqf8jD2La3B",
          "status": "generating"
        },
        "product_still": {
          "type": "image",
          "id": "JWr5N6X9ZTqf8jD2LmQb",
          "status": "completed",
          "content_mime_type": "image/png",
          "content_url": "https://storage.googleapis.com/generations/JWr5N6X9ZTqf8jD2LmQb"
        }
      }
    }
  ],
  "next_cursor": "MjAyNi0wNy0xN1QxMjowMDowMHxLeDJtUDdZNFdWcmc5a0UzTm5SYw",
  "has_more": true
}
```

**SDK Code**

```python
import requests

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

response = requests.get(url)

print(response.json())
```

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

	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/runs")

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/runs")
  .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/runs');

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

```csharp
using RestSharp;

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