---
title: "Get a secret for the authenticated user"
method: GET
path: "/user/codespaces/secrets/{secret_name}"
tags: ["codespaces"]
---

# Get a secret for the authenticated user

`GET /user/codespaces/secrets/{secret_name}`

Gets a development environment secret available to a user's codespaces without revealing its encrypted value.

The authenticated user must have Codespaces access to use this endpoint.

OAuth app tokens and personal access tokens (classic) need the `codespace` or `codespace:secrets` scope to use this endpoint.

## Path parameters

- `secret_name` string, required

## Response `200`

Response

- CodespacesSecret — Secrets for a GitHub Codespace.
  - `name` string, required — The name of the secret
  - `created_at` string, date-time, required — The date and time at which the secret was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
  - `updated_at` string, date-time, required — The date and time at which the secret was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.
  - `visibility` 'all' | 'private' | 'selected', required — The type of repositories in the organization that the secret is visible to
  - `selected_repositories_url` string, uri, required — The API URL at which the list of repositories this secret is visible to can be retrieved

---

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