Sample - GitHub REST API
POST/repos/{owner}/{repo}/actions/runs/{run_id}/cancel

Cancel a workflow run

Cancels a workflow run using its id.

OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
run_idintegerrequired
The unique identifier of the workflow run.

2 status codes
202Response
409Conflict
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 409 is returned: Conflict.