PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}
To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a 422 Unprocessable Entity
status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set Content-Length
to zero when calling out to this endpoint. For more information, see "HTTP method."
[!NOTE] You can also specify a team by
org_id
andteam_id
using the routePUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}
.
For more information about the permission levels, see "Repository permission levels for an organization".
Servers
- https://api.github.com
Path parameters
Name | Type | Required | Description |
---|---|---|---|
repo |
String | Yes |
The name of the repository without the |
team_slug |
String | Yes |
The slug of the team name. |
org |
String | Yes |
The organization name. The name is not case sensitive. |
owner |
String | Yes |
The account owner of the repository. The name is not case sensitive. |
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
permission |
String | No |
The permission to grant the team on this repository. We accept the following permissions to be set: |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.