---
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/rest-api.md) · [All operations](https://skmtc.net/github/apis/rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/rest-api/versions/80850db290cd/schema)
