> 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/convai/environments

'production'을 포함한 워크스페이스 환경 목록을 표시합니다.

Reference: https://elevenlabs.io/docs/eleven-agents/api-reference/environments/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)

## Response

### 200

성공 응답

- `environments` (list of EnvironmentResponse, required) — 모든 워크스페이스 환경이며, 'production'이 먼저 표시됩니다. 환경에 값이 없는 변수는 production 값을 사용합니다.

## Errors

### 422 Environments List Request Unprocessable Entity Error

유효성 검사 오류

- `detail` (list of ValidationError, optional)

## Types

### EnvironmentResponse

- `name` (string, required) — 환경의 이름입니다. 예: 'staging'.
- `updated_at_unix_secs` (integer, optional) — 환경이 생성되었거나 해당 값 중 하나가 마지막으로 변경된 시간입니다. 둘 다 알 수 없는 경우에는 설정되지 않습니다.
- `created_by_user_id` (string, optional) — 'production' 및 생성자를 알 수 없는 경우에는 설정되지 않습니다.

### ValidationError

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

### ValidationErrorLocItem

## Examples

**Response**

```json
{
  "environments": [
    {
      "name": "production",
      "updated_at_unix_secs": 1714000000,
      "created_by_user_id": "created_by_user_id"
    },
    {
      "name": "staging",
      "updated_at_unix_secs": 1714003600,
      "created_by_user_id": "user_7k2m9x"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/convai/environments"

response = requests.get(url)

print(response.json())
```

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

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

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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