Blocking Organizations Users

Note: The User Blocking API on GitHub is currently available for developers to preview. To access the API, you must provide a custom media type in the Accept header:


Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact GitHub Support.

The token used to authenticate the call must have the admin:org scope in order to make any blocking calls for an organization. Otherwise, the response returns HTTP 404.

List blocked users

List the users blocked by an organization.

GET /orgs/:org/blocks


Status: 200 OK
    "login": "octocat",
    "id": 1,
    "node_id": "MDQ6VXNlcjE=",
    "avatar_url": "",
    "gravatar_id": "",
    "url": "",
    "html_url": "",
    "followers_url": "",
    "following_url": "{/other_user}",
    "gists_url": "{/gist_id}",
    "starred_url": "{/owner}{/repo}",
    "subscriptions_url": "",
    "organizations_url": "",
    "repos_url": "",
    "events_url": "{/privacy}",
    "received_events_url": "",
    "type": "User",
    "site_admin": false

Check whether a user is blocked from an organization

GET /orgs/:org/blocks/:username


If the user is blocked:

Status: 204 No Content

If the user is not blocked:

Status: 404 Not Found

Block a user

PUT /orgs/:org/blocks/:username


Status: 204 No Content

Unblock a user

DELETE /orgs/:org/blocks/:username


Status: 204 No Content