> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# List simulation cases by agent

GET https://api.synthflow.ai/v2/simulation_cases/by_agent

List all simulation cases created for a specific agent.

Reference: https://docs.synthflow.ai/api-reference/platform-api/simulations/list-simulation-cases-by-agent

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.synthflow.ai/v2` (Global, default)
- `https://api.us.synthflow.ai/v2` (United States)
- `https://api.eu.synthflow.ai/v2` (European Union)

## Request

### Query parameters

- `agent_id` (string, required) — Agent ID whose cases to list.

## Response

### 200

200

- `status` (string, optional) — Whether the request was successful.
- `response` (list of SimulationCaseReadOut, optional)

## Errors

### 400 Bad Request Error

400

## Types

### SimulationCaseReadOut

Simulation case details.

- `simulation_case_id` (string, optional)
- `workspace_id` (string, optional)
- `suite_id` (string, optional, nullable) — ID of the simulation suite this case belongs to.
- `name` (string, optional)
- `prompt` (string, optional)
- `type` (enum, optional)
  - Allowed values: `custom`, `agent_based`
- `success_criteria` (list of string, optional)
- `call_success_type` (enum, optional)
  - Allowed values: `all`, `any`
- `base_agent` (SimulationCaseReadOutBaseAgent, optional, nullable)
- `created_at` (datetime, optional)
- `updated_at` (datetime, optional)

### SimulationCaseReadOutBaseAgent

- `model_id` (string, optional)
- `agent_name` (string, optional)
- `agent_type` (string, optional)
- `voice_engine_type` (string, optional)
- `phone_number` (string, optional, nullable)
- `updated_at` (datetime, optional)
- `image_url` (string, optional, nullable)

## Examples

**Response**

```json
{
  "status": "ok",
  "response": [
    {
      "simulation_case_id": "string",
      "workspace_id": "string",
      "suite_id": "string",
      "name": "string",
      "prompt": "string",
      "type": "custom",
      "success_criteria": [
        "string"
      ],
      "call_success_type": "all",
      "base_agent": {
        "model_id": "string",
        "agent_name": "string",
        "agent_type": "string",
        "voice_engine_type": "string",
        "phone_number": "string",
        "updated_at": "2024-01-15T09:30:00Z",
        "image_url": "string"
      },
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.synthflow.ai/v2/simulation_cases/by_agent"

querystring = {"agent_id":"agent_id"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthflow.ai/v2/simulation_cases/by_agent?agent_id=agent_id"

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

	req.Header.Add("Authorization", "Bearer <token>")

	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.synthflow.ai/v2/simulation_cases/by_agent?agent_id=agent_id")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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.synthflow.ai/v2/simulation_cases/by_agent?agent_id=agent_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/simulation_cases/by_agent?agent_id=agent_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/simulation_cases/by_agent?agent_id=agent_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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