Skip to content

List organization secrets

GET
/orgs/{org}/codespaces/secrets

Lists all Codespaces development environment secrets available at the organization-level without revealing their encrypted values.

OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

per_page
integer
default: 30

The number of results per page (max 100). For more information, see “Using pagination in the REST API.”

page
integer
default: 1

The page number of the results to fetch. For more information, see “Using pagination in the REST API.”

Response

Media type application/json
object
total_count
required
integer
secrets
required
Array<object>
Codespaces Secret

Secrets for a GitHub Codespace.

object
name
required

The name of the secret

string
created_at
required

The date and time at which the secret was created, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.

string format: date-time
updated_at
required

The date and time at which the secret was created, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.

string format: date-time
visibility
required

The type of repositories in the organization that the secret is visible to

string
Allowed values: all private selected
selected_repositories_url

The API URL at which the list of repositories this secret is visible to can be retrieved

string format: uri
Examples
Example default
{
"total_count": 2,
"secrets": [
{
"name": "GH_TOKEN",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z",
"visibility": "all"
},
{
"name": "GIST_ID",
"created_at": "2020-01-10T10:59:22Z",
"updated_at": "2020-01-11T11:59:22Z",
"visibility": "all"
}
]
}
Link
string
Example
<https://api.github.com/resource?page=2>; rel="next", <https://api.github.com/resource?page=5>; rel="last"