Sample - GitHub REST API
GET/repos/{owner}/{repo}/environments/{environment_name}

Get an environment

[!NOTE] To get information about name patterns that branches must match in order to deploy to this environment, see "Get a deployment branch policy."

Anyone with read access to the repository can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.

  • 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.
environment_namestringrequired
The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with `%2F`.

1 status code
200Response
idintegerrequired
The id of the environment.
node_idstringrequired
namestringrequired
The name of the environment.
urlstringrequired
html_urlstringrequired
created_atstringrequired
The time that the environment was created, in ISO 8601 format.
updated_atstringrequired
The time that the environment was last updated, in ISO 8601 format.
protection_rulesarray<object>optional
Built-in deployment protection rules for the environment.
deployment_branch_policyobjectoptional
The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.