Use the REST API to manage Dependabot secrets for an organization or repository.
You can create, update, delete, and retrieve information about encrypted secrets using the REST API. Secrets allow you to store sensitive information, such as access tokens, in your repository, repository environments, or organization. For more information, see Configuring access to private registries for Dependabot.
These endpoints are available for authenticated users, OAuth apps, and GitHub Apps. Access tokens require repo scope for private repositories and public_repo scope for public repositories. GitHub Apps must have the dependabot_secrets permission to use these endpoints. Authenticated users must have collaborator access to a repository to create, update, or read secrets.
Note
Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.
GET /orgs/{org}/dependabot/secrets
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/dependabot/secrets
Response schema (Status: 200):
total_count: required, integersecrets: required, array of Dependabot Secret for an Organization:
name: required, stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timevisibility: required, string, enum: all, private, selectedselected_repositories_url: string, format: uriGET /orgs/{org}/dependabot/secrets/public-key
Gets your public key, which you need to encrypt secrets. You need to
encrypt a secret before you can create or update secrets.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/dependabot/secrets/public-key
Response schema (Status: 200):
key_id: required, stringkey: required, stringGET /orgs/{org}/dependabot/secrets/{secret_name}
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME
Response schema (Status: 200):
name: required, stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timevisibility: required, string, enum: all, private, selectedselected_repositories_url: string, format: uriPUT /orgs/{org}/dependabot/secrets/{secret_name}
Creates or updates an organization secret with an encrypted value. Encrypt your secret using
LibSodium. For more information, see "Encrypting secrets for the REST API."
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
encrypted_value (string)
Value for your secret, encrypted with LibSodium using the public key retrieved from the Get an organization public key endpoint.
key_id (string)
ID of the key you used to encrypt the secret.
visibility (string) (required)
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.
Can be one of: all, private, selected
selected_repository_ids (array of integers)
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, Set selected repositories for an organization secret, and Remove selected repository from an organization secret endpoints.
201 - Response when creating a secret
204 - Response when updating a secret
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME \
-d '{
"encrypted_value": "c2VjcmV0",
"key_id": "012345678912345678",
"visibility": "selected",
"selected_repository_ids": [
1296269,
1296280
]
}'
Response schema (Status: 201):
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME \
-d '{
"encrypted_value": "c2VjcmV0",
"key_id": "012345678912345678",
"visibility": "selected",
"selected_repository_ids": [
1296269,
1296280
]
}'
Response schema (Status: 204):
DELETE /orgs/{org}/dependabot/secrets/{secret_name}
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME
Response schema (Status: 204):
GET /orgs/{org}/dependabot/secrets/{secret_name}/repositories
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.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
Request:
curl -L \
-X GET \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME/repositories
Response schema (Status: 200):
total_count: required, integerrepositories: required, array of Minimal Repository:
id: required, integer, format: int64node_id: required, stringname: required, stringfull_name: required, stringowner: required, Simple User:
name: string or nullemail: string or nulllogin: required, stringid: required, integer, format: int64node_id: required, stringavatar_url: required, string, format: urigravatar_id: required, string or nullurl: required, string, format: urihtml_url: required, string, format: urifollowers_url: required, string, format: urifollowing_url: required, stringgists_url: required, stringstarred_url: required, stringsubscriptions_url: required, string, format: uriorganizations_url: required, string, format: urirepos_url: required, string, format: urievents_url: required, stringreceived_events_url: required, string, format: uritype: required, stringsite_admin: required, booleanstarred_at: stringuser_view_type: stringprivate: required, booleanhtml_url: required, string, format: uridescription: required, string or nullfork: required, booleanurl: required, string, format: uriarchive_url: required, stringassignees_url: required, stringblobs_url: required, stringbranches_url: required, stringcollaborators_url: required, stringcomments_url: required, stringcommits_url: required, stringcompare_url: required, stringcontents_url: required, stringcontributors_url: required, string, format: urideployments_url: required, string, format: uridownloads_url: required, string, format: urievents_url: required, string, format: uriforks_url: required, string, format: urigit_commits_url: required, stringgit_refs_url: required, stringgit_tags_url: required, stringgit_url: stringissue_comment_url: required, stringissue_events_url: required, stringissues_url: required, stringkeys_url: required, stringlabels_url: required, stringlanguages_url: required, string, format: urimerges_url: required, string, format: urimilestones_url: required, stringnotifications_url: required, stringpulls_url: required, stringreleases_url: required, stringssh_url: stringstargazers_url: required, string, format: uristatuses_url: required, stringsubscribers_url: required, string, format: urisubscription_url: required, string, format: uritags_url: required, string, format: uriteams_url: required, string, format: uritrees_url: required, stringclone_url: stringmirror_url: string or nullhooks_url: required, string, format: urisvn_url: stringhomepage: string or nulllanguage: string or nullforks_count: integerstargazers_count: integerwatchers_count: integersize: integerdefault_branch: stringopen_issues_count: integeris_template: booleantopics: array of stringhas_issues: booleanhas_projects: booleanhas_wiki: booleanhas_pages: booleanhas_discussions: booleanhas_pull_requests: booleanpull_request_creation_policy: string, enum: all, collaborators_onlyarchived: booleandisabled: booleanvisibility: stringpushed_at: string or null, format: date-timecreated_at: string or null, format: date-timeupdated_at: string or null, format: date-timepermissions: object:
admin: booleanmaintain: booleanpush: booleantriage: booleanpull: booleanrole_name: stringtemp_clone_token: stringdelete_branch_on_merge: booleansubscribers_count: integernetwork_count: integercode_of_conduct: Code Of Conduct:
key: required, stringname: required, stringurl: required, string, format: uribody: stringhtml_url: required, string or null, format: urilicense: object or null:
key: stringname: stringspdx_id: stringurl: string or nullnode_id: stringforks: integeropen_issues: integerwatchers: integerallow_forking: booleanweb_commit_signoff_required: booleansecurity_and_analysis: object or null:
advanced_security: object:
status: string, enum: enabled, disabledcode_security: object:
status: string, enum: enabled, disableddependabot_security_updates: object:
status: string, enum: enabled, disabledsecret_scanning: object:
status: string, enum: enabled, disabledsecret_scanning_push_protection: object:
status: string, enum: enabled, disabledsecret_scanning_non_provider_patterns: object:
status: string, enum: enabled, disabledsecret_scanning_ai_detection: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_alert_dismissal: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass: object:
status: string, enum: enabled, disabledsecret_scanning_delegated_bypass_options: object:
reviewers: array of objects:
reviewer_id: required, integerreviewer_type: required, string, enum: TEAM, ROLEmode: string, enum: ALWAYS, EXEMPT, default: "ALWAYS"custom_properties: object, additional properties allowedPUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories
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.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
selected_repository_ids (array of integers) (required)Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME/repositories \
-d '{
"selected_repository_ids": [
64780797
]
}'
Response schema (Status: 204):
PUT /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}
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.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
repository_id (integer) (required)
204 - No Content when repository was added to the selected list
409 - Conflict when visibility type is not set to selected
Request:
curl -L \
-X PUT \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME/repositories/REPOSITORY_ID
Response schema (Status: 204):
DELETE /orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}
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.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.org (string) (required)
The organization name. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
repository_id (integer) (required)
204 - Response when repository was removed from the selected list
409 - Conflict when visibility type not set to selected
Request:
curl -L \
-X DELETE \
https://api.github.com/orgs/ORG/dependabot/secrets/SECRET_NAME/repositories/REPOSITORY_ID
Response schema (Status: 204):
GET /repos/{owner}/{repo}/dependabot/secrets
Lists all secrets available in a repository without revealing their encrypted
values.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
per_page (integer)
The number of results per page (max 100). For more information, see "Using pagination in the REST API."
Default: 30
page (integer)
The page number of the results to fetch. For more information, see "Using pagination in the REST API."
Default: 1
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/dependabot/secrets
Response schema (Status: 200):
total_count: required, integersecrets: required, array of Dependabot Secret:
name: required, stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timeGET /repos/{owner}/{repo}/dependabot/secrets/public-key
Gets your public key, which you need to encrypt 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.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint if the repository is private.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/dependabot/secrets/public-key
Response schema (Status: 200):
Same response schema as Get an organization public key.
GET /repos/{owner}/{repo}/dependabot/secrets/{secret_name}
Gets a single repository secret without revealing its encrypted value.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
Request:
curl -L \
-X GET \
https://api.github.com/repos/OWNER/REPO/dependabot/secrets/SECRET_NAME
Response schema (Status: 200):
name: required, stringcreated_at: required, string, format: date-timeupdated_at: required, string, format: date-timePUT /repos/{owner}/{repo}/dependabot/secrets/{secret_name}
Creates or updates a repository secret with an encrypted value. Encrypt your secret using
LibSodium. For more information, see "Encrypting secrets for the REST API."
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
encrypted_value (string)
Value for your secret, encrypted with LibSodium using the public key retrieved from the Get a repository public key endpoint.
key_id (string)
ID of the key you used to encrypt the secret.
201 - Response when creating a secret
204 - Response when updating a secret
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/dependabot/secrets/SECRET_NAME \
-d '{
"encrypted_value": "c2VjcmV0",
"key_id": "012345678912345678"
}'
Response schema (Status: 201):
Request:
curl -L \
-X PUT \
https://api.github.com/repos/OWNER/REPO/dependabot/secrets/SECRET_NAME \
-d '{
"encrypted_value": "c2VjcmV0",
"key_id": "012345678912345678"
}'
Response schema (Status: 204):
DELETE /repos/{owner}/{repo}/dependabot/secrets/{secret_name}
Deletes a secret in a repository using the secret name.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
accept (string)application/vnd.github+json is recommended.owner (string) (required)
The account owner of the repository. The name is not case sensitive.
repo (string) (required)
The name of the repository without the .git extension. The name is not case sensitive.
secret_name (string) (required)
The name of the secret.
Request:
curl -L \
-X DELETE \
https://api.github.com/repos/OWNER/REPO/dependabot/secrets/SECRET_NAME
Response schema (Status: 204):