GitHub Secrets API

The Secrets API from GitHub — 19 operation(s) for secrets.

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-secrets-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  version: 1.1.4
  title: GitHub Application About Secrets 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: Secrets
paths:
  /orgs/{org}/actions/secrets:
    get:
      summary: GitHub List Organization Secrets
      description: 'Lists all secrets available in an organization 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 `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Secrets
      operationId: listOrganizationSecrets
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#list-organization-secrets
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      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/organization-actions-secret'
              examples:
                default:
                  $ref: '#/components/examples/organization-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
  /orgs/{org}/actions/secrets/{secret_name}:
    get:
      summary: GitHub Get an Organization Secret
      description: 'Gets a single organization secret without revealing its encrypted value.


        The authenticated user must have collaborator access to a repository to create, update, or read secrets


        OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: getAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#get-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/organization-actions-secret'
              examples:
                default:
                  $ref: '#/components/examples/organization-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 Organization Secret
      description: 'Creates or updates an organization 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`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: createOrUpdateAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#create-or-update-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      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 organization public key](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#get-an-organization-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.
                visibility:
                  type: string
                  description: Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret.
                  enum:
                  - all
                  - private
                  - selected
                selected_repository_ids:
                  type: array
                  description: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints.
                  items:
                    type: integer
              required:
              - visibility
            examples:
              default:
                value:
                  encrypted_value: c2VjcmV0
                  key_id: 012345678912345678
                  visibility: selected
                  selected_repository_ids:
                  - 1296269
                  - 1296280
      responses:
        '201':
          description: Response when creating a secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-object'
              examples:
                default:
                  value: null
        '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 Organization Secret
      description: 'Deletes a secret in an organization 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`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: deleteAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#delete-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      responses:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/actions/secrets/{secret_name}/repositories:
    get:
      summary: GitHub List Selected Repositories for an Organization Secret
      description: 'Lists all repositories that have been selected when the `visibility`

        for repository access to a secret is set to `selected`.


        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 `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Secrets
      operationId: listSelectedRepositoriesForAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#list-selected-repositories-for-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                required:
                - total_count
                - repositories
                properties:
                  total_count:
                    type: integer
                  repositories:
                    type: array
                    items:
                      $ref: '#/components/schemas/minimal-repository'
              examples:
                default:
                  $ref: '#/components/examples/public-repository-paginated'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Set Selected Repositories for an Organization Secret
      description: 'Replaces all repositories for an organization secret when the `visibility`

        for repository access is set to `selected`. The visibility is set when you [Create

        or update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#create-or-update-an-organization-secret).


        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 `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Secrets
      operationId: setSelectedRepositoriesForAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#set-selected-repositories-for-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                selected_repository_ids:
                  type: array
                  description: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints.
                  items:
                    type: integer
              required:
              - selected_repository_ids
            examples:
              default:
                value:
                  selected_repository_ids:
                  - 64780797
      responses:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}:
    put:
      summary: GitHub Add Selected Repository to an Organization Secret
      description: 'Adds a repository to an organization secret when the `visibility` for

        repository access is set to `selected`. For more information about setting the visibility, see [Create or

        update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#create-or-update-an-organization-secret).


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


        OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: addSelectedRepositoryToAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#add-selected-repository-to-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - name: repository_id
        in: path
        required: true
        schema:
          type: integer
        example: 42
      responses:
        '204':
          description: No Content when repository was added to the selected list
        '409':
          description: Conflict when visibility type is not set to selected
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Remove Selected Repository from an Organization Secret
      description: 'Removes a repository from an organization secret when the `visibility`

        for repository access is set to `selected`. The visibility is set when you [Create

        or update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#create-or-update-an-organization-secret).


        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 `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.'
      tags:
      - Secrets
      operationId: removeSelectedRepositoryFromAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/actions/secrets#remove-selected-repository-from-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - name: repository_id
        in: path
        required: true
        schema:
          type: integer
        example: 42
      responses:
        '204':
          description: Response when repository was removed from the selected list
        '409':
          description: Conflict when visibility type not set to selected
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: actions
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/dependabot/secrets:
    get:
      summary: GitHub List Organization Secrets
      description: 'Lists all secrets available in an organization without revealing their

        encrypted values.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: listOrganizationSecrets
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#list-organization-secrets
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/page'
      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/organization-dependabot-secret'
              examples:
                default:
                  $ref: '#/components/examples/organization-dependabot-secret-paginated'
          headers:
            Link:
              $ref: '#/components/headers/link'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/dependabot/secrets/{secret_name}:
    get:
      summary: GitHub Get an Organization Secret
      description: 'Gets a single organization secret without revealing its encrypted value.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: getAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#get-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/organization-dependabot-secret'
              examples:
                default:
                  $ref: '#/components/examples/organization-dependabot-secret'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Create or Update an Organization Secret
      description: 'Creates or updates an organization 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)."


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: createOrUpdateAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#create-or-update-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      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 organization public key](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#get-an-organization-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.
                visibility:
                  type: string
                  description: Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret.
                  enum:
                  - all
                  - private
                  - selected
                selected_repository_ids:
                  type: array
                  description: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints.
                  items:
                    type: string
              required:
              - visibility
            examples:
              default:
                value:
                  encrypted_value: c2VjcmV0
                  key_id: 012345678912345678
                  visibility: selected
                  selected_repository_ids:
                  - '1296269'
                  - '1296280'
      responses:
        '201':
          description: Response when creating a secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-object'
              examples:
                default:
                  value: null
        '204':
          description: Response when updating a secret
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Delete an Organization Secret
      description: 'Deletes a secret in an organization using the secret name.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: deleteAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#delete-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      responses:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/dependabot/secrets/{secret_name}/repositories:
    get:
      summary: GitHub List Selected Repositories for an Organization Secret
      description: 'Lists all repositories that have been selected when the `visibility`

        for repository access to a secret is set to `selected`.


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: listSelectedRepositoriesForAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: object
                required:
                - total_count
                - repositories
                properties:
                  total_count:
                    type: integer
                  repositories:
                    type: array
                    items:
                      $ref: '#/components/schemas/minimal-repository'
              examples:
                default:
                  $ref: '#/components/examples/public-repository-paginated'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      summary: GitHub Set Selected Repositories for an Organization Secret
      description: 'Replaces all repositories for an organization secret when the `visibility`

        for repository access is set to `selected`. The visibility is set when you [Create

        or update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#create-or-update-an-organization-secret).


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: setSelectedRepositoriesForAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                selected_repository_ids:
                  type: array
                  description: An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints.
                  items:
                    type: integer
              required:
              - selected_repository_ids
            examples:
              default:
                value:
                  selected_repository_ids:
                  - 64780797
      responses:
        '204':
          description: Response
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}:
    put:
      summary: GitHub Add Selected Repository to an Organization Secret
      description: 'Adds a repository to an organization secret when the `visibility` for

        repository access is set to `selected`. The visibility is set when you [Create or

        update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#create-or-update-an-organization-secret).


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: addSelectedRepositoryToAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - name: repository_id
        in: path
        required: true
        schema:
          type: integer
        example: 42
      responses:
        '204':
          description: No Content when repository was added to the selected list
        '409':
          description: Conflict when visibility type is not set to selected
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: dependabot
        subcategory: secrets
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    delete:
      summary: GitHub Remove Selected Repository from an Organization Secret
      description: 'Removes a repository from an organization secret when the `visibility`

        for repository access is set to `selected`. The visibility is set when you [Create

        or update an organization secret](https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#create-or-update-an-organization-secret).


        OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.'
      tags:
      - Secrets
      operationId: removeSelectedRepositoryFromAnOrganizationSecret
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/secret-name'
      - name: repository_id
        in: path
        required: true
        schema:
          type: integer
        example: 42
      responses:
        '204':
          description: Response when repository was removed from the selected list
        '409':
          description: Conflict when visibility type not set to selected
      x-github:
        githu

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