GitHub v3 REST API

List repository workflows

Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Path Parameters

ownerstringrequired
repostringrequired

Response

200 application/json

Response

total_countintegerrequired
workflowsarray[object]required

A GitHub Actions workflow

Show Child Parameters
get/repos/{owner}/{repo}/actions/workflows
 
200 application/json

Get a workflow

Gets a specific workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Response

200 application/json

Response

Workflow

A GitHub Actions workflow

idintegerrequired

Example:5

node_idstringrequired

Example:MDg6V29ya2Zsb3cxMg==

namestringrequired

Example:CI

pathstringrequired

Example:ruby.yaml

statestringrequired

Allowed values:activedeleteddisabled_forkdisabled_inactivitydisabled_manually

Example:active

created_atstring(date-time)required

Example:2019-12-06T14:20:20.000Z

updated_atstring(date-time)required

Example:2019-12-06T14:20:20.000Z

urlstringrequired

Example:https://api.github.com/repos/actions/setup-ruby/workflows/5

html_urlstringrequired

Example:https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml

badge_urlstringrequired

Example:https://github.com/actions/setup-ruby/workflows/CI/badge.svg

deleted_atstring(date-time)

Example:2019-12-06T14:20:20.000Z

get/repos/{owner}/{repo}/actions/workflows/{workflow_id}
 
200 application/json

Disable a workflow

Disables a workflow and sets the state of the workflow to disabled_manually. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

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.

put
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Response

204

Response

put/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable
 
204

Create a workflow dispatch event

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

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.”

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.”

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Body

application/json
refstringrequired

The git reference for the workflow. The reference can be a branch or tag name.

inputsobject

Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when inputs are omitted.

Response

204

Response

post/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches

Body

{ "ref": "topic-branch", "inputs": { "name": "Mona the Octocat", "home": "San Francisco, CA" } }
 
204

Enable a workflow

Enables a workflow and sets the state of the workflow to active. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

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.

put
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Response

204

Response

put/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable
 
204