Skip to content

Get an organization variable

GET
/orgs/{org}/agents/variables/{name}

Gets a specific agent variable in an organization.

The authenticated user must have collaborator access to a repository to create, update, or read variables.

OAuth tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.

API method documentation

org
required
string

The organization name. The name is not case sensitive.

name
required
string

The name of the variable.

Response

Media type application/json
Actions Variable for an Organization

Organization variable for GitHub Actions.

object
name
required

The name of the variable.

string
value
required

The value of the variable.

string
created_at
required

The date and time at which the variable 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 variable was last updated, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.

string format: date-time
visibility
required

Visibility of a variable

string
Allowed values: all private selected
selected_repositories_url
string format: uri
Examples
Example default
{
"name": "USERNAME",
"value": "octocat",
"created_at": "2019-08-10T14:59:22Z",
"updated_at": "2020-01-10T14:59:22Z",
"visibility": "selected",
"selected_repositories_url": "https://api.github.com/orgs/octo-org/actions/variables/USERNAME/repositories"
}