---
title: "Cancel a pending or in-progress prompt optimization job."
method: POST
path: "/api/v2/projects/{project_id}/prompt-optimization-jobs/{job_id}/cancel"
tags: ["Prompt Optimization"]
---

# Cancel a pending or in-progress prompt optimization job.

`POST /api/v2/projects/{project_id}/prompt-optimization-jobs/{job_id}/cancel`

## Request

- Base URL: `https://app.freeplay.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.freeplay.ai/api/v2/projects/{project_id}/prompt-optimization-jobs/{job_id}/cancel`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/freeplay/apis/freeplay-api/docs/api/v2/projects/:project_id/prompt-optimization-jobs/:job_id/cancel/post.ts> (a function with typed inputs; its response is checked against the schema)

Only jobs that have not yet completed can be cancelled.

## Path parameters

- `project_id` string, required
- `job_id` string, required

## Response `200`

EmptyResponse()

- object

---

[API](https://skmtc.dev/freeplay/apis/freeplay-api.md) - [All operations](https://skmtc.dev/freeplay/apis/freeplay-api/llms.txt) - [OpenAPI document](https://skmtc.dev/freeplay/apis/freeplay-api/revisions/69c553220183?raw)
