Create a workflow dispatch event

POST {{baseUrl}}/repos/:owner/:repo/actions/workflows/:workflow_id/dispatches

You can use this endpoint to manually trigger a GitHub Actions workflow run. You can also replace {workflow_id} with the workflow file name. For example, you could use main.yml.

You must configure your GitHub Actions workflow to run when the workflow_dispatch webhook event occurs. The inputs are configured in the workflow file. For more information about how to configure the workflow_dispatch event in the workflow file, see [Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch).

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. For more information, see [Creating a personal access token for the command line](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line).

Request Body

{"ref"=>"<string>", "inputs"=>"<object>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring