GitHub v3 REST API

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

List workflow runs

List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters.

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.

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

Query Parameters

actorstring

Returns someone’s workflow runs. Use the login for the user who created the push associated with the check suite or workflow run.

branchstring

Returns workflow runs associated with a branch. Use the name of the branch of the push.

eventstring

Returns workflow run triggered by the event you specify. For example, push, pull_request or issue. For more information, see “Events that trigger workflows.”

statusstring

Returns workflow runs with the check run status or conclusion that you specify. For example, a conclusion can be success or a status can be in_progress. Only GitHub can set a status of waiting or requested. For a list of the possible status and conclusion options, see “Create a check run.”

Allowed values:completedaction_requiredcancelledfailureneutralskippedstalesuccesstimed_outin_progressqueuedrequestedwaiting

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

createdstring(date-time)

Returns workflow runs created within the given date-time range. For more information on the syntax, see “Understanding the search syntax.”

exclude_pull_requestsboolean

If true pull requests are omitted from the response (empty array).

Default:false

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

total_countintegerrequired
workflow_runsarray[object]required

An invocation of a workflow

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

List public events

We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.

get
{protocol}://{hostname}/api/v3/events

Query Parameters

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Event

idstringrequired
typestring | nullrequired
actorobjectrequired

Actor

Show Child Parameters
repoobjectrequired
Show Child Parameters
orgobject

Actor

Show Child Parameters
payloadobjectrequired
Show Child Parameters
publicbooleanrequired
created_atstring | null(date-time)required
get/events
 
application/json

Get feeds

GitHub Enterprise Server provides several timeline resources in Atom format. The Feeds API lists all the feeds available to the authenticated user:

  • Timeline: The GitHub Enterprise Server global public timeline
  • User: The public timeline for any user, using URI template
  • Current user public: The public timeline for the authenticated user
  • Current user: The private timeline for the authenticated user
  • Current user actor: The private timeline for activity created by the authenticated user
  • Current user organizations: The private timeline for the organizations the authenticated user is a member of.
  • Security advisories: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub Enterprise Server.

Note: Private feeds are only returned when authenticating via Basic Auth since current feed URIs use the older, non revocable auth tokens.

get
{protocol}://{hostname}/api/v3/feeds

Response

200 application/json

Response

Feed

Feed

timeline_urlstringrequired

Example:https://github.com/timeline

user_urlstringrequired

Example:https://github.com/{user}

current_user_public_urlstring

Example:https://github.com/octocat

current_user_urlstring

Example:https://github.com/octocat.private?token=abc123

current_user_actor_urlstring

Example:https://github.com/octocat.private.actor?token=abc123

current_user_organization_urlstring

Example:https://github.com/octocat-org

current_user_organization_urlsarray[string](uri)

Example:["https://github.com/organizations/github/octocat.private.atom?token=abc123"]

_linksobjectrequired
Show Child Parameters
get/feeds
 
200 application/json