---
title: "Get a repository public key"
method: GET
path: "/repos/{owner}/{repo}/dependabot/secrets/public-key"
tags: ["dependabot"]
---

# Get a repository public key

`GET /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.

## Path parameters

- `owner` string, required
- `repo` string, required

## Response `200`

Response

- DependabotPublicKey — The public key used for setting Dependabot Secrets.
  - `key_id` string, required — The identifier for the key.
  - `key` string, required — The Base64 encoded public key.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api/versions/a367f7028301/schema)
