# Route Spec

## Route ID
`users-block-create`

## Endpoint
`POST /api/v1/users/{userId}/block`

## Human Description
Blocks a user. Blocked users cannot interact with current user content or profile.

## Authentication
- Required: `yes`

## Request
### Path Parameters
- `userId` (`string`, required)

## Responses
### Success: `200 OK`
```json
{"success": true, "message": "User blocked", "data": {"blocked": true}}
```

### Error: `401 Unauthorized`
When returned:
- Missing or invalid access token.

Body:
```json
{
  "success": false,
  "error": {"code": "UNAUTHORIZED", "message": "Authentication required.", "details": {}}
}
```

### Error: `409 Conflict`
When returned:
- Target user is already blocked.

Body:
```json
{
  "success": false,
  "error": {"code": "ALREADY_BLOCKED", "message": "User is already blocked.", "details": {}}
}
```

### Error: `422 Unprocessable Entity`
When returned:
- User attempts to block themselves.

Body:
```json
{
  "success": false,
  "error": {"code": "CANNOT_BLOCK_SELF", "message": "You cannot block yourself.", "details": {}}
}
```

## Data & Caching Dependencies
- **Spanner Tables:** `user_blocks (Write)`
- **Redis Cache:** `None`
- **GCS Storage:** `None`
- **Edge Cache (CDN):** `No`

## Side Effects
- Creates block relationship between current user and target user.
- Suppresses future interactions/visibility according to block policy.
- May remove existing follow relationship in both directions.
- Does not create a user-facing notification.
