GitHub Environments API

The Environments API from GitHub — 7 operation(s) for environments.

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/ https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

OpenAPI Specification

github-environments-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Environments API
  description: 'Use the REST API to retrieve information about GitHub Apps and GitHub App

    installations.'
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
tags:
- name: Environments
paths:
  /repos/{owner}/{repo}/environments:
    get:
      summary: GitHub List Environments
      description: 'Lists the environments for a repository.


        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.'
      tags:
      - Environments
      operationId: listEnvironments
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/deployments/environments#list-environments
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_count:
                    description: The number of environments in this repository
                    example: 5
                    type: integer
                  environments:
                    type: array
                    items:
                      $ref: '#/components/schemas/environment'
              examples:
                default:
                  $ref: '#/components/examples/environments'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: deployments
        subcategory: environments
      x-api-evangelist-certified: '2025-07-16'
      x-api-naftiko-published: '2025-07-25'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/environments/{environment_name}:
    get:
      summary: GitHub Get an Environment
      description: '**Note:** To get information about name patterns that branches must match in order to deploy to this environment, see "[Get deployment branch policy](/rest/deployments/branch-policies#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.'
      tags:
      - Environments
      operationId: getAnEnvironment
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/deployments/environments#get-an-environment
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/environment'
              examples:
                default:
                  $ref: '#/components/examples/environment'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: deployments
        subcategory: environments
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Create or Update an Environment
      description: 'Create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)."


        **Note:** To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)."


        **Note:** To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)."


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: createOrUpdateAnEnvironment
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/deployments/environments#create-or-update-an-environment
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                wait_timer:
                  $ref: '#/components/schemas/wait-timer'
                reviewers:
                  type: array
                  description: The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.
                  items:
                    type: object
                    properties:
                      type:
                        $ref: '#/components/schemas/deployment-reviewer-type'
                      id:
                        type: integer
                        description: The id of the user or team who can review the deployment
                        example: 4532992
                deployment_branch_policy:
                  $ref: '#/components/schemas/deployment-branch-policy-settings'
              additionalProperties: false
            examples:
              default:
                value:
                  wait_timer: 30
                  reviewers:
                  - type: User
                    id: 1
                  - type: Team
                    id: 1
                  deployment_branch_policy:
                    protected_branches: false
                    custom_branch_policies: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/environment'
              examples:
                default:
                  $ref: '#/components/examples/environment'
        '422':
          description: Validation error when the environment name is invalid or when `protected_branches` and `custom_branch_policies` in `deployment_branch_policy` are set to the same value
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/basic-error'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: deployments
        subcategory: environments
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete an Environment
      description: OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
      tags:
      - Environments
      operationId: deleteAnEnvironment
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/deployments/environments#delete-an-environment
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '204':
          description: Default response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: deployments
        subcategory: environments
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/environments/{environment_name}/secrets:
    get:
      summary: GitHub List Environment Secrets
      description: 'Lists all secrets available in an environment without revealing their

        encrypted values.


        Authenticated users must have collaborator access to a repository to create, update, or read secrets.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: listEnvironmentSecrets
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#list-environment-secrets
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                required:
                - total_count
                - secrets
                properties:
                  total_count:
                    type: integer
                  secrets:
                    type: array
                    items:
                      $ref: '#/components/schemas/actions-secret'
              examples:
                default:
                  $ref: '#/components/examples/actions-secret-paginated'
          headers:
            Link:
              $ref: '#/components/headers/link'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key:
    get:
      summary: GitHub Get an Environment Public Key
      description: 'Get the public key for an environment, which you need to encrypt environment

        secrets. You need to encrypt a secret before you can create or update secrets.


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


        If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: getAnEnvironmentPublicKey
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#get-an-environment-public-key
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/actions-public-key'
              examples:
                default:
                  $ref: '#/components/examples/actions-public-key'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}:
    get:
      summary: GitHub Get an Environment Secret
      description: 'Gets a single environment secret without revealing its encrypted value.


        Authenticated users must have collaborator access to a repository to create, update, or read secrets.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: getAnEnvironmentSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#get-an-environment-secret
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - $ref: '#/components/parameters/secret-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/actions-secret'
              examples:
                default:
                  $ref: '#/components/examples/actions-secret'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Create or Update an Environment Secret
      description: 'Creates or updates an environment secret with an encrypted value. Encrypt your secret using

        [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see "[Encrypting secrets for the REST API](https://docs.github.com/enterprise-server@3.9/rest/guides/encrypting-secrets-for-the-rest-api)."


        Authenticated users must have collaborator access to a repository to create, update, or read secrets.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: createOrUpdateAnEnvironmentSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#create-or-update-an-environment-secret
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - $ref: '#/components/parameters/secret-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                encrypted_value:
                  type: string
                  description: Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#get-an-environment-public-key) endpoint.
                  pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$
                key_id:
                  type: string
                  description: ID of the key you used to encrypt the secret.
              required:
              - encrypted_value
              - key_id
            examples:
              default:
                value:
                  encrypted_value: c2VjcmV0
                  key_id: 012345678912345678
      responses:
        '201':
          description: Response when creating a secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-object'
              examples:
                default:
                  value: {}
        '204':
          description: Response when updating a secret
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete an Environment Secret
      description: 'Deletes a secret in an environment using the secret name.


        Authenticated users must have collaborator access to a repository to create, update, or read secrets.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: deleteAnEnvironmentSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#delete-an-environment-secret
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - $ref: '#/components/parameters/secret-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '204':
          description: Default response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/environments/{environment_name}/variables:
    get:
      summary: GitHub List Environment Variables
      description: 'Lists all environment variables.


        Authenticated users must have collaborator access to a repository to create, update, or read variables.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: listEnvironmentVariables
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/variables#list-environment-variables
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - $ref: '#/components/parameters/variables-per-page'
      - $ref: '#/components/parameters/page'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                required:
                - total_count
                - variables
                properties:
                  total_count:
                    type: integer
                  variables:
                    type: array
                    items:
                      $ref: '#/components/schemas/actions-variable'
              examples:
                default:
                  $ref: '#/components/examples/actions-variables-paginated'
          headers:
            Link:
              $ref: '#/components/headers/link'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: variables
      x-api-evangelist-certified: '2025-07-16'
      x-api-naftiko-published: '2025-07-25'
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      summary: GitHub Create an Environment Variable
      description: 'Create an environment variable that you can reference in a GitHub Actions workflow.


        Authenticated users must have collaborator access to a repository to create, update, or read variables.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: createAnEnvironmentVariable
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/variables#create-an-environment-variable
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the variable.
                value:
                  type: string
                  description: The value of the variable.
              required:
              - name
              - value
            examples:
              default:
                value:
                  name: USERNAME
                  value: octocat
      responses:
        '201':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-object'
              examples:
                default:
                  value: {}
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: variables
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}:
    get:
      summary: GitHub Get an Environment Variable
      description: 'Gets a specific variable in an environment.


        Authenticated users must have collaborator access to a repository to create, update, or read variables.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: getAnEnvironmentVariable
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/variables#get-an-environment-variable
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/environment-name'
      - $ref: '#/components/parameters/variable-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/actions-variable'
              examples:
                default:
                  $ref: '#/components/examples/actions-variable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: variables
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      summary: GitHub Update an Environment Variable
      description: 'Updates an environment variable that you can reference in a GitHub Actions workflow.


        Authenticated users must have collaborator access to a repository to create, update, or read variables.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: updateAnEnvironmentVariable
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/variables#update-an-environment-variable
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/variable-name'
      - $ref: '#/components/parameters/environment-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the variable.
                value:
                  type: string
                  description: The value of the variable.
            examples:
              default:
                value:
                  name: USERNAME
                  value: octocat
      responses:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: variables
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete an Environment Variable
      description: 'Deletes an environment variable using the variable name.


        Authenticated users must have collaborator access to a repository to create, update, or read variables.


        OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Environments
      operationId: deleteAnEnvironmentVariable
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/variables#delete-an-environment-variable
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/variable-name'
      - $ref: '#/components/parameters/environment-name'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: variables
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  parameters:
    variable-name:
      name: name
      description: The name of the variable.
      in: path
      required: true
      schema:
        type: string
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    variables-per-page:
      name: per_page
      description: The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 10
    environment-name:
      name: environment_name
      in: path
      required: true
      description: The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with `%2F`

# --- truncated at 32 KB (656 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-environments-api-openapi.yml