---
docId: doc_298f1a9689424c6fb3e9c1f5da010ebb
title: Cancel a launch
description: Stop an agent's launch. Trials that have not started no longer run, finished ones are kept and cancelled ones do not count in the result.
api:
  group: agentes/evals/corridas
  auth: bearer
  operations:
    - operationId: cancelEvalRun
      method: POST
      path: '/v1/agents/{agentId}/evals/runs/{launchId}/cancel'
      postmanName: Cancel a launch
---

<script>
  import { Ways } from '$lib/components';
</script>

# Cancel a launch

Stop the [tests](/api-reference/evals) in a launch by sending its `launchId`. Pending trials do not start; running trials finish their turn. Completed results are preserved and cancelled trials do not count in the result.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X POST "https://api.platic.ai/v1/agents/$AGENT_ID/evals/runs/$LAUNCH_ID/cancel" \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.agents.evals.runs.cancel("agent_123", "launch_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `agentId` | string | Agent ID | ✓ |
| `launchId` | string | The launch you cancel | ✓ |

The request has no body.

## Response

`202`: the cancellation was requested.

```json
{
  "status": "success",
  "data": { "launchId": "lch_2c9f41", "status": "cancelling" }
}
```

## Response fields

| Field | Description |
|-------|-------------|
| `launchId` | The launch. |
| `status` | `cancelling`: the cancellation is in progress. |

## Errors

| Status | `details.code` | When |
|--------|----------------|------|
| `404` | `AGENT_NOT_FOUND` | The agent does not exist or belongs to another workspace. |
| `404` | `EVAL_NOT_FOUND` | The launch does not exist or belongs to another agent. |
| `409` | `EVAL_CONFLICT` | The launch already finished (`completed` or `cancelled`): there is nothing to cancel. `details.status` says how it ended. |

## Notes

- You see the final state when you [get the launch](/api-reference/evals/runs/get).
- It requires permission to edit the agent.
