# workflow_dispatch returns 200 with a body instead of 204

- **Provider:** GitHub
- **Endpoint:** `POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches`
- **Effective:** 2025-12-19
- **Severity:** critical
- **Change:** status-code
- **Status:** verified
- **Automatic fix:** `status-code-accept-set`

## What changed

POST .../actions/workflows/{workflow_id}/dispatches started answering 200 OK with a JSON body (workflow run id) instead of 204 No Content. The OpenAPI schema and docs still said 204, and there was no changelog, version, or preview header. Clients that require exactly 204 treat a successful dispatch as a failure. GitHub later (2026-02-19) documented 200 as the response when return_run_details is set, and GitHub CLI v2.87.0+ sets it by default.

## What to do

Treat both 200 and 204 as success (any 2xx). If you want the run id, send return_run_details: true and read it from the 200 body.

## Sources

- https://stategraph.com/blog/github-broke-the-contract
- https://github.blog/changelog/2026-02-19-workflow-dispatch-api-now-returns-run-ids

## Machine-readable

- Advisory: https://github.com/SriVarshini09/shapi-advisories/blob/main/advisories/github-workflow-dispatch-204-to-200.json
- OSV: https://shapi.dev/osv/github-workflow-dispatch-204-to-200.json
