---
title: "Block user"
method: POST
path: "/api/user/blocks"
tags: ["User"]
---

# Block user

`POST /api/user/blocks`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/user/blocks`
- Auth: HTTP bearer

Persist a block. Body must include blockedUserId or handle (User.id or display handle; empty strings rejected).

## Request body

- union
  - object
    - `blockedUserId` string, required
    - `handle` string
  - object
    - `blockedUserId` string
    - `handle` string, required

## Response `201`

{ success, data: { id, blockerId, blockedId, createdAt } }

## Other responses

- `400`: { success: false, error, code: VALIDATION_ERROR } — missing/empty blockedUserId or handle, or self-block
- `401`: { success: false, error, code: UNAUTHORIZED }
- `404`: { success: false, error, code: NOT_FOUND } — blockedUserId/handle did not resolve
- `500`: { success: false, error, code: INTERNAL_ERROR }

## Changes

- **2026-08-21** `cbc84b00330e`: 3 breaking, 1 info
  - request body became required
  - the `blockedUserId` request property's minLength was increased from `0` to `1`
  - the `handle` request property's minLength was increased from `0` to `1`
  - added `subschema #1, subschema #2` to the request body `anyOf` list
- **2026-08-21** `76b6029b2b6f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/user/blocks/post.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
