---
title: "Block a user"
method: PUT
path: "/user/blocks/{username}"
tags: ["users"]
---

# Block a user

`PUT /user/blocks/{username}`

Blocks the given user and returns a 204. If the authenticated user cannot block the given user a 422 is returned.

## Path parameters

- `username` string, required

## Response `204`

Response

## Other responses

- `304` — Not modified
- `401` — Requires authentication
- `403` — Forbidden
- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
