Add a repository collaborator

PUT {{baseUrl}}/repos/:owner/:repo/collaborators/:username

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See [Abuse rate limits](https://developer.github.com/v3/#abuse-rate-limits) and [Dealing with abuse rate limits](https://developer.github.com/v3/guides/best-practices-for-integrators/#dealing-with-abuse-rate-limits) for details.

For more information the permission levels, see [Repository permission levels for an organization](https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-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 verbs](https://developer.github.com/v3/#http-verbs).

The invitee will receive a notification that they have been invited to the repository, which they must accept or decline. They may do this via the notifications page, the email they receive, or by using the repository invitations API endpoints.

Rate limits

To prevent abuse, you are limited to sending 50 invitations to a repository per 24 hour period. Note there is no limit if you are inviting organization members to an organization repository.

Request Body

{"permission"=>"push", "permissions"=>"<string>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: Created

{&quot;id&quot;:1,&quot;node_id&quot;:&quot;MDEwOlJlcG9zaXRvcnkxMjk2MjY5&quot;,&quot;repository&quot;:{&quot;id&quot;:1296269,&quot;node_id&quot;:&quot;MDEwOlJlcG9zaXRvcnkxMjk2MjY5&quot;,&quot;name&quot;:&quot;Hello-World&quot;,&quot;full_name&quot;:&quot;octocat/Hello-World&quot;,&quot;owner&quot;:{&quot;login&quot;:&quot;octocat&quot;,&quot;id&quot;:1,&quot;node_id&quot;:&quot;MDQ6VXNlcjE=&quot;,&quot;avatar_url&quot;:&quot;https://github.com/images/error/octocat_happy.gif&quot;,&quot;gravatar_id&quot;:&quot;&quot;,&quot;url&quot;:&quot;https://api.github.com/users/octocat&quot;,&quot;html_url&quot;:&quot;https://github.com/octocat&quot;,&quot;followers_url&quot;:&quot;https://api.github.com/users/octocat/followers&quot;,&quot;following_url&quot;:&quot;https://api.github.com/users/octocat/following{/other_user}&quot;,&quot;gists_url&quot;:&quot;https://api.github.com/users/octocat/gists{/gist_id}&quot;,&quot;starred_url&quot;:&quot;https://api.github.com/users/octocat/starred{/owner}{/repo}&quot;,&quot;subscriptions_url&quot;:&quot;https://api.github.com/users/octocat/subscriptions&quot;,&quot;organizations_url&quot;:&quot;https://api.github.com/users/octocat/orgs&quot;,&quot;repos_url&quot;:&quot;https://api.github.com/users/octocat/repos&quot;,&quot;events_url&quot;:&quot;https://api.github.com/users/octocat/events{/privacy}&quot;,&quot;received_events_url&quot;:&quot;https://api.github.com/users/octocat/received_events&quot;,&quot;type&quot;:&quot;User&quot;,&quot;site_admin&quot;:false},&quot;private&quot;:false,&quot;html_url&quot;:&quot;https://github.com/octocat/Hello-World&quot;,&quot;description&quot;:&quot;This your first repo!&quot;,&quot;fork&quot;:false,&quot;url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World&quot;,&quot;archive_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}&quot;,&quot;assignees_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/assignees{/user}&quot;,&quot;blobs_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}&quot;,&quot;branches_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/branches{/branch}&quot;,&quot;collaborators_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}&quot;,&quot;comments_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/comments{/number}&quot;,&quot;commits_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/commits{/sha}&quot;,&quot;compare_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}&quot;,&quot;contents_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/contents/{+path}&quot;,&quot;contributors_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/contributors&quot;,&quot;deployments_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/deployments&quot;,&quot;downloads_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/downloads&quot;,&quot;events_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/events&quot;,&quot;forks_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/forks&quot;,&quot;git_commits_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}&quot;,&quot;git_refs_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}&quot;,&quot;git_tags_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}&quot;,&quot;git_url&quot;:&quot;git:github.com/octocat/Hello-World.git&quot;,&quot;issue_comment_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}&quot;,&quot;issue_events_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/issues/events{/number}&quot;,&quot;issues_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/issues{/number}&quot;,&quot;keys_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/keys{/key_id}&quot;,&quot;labels_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/labels{/name}&quot;,&quot;languages_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/languages&quot;,&quot;merges_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/merges&quot;,&quot;milestones_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/milestones{/number}&quot;,&quot;notifications_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}&quot;,&quot;pulls_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/pulls{/number}&quot;,&quot;releases_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/releases{/id}&quot;,&quot;ssh_url&quot;:&quot;git@github.com:octocat/Hello-World.git&quot;,&quot;stargazers_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/stargazers&quot;,&quot;statuses_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/statuses/{sha}&quot;,&quot;subscribers_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/subscribers&quot;,&quot;subscription_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/subscription&quot;,&quot;tags_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/tags&quot;,&quot;teams_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/teams&quot;,&quot;trees_url&quot;:&quot;https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}&quot;,&quot;hooks_url&quot;:&quot;http://api.github.com/repos/octocat/Hello-World/hooks&quot;},&quot;invitee&quot;:{&quot;login&quot;:&quot;octocat&quot;,&quot;id&quot;:1,&quot;node_id&quot;:&quot;MDQ6VXNlcjE=&quot;,&quot;avatar_url&quot;:&quot;https://github.com/images/error/octocat_happy.gif&quot;,&quot;gravatar_id&quot;:&quot;&quot;,&quot;url&quot;:&quot;https://api.github.com/users/octocat&quot;,&quot;html_url&quot;:&quot;https://github.com/octocat&quot;,&quot;followers_url&quot;:&quot;https://api.github.com/users/octocat/followers&quot;,&quot;following_url&quot;:&quot;https://api.github.com/users/octocat/following{/other_user}&quot;,&quot;gists_url&quot;:&quot;https://api.github.com/users/octocat/gists{/gist_id}&quot;,&quot;starred_url&quot;:&quot;https://api.github.com/users/octocat/starred{/owner}{/repo}&quot;,&quot;subscriptions_url&quot;:&quot;https://api.github.com/users/octocat/subscriptions&quot;,&quot;organizations_url&quot;:&quot;https://api.github.com/users/octocat/orgs&quot;,&quot;repos_url&quot;:&quot;https://api.github.com/users/octocat/repos&quot;,&quot;events_url&quot;:&quot;https://api.github.com/users/octocat/events{/privacy}&quot;,&quot;received_events_url&quot;:&quot;https://api.github.com/users/octocat/received_events&quot;,&quot;type&quot;:&quot;User&quot;,&quot;site_admin&quot;:false},&quot;inviter&quot;:{&quot;login&quot;:&quot;octocat&quot;,&quot;id&quot;:1,&quot;node_id&quot;:&quot;MDQ6VXNlcjE=&quot;,&quot;avatar_url&quot;:&quot;https://github.com/images/error/octocat_happy.gif&quot;,&quot;gravatar_id&quot;:&quot;&quot;,&quot;url&quot;:&quot;https://api.github.com/users/octocat&quot;,&quot;html_url&quot;:&quot;https://github.com/octocat&quot;,&quot;followers_url&quot;:&quot;https://api.github.com/users/octocat/followers&quot;,&quot;following_url&quot;:&quot;https://api.github.com/users/octocat/following{/other_user}&quot;,&quot;gists_url&quot;:&quot;https://api.github.com/users/octocat/gists{/gist_id}&quot;,&quot;starred_url&quot;:&quot;https://api.github.com/users/octocat/starred{/owner}{/repo}&quot;,&quot;subscriptions_url&quot;:&quot;https://api.github.com/users/octocat/subscriptions&quot;,&quot;organizations_url&quot;:&quot;https://api.github.com/users/octocat/orgs&quot;,&quot;repos_url&quot;:&quot;https://api.github.com/users/octocat/repos&quot;,&quot;events_url&quot;:&quot;https://api.github.com/users/octocat/events{/privacy}&quot;,&quot;received_events_url&quot;:&quot;https://api.github.com/users/octocat/received_events&quot;,&quot;type&quot;:&quot;User&quot;,&quot;site_admin&quot;:false},&quot;permissions&quot;:&quot;write&quot;,&quot;created_at&quot;:&quot;2016-06-13T14:52:50-05:00&quot;,&quot;url&quot;:&quot;https://api.github.com/user/repository_invitations/1296269&quot;,&quot;html_url&quot;:&quot;https://github.com/octocat/Hello-World/invitations&quot;}