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

# Get a repository public key

`GET /repos/{owner}/{repo}/actions/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.
If the repository is private you must use an access token with the `repo` scope.
GitHub Apps must have the `secrets` repository permission to use this endpoint.
Authenticated users must have collaborator access to a repository to create, update, or read secrets.

## Path parameters

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

## Response `200`

Response

- ActionsPublicKey — The public key used for setting Actions Secrets.
  - `key_id` string, required — The identifier for the key.
  - `key` string, required — The Base64 encoded public key.
  - `id` integer
  - `url` string
  - `title` string
  - `created_at` string

---

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