{"meta":{"title":"REST API endpoints for GitHub Actions variables","intro":"Use the REST API to interact with variables in GitHub Actions.","product":"REST API","breadcrumbs":[{"href":"/en/enterprise-server@3.22/rest","title":"REST API"},{"href":"/en/enterprise-server@3.22/rest/actions","title":"Actions"},{"href":"/en/enterprise-server@3.22/rest/actions/variables","title":"Variables"}],"documentType":"article"},"body":"# REST API endpoints for GitHub Actions variables\n\nUse the REST API to interact with variables in GitHub Actions.\n\n## About variables in GitHub Actions\n\nYou can use the REST API to create, update, delete, and retrieve information about variables that can be used in workflows in GitHub Actions. Variables allow you to store non-sensitive information, such as a username, in your repository, repository environments, or organization. For more information, see [Store information in variables](/en/enterprise-server@3.22/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables) in the GitHub Actions documentation.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List organization variables\n\n```\nGET /orgs/{org}/actions/variables\n```\n\nLists all organization variables.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`per_page`** (integer)\n  The number of results per page (max 30). For more information, see \"Using pagination in the REST API.\"\n  Default: `10`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables\n```\n\n**Response schema (Status: 200):**\n\n* `total_count`: required, integer\n* `variables`: required, array of `Actions Variable for an Organization`:\n  * `name`: required, string\n  * `value`: required, string\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n  * `visibility`: required, string, enum: `all`, `private`, `selected`\n  * `selected_repositories_url`: string, format: uri\n\n## Create an organization variable\n\n```\nPOST /orgs/{org}/actions/variables\n```\n\nCreates an organization variable that you can reference in a GitHub Actions workflow.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need theadmin: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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n#### Body parameters\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`value`** (string) (required)\n  The value of the variable.\n\n* **`visibility`** (string) (required)\n  The type of repositories in the organization that can access the variable. selected means only the repositories specified by selected\\_repository\\_ids can access the variable.\n  Can be one of: `all`, `private`, `selected`\n\n* **`selected_repository_ids`** (array of integers)\n  An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the visibility is set to selected.\n\n### HTTP response status codes\n\n* **201** - Response when creating a variable\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables \\\n  -d '{\n  \"name\": \"USERNAME\",\n  \"value\": \"octocat\",\n  \"visibility\": \"selected\",\n  \"selected_repository_ids\": [\n    1296269,\n    1296280\n  ]\n}'\n```\n\n**Response schema (Status: 201):**\n\n## Get an organization variable\n\n```\nGET /orgs/{org}/actions/variables/{name}\n```\n\nGets a specific variable in an organization.\nThe authenticated user must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need theadmin: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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables/NAME\n```\n\n**Response schema (Status: 200):**\n\n* `name`: required, string\n* `value`: required, string\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n* `visibility`: required, string, enum: `all`, `private`, `selected`\n* `selected_repositories_url`: string, format: uri\n\n## Update an organization variable\n\n```\nPATCH /orgs/{org}/actions/variables/{name}\n```\n\nUpdates an organization variable that you can reference in a GitHub Actions workflow.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n#### Body parameters\n\n* **`name`** (string)\n  The name of the variable.\n\n* **`value`** (string)\n  The value of the variable.\n\n* **`visibility`** (string)\n  The type of repositories in the organization that can access the variable. selected means only the repositories specified by selected\\_repository\\_ids can access the variable.\n  Can be one of: `all`, `private`, `selected`\n\n* **`selected_repository_ids`** (array of integers)\n  An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the visibility is set to selected.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables/NAME \\\n  -d '{\n  \"name\": \"USERNAME\",\n  \"value\": \"octocat\",\n  \"visibility\": \"selected\",\n  \"selected_repository_ids\": [\n    1296269,\n    1296280\n  ]\n}'\n```\n\n**Response schema (Status: 204):**\n\n## Delete an organization variable\n\n```\nDELETE /orgs/{org}/actions/variables/{name}\n```\n\nDeletes an organization variable using the variable name.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need theadmin: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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables/NAME\n```\n\n**Response schema (Status: 204):**\n\n## List selected repositories for an organization variable\n\n```\nGET /orgs/{org}/actions/variables/{name}/repositories\n```\n\nLists all repositories that can access an organization variable\nthat is available to selected repositories.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n* **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **409** - Response when the visibility of the variable is not set to selected\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables/NAME/repositories\n```\n\n**Response schema (Status: 200):**\n\n* `total_count`: required, integer\n* `repositories`: required, array of `Minimal Repository`:\n  * `id`: required, integer, format: int64\n  * `node_id`: required, string\n  * `name`: required, string\n  * `full_name`: required, string\n  * `owner`: required, `Simple User`:\n    * `name`: string or null\n    * `email`: string or null\n    * `login`: required, string\n    * `id`: required, integer, format: int64\n    * `node_id`: required, string\n    * `avatar_url`: required, string, format: uri\n    * `gravatar_id`: required, string or null\n    * `url`: required, string, format: uri\n    * `html_url`: required, string, format: uri\n    * `followers_url`: required, string, format: uri\n    * `following_url`: required, string\n    * `gists_url`: required, string\n    * `starred_url`: required, string\n    * `subscriptions_url`: required, string, format: uri\n    * `organizations_url`: required, string, format: uri\n    * `repos_url`: required, string, format: uri\n    * `events_url`: required, string\n    * `received_events_url`: required, string, format: uri\n    * `type`: required, string\n    * `site_admin`: required, boolean\n    * `starred_at`: string\n    * `user_view_type`: string\n  * `private`: required, boolean\n  * `html_url`: required, string, format: uri\n  * `description`: required, string or null\n  * `fork`: required, boolean\n  * `url`: required, string, format: uri\n  * `archive_url`: required, string\n  * `assignees_url`: required, string\n  * `blobs_url`: required, string\n  * `branches_url`: required, string\n  * `collaborators_url`: required, string\n  * `comments_url`: required, string\n  * `commits_url`: required, string\n  * `compare_url`: required, string\n  * `contents_url`: required, string\n  * `contributors_url`: required, string, format: uri\n  * `deployments_url`: required, string, format: uri\n  * `downloads_url`: required, string, format: uri\n  * `events_url`: required, string, format: uri\n  * `forks_url`: required, string, format: uri\n  * `git_commits_url`: required, string\n  * `git_refs_url`: required, string\n  * `git_tags_url`: required, string\n  * `git_url`: string\n  * `issue_comment_url`: required, string\n  * `issue_events_url`: required, string\n  * `issues_url`: required, string\n  * `keys_url`: required, string\n  * `labels_url`: required, string\n  * `languages_url`: required, string, format: uri\n  * `merges_url`: required, string, format: uri\n  * `milestones_url`: required, string\n  * `notifications_url`: required, string\n  * `pulls_url`: required, string\n  * `releases_url`: required, string\n  * `ssh_url`: string\n  * `stargazers_url`: required, string, format: uri\n  * `statuses_url`: required, string\n  * `subscribers_url`: required, string, format: uri\n  * `subscription_url`: required, string, format: uri\n  * `tags_url`: required, string, format: uri\n  * `teams_url`: required, string, format: uri\n  * `trees_url`: required, string\n  * `clone_url`: string\n  * `mirror_url`: string or null\n  * `hooks_url`: required, string, format: uri\n  * `svn_url`: string\n  * `homepage`: string or null\n  * `language`: string or null\n  * `forks_count`: integer\n  * `stargazers_count`: integer\n  * `watchers_count`: integer\n  * `size`: integer\n  * `default_branch`: string\n  * `open_issues_count`: integer\n  * `is_template`: boolean\n  * `topics`: array of string\n  * `has_issues`: boolean\n  * `has_projects`: boolean\n  * `has_wiki`: boolean\n  * `has_pages`: boolean\n  * `has_discussions`: boolean\n  * `has_pull_requests`: boolean\n  * `pull_request_creation_policy`: string, enum: `all`, `collaborators_only`\n  * `archived`: boolean\n  * `disabled`: boolean\n  * `visibility`: string\n  * `pushed_at`: string or null, format: date-time\n  * `created_at`: string or null, format: date-time\n  * `updated_at`: string or null, format: date-time\n  * `permissions`: object:\n    * `admin`: boolean\n    * `maintain`: boolean\n    * `push`: boolean\n    * `triage`: boolean\n    * `pull`: boolean\n  * `role_name`: string\n  * `temp_clone_token`: string\n  * `delete_branch_on_merge`: boolean\n  * `subscribers_count`: integer\n  * `network_count`: integer\n  * `code_of_conduct`: `Code Of Conduct`:\n    * `key`: required, string\n    * `name`: required, string\n    * `url`: required, string, format: uri\n    * `body`: string\n    * `html_url`: required, string or null, format: uri\n  * `license`: object or null:\n    * `key`: string\n    * `name`: string\n    * `spdx_id`: string\n    * `url`: string or null\n    * `node_id`: string\n  * `forks`: integer\n  * `open_issues`: integer\n  * `watchers`: integer\n  * `allow_forking`: boolean\n  * `web_commit_signoff_required`: boolean\n  * `security_and_analysis`: object or null:\n    * `advanced_security`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `code_security`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `dependabot_security_updates`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `secret_scanning`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `secret_scanning_push_protection`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `secret_scanning_non_provider_patterns`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `secret_scanning_delegated_alert_dismissal`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `secret_scanning_delegated_bypass`: object:\n      * `status`: string, enum: `enabled`, `disabled`\n    * `secret_scanning_delegated_bypass_options`: object:\n      * `reviewers`: array of objects:\n        * `reviewer_id`: required, integer\n        * `reviewer_type`: required, string, enum: `TEAM`, `ROLE`\n        * `mode`: string, enum: `ALWAYS`, `EXEMPT`, default: `\"ALWAYS\"`\n  * `custom_properties`: object, additional properties allowed\n\n## Set selected repositories for an organization variable\n\n```\nPUT /orgs/{org}/actions/variables/{name}/repositories\n```\n\nReplaces all repositories for an organization variable that is available\nto selected repositories. Organization variables that are available to selected\nrepositories have their visibility field set to selected.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n#### Body parameters\n\n* **`selected_repository_ids`** (array of integers) (required)\n  The IDs of the repositories that can access the organization variable.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **409** - Response when the visibility of the variable is not set to selected\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables/NAME/repositories \\\n  -d '{\n  \"selected_repository_ids\": [\n    64780797\n  ]\n}'\n```\n\n**Response schema (Status: 204):**\n\n## Add selected repository to an organization variable\n\n```\nPUT /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\n```\n\nAdds a repository to an organization variable that is available to selected repositories.\nOrganization variables that are available to selected repositories have their visibility field set to selected.\nAuthenticated users must have collaborator access to a repository to create, update, or read secrets.\nOAuth 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.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`repository_id`** (integer) (required)\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **409** - Response when the visibility of the variable is not set to selected\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables/NAME/repositories/REPOSITORY_ID\n```\n\n**Response schema (Status: 204):**\n\n## Remove selected repository from an organization variable\n\n```\nDELETE /orgs/{org}/actions/variables/{name}/repositories/{repository_id}\n```\n\nRemoves a repository from an organization variable that is\navailable to selected repositories. Organization variables that are available to\nselected repositories have their visibility field set to selected.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint. If the repository is private, the repo scope is also required.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`repository_id`** (integer) (required)\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **409** - Response when the visibility of the variable is not set to selected\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/orgs/ORG/actions/variables/NAME/repositories/REPOSITORY_ID\n```\n\n**Response schema (Status: 204):**\n\n## List repository organization variables\n\n```\nGET /repos/{owner}/{repo}/actions/organization-variables\n```\n\nLists all organization variables shared with a repository.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`per_page`** (integer)\n  The number of results per page (max 30). For more information, see \"Using pagination in the REST API.\"\n  Default: `10`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/organization-variables\n```\n\n**Response schema (Status: 200):**\n\n* `total_count`: required, integer\n* `variables`: required, array of `Actions Variable`:\n  * `name`: required, string\n  * `value`: required, string\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n\n## List repository variables\n\n```\nGET /repos/{owner}/{repo}/actions/variables\n```\n\nLists all repository variables.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`per_page`** (integer)\n  The number of results per page (max 30). For more information, see \"Using pagination in the REST API.\"\n  Default: `10`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/variables\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List repository organization variables](#list-repository-organization-variables).\n\n## Create a repository variable\n\n```\nPOST /repos/{owner}/{repo}/actions/variables\n```\n\nCreates a repository variable that you can reference in a GitHub Actions workflow.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n#### Body parameters\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`value`** (string) (required)\n  The value of the variable.\n\n### HTTP response status codes\n\n* **201** - Created\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/variables \\\n  -d '{\n  \"name\": \"USERNAME\",\n  \"value\": \"octocat\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n## Get a repository variable\n\n```\nGET /repos/{owner}/{repo}/actions/variables/{name}\n```\n\nGets a specific variable in a repository.\nThe authenticated user must have collaborator access to the repository to use this endpoint.\nOAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/variables/NAME\n```\n\n**Response schema (Status: 200):**\n\n* `name`: required, string\n* `value`: required, string\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n\n## Update a repository variable\n\n```\nPATCH /repos/{owner}/{repo}/actions/variables/{name}\n```\n\nUpdates a repository variable that you can reference in a GitHub Actions workflow.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n#### Body parameters\n\n* **`name`** (string)\n  The name of the variable.\n\n* **`value`** (string)\n  The value of the variable.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/variables/NAME \\\n  -d '{\n  \"name\": \"USERNAME\",\n  \"value\": \"octocat\"\n}'\n```\n\n**Response schema (Status: 204):**\n\n## Delete a repository variable\n\n```\nDELETE /repos/{owner}/{repo}/actions/variables/{name}\n```\n\nDeletes a repository variable using the variable name.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/variables/NAME\n```\n\n**Response schema (Status: 204):**\n\n## List environment variables\n\n```\nGET /repos/{owner}/{repo}/environments/{environment_name}/variables\n```\n\nLists all environment variables.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`environment_name`** (string) (required)\n  The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with %2F.\n\n* **`per_page`** (integer)\n  The number of results per page (max 30). For more information, see \"Using pagination in the REST API.\"\n  Default: `10`\n\n* **`page`** (integer)\n  The page number of the results to fetch. For more information, see \"Using pagination in the REST API.\"\n  Default: `1`\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/environments/ENVIRONMENT_NAME/variables\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List repository organization variables](#list-repository-organization-variables).\n\n## Create an environment variable\n\n```\nPOST /repos/{owner}/{repo}/environments/{environment_name}/variables\n```\n\nCreate an environment variable that you can reference in a GitHub Actions workflow.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`environment_name`** (string) (required)\n  The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with %2F.\n\n#### Body parameters\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`value`** (string) (required)\n  The value of the variable.\n\n### HTTP response status codes\n\n* **201** - Created\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/environments/ENVIRONMENT_NAME/variables \\\n  -d '{\n  \"name\": \"USERNAME\",\n  \"value\": \"octocat\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n## Get an environment variable\n\n```\nGET /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\n```\n\nGets a specific variable in an environment.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`environment_name`** (string) (required)\n  The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with %2F.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n### HTTP response status codes\n\n* **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/environments/ENVIRONMENT_NAME/variables/NAME\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get a repository variable](#get-a-repository-variable).\n\n## Update an environment variable\n\n```\nPATCH /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\n```\n\nUpdates an environment variable that you can reference in a GitHub Actions workflow.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`environment_name`** (string) (required)\n  The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with %2F.\n\n#### Body parameters\n\n* **`name`** (string)\n  The name of the variable.\n\n* **`value`** (string)\n  The value of the variable.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/environments/ENVIRONMENT_NAME/variables/NAME \\\n  -d '{\n  \"name\": \"USERNAME\",\n  \"value\": \"octocat\"\n}'\n```\n\n**Response schema (Status: 204):**\n\n## Delete an environment variable\n\n```\nDELETE /repos/{owner}/{repo}/environments/{environment_name}/variables/{name}\n```\n\nDeletes an environment variable using the variable name.\nAuthenticated users must have collaborator access to a repository to create, update, or read variables.\nOAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`owner`** (string) (required)\n  The account owner of the repository. The name is not case sensitive.\n\n* **`repo`** (string) (required)\n  The name of the repository without the .git extension. The name is not case sensitive.\n\n* **`name`** (string) (required)\n  The name of the variable.\n\n* **`environment_name`** (string) (required)\n  The name of the environment. The name must be URL encoded. For example, any slashes in the name must be replaced with %2F.\n\n### HTTP response status codes\n\n* **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/environments/ENVIRONMENT_NAME/variables/NAME\n```\n\n**Response schema (Status: 204):**"}