# Add selected repository to an organization secret

From **GitHub v3 REST API**.

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

Adds a repository to 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

### `repository_id`

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

## Responses

### `204`

No Content when repository was added to the selected list

### `409`

Conflict when visibility type is not set to selected

## Request examples

### cURL

```shell
curl --request PUT \
  --url {protocol}://{hostname}/api/v3/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}
```
