> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pathors.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Test Case

> Create a new test case for a project

## Request

```bash theme={null}
POST https://api.pathors.com/v1/projects/{projectId}/test-cases
```

### Path Parameters

<ParamField path="projectId" type="string" required>The project ID</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token using your developer key
</ParamField>

### Body

<ParamField body="name" type="string" required>
  Name of the test case
</ParamField>

<ParamField body="systemPrompt" type="string" required>
  The system prompt used to simulate the user in the test
</ParamField>

<ParamField body="maxTurns" type="integer" required>
  Maximum number of conversation turns (minimum 1)
</ParamField>

<ParamField body="variables" type="object">
  Key-value pairs of variables to inject into the test
</ParamField>

<ParamField body="acceptanceCriteria" type="array">
  Array of acceptance criteria descriptions (strings)
</ParamField>

## Response

Returns the created test case with status `201`.

### Example

```bash theme={null}
curl -X POST https://api.pathors.com/v1/projects/{projectId}/test-cases \
  -H "Authorization: Bearer dk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Greeting flow",
    "systemPrompt": "You are a customer asking about pricing",
    "maxTurns": 5,
    "variables": { "language": "en" },
    "acceptanceCriteria": [
      "Agent should greet the user",
      "Agent should provide pricing info"
    ]
  }'
```

```json theme={null}
{
  "data": {
    "id": "test-case-uuid",
    "projectId": "project-uuid",
    "name": "Greeting flow",
    "systemPrompt": "You are a customer asking about pricing",
    "maxTurns": 5,
    "variables": { "language": "en" },
    "acceptanceCriteria": [
      {
        "id": "criterion-uuid-1",
        "testCaseId": "test-case-uuid",
        "description": "Agent should greet the user"
      },
      {
        "id": "criterion-uuid-2",
        "testCaseId": "test-case-uuid",
        "description": "Agent should provide pricing info"
      }
    ],
    "createdAt": "2026-03-23T00:00:00.000Z",
    "updatedAt": "2026-03-23T00:00:00.000Z"
  }
}
```
