# Set selected repositories for an organization secret

From **GitHub v3 REST API**.

`PUT /orgs/{org}/actions/secrets/{secret_name}/repositories`

Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#create-or-update-an-organization-secret). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint.

## Parameters

### `org`

- Location: path
- Required: true
- Type: `string`

### `secret_name`

- Location: path
- Required: true
- Type: `string`

secret_name parameter

## Request body

- Required: true
### `application/json`

- Type: `object`

```json
{
  "selected_repository_ids": [
    64780797
  ]
}
```

```json
{"properties":{"selected_repository_ids":{"description":"An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.0/rest/reference/actions#remove-selected-repository-from-an-organization-secret) endpoints.","items":{"type":"integer"},"type":"array"}},"required":["selected_repository_ids"],"type":"object"}
```

## Responses

### `204`

Response

## Request examples

### cURL

```shell
curl --request PUT \
  --url {protocol}://{hostname}/api/v3/orgs/{org}/actions/secrets/{secret_name}/repositories \
  --header 'content-type: application/json' \
  --data '{
  "selected_repository_ids": [
    64780797
  ]
}'
```
