PATCH /api/v1/user/status/{id}

Update a user's account status. Available statuses: ACTIVE (normal access), SUSPENDED (temporary restriction), DELETED (soft deletion).

Path parameters

  • id string Required

    The unique identifier (UUID) of the user whose status will be updated

Query parameters

  • status string

    The new status for the user account

    Values are ACTIVE, SUSPENDED, or DELETED.

Responses

  • 200 application/json

    User status updated successfully

  • 400 application/json

    Invalid user ID format or invalid status value

  • 401 application/json

    Authentication token required

  • 403 application/json

    Insufficient permissions to update user status

  • 404 application/json

    User not found with the provided ID

PATCH /api/v1/user/status/{id}
curl \
 --request PATCH 'https://api.echoplain.social/api/v1/user/status/user-uuid-123e4567-e89b-12d3-a456-426614174000'
Response examples (200)
{
  "id": "user-uuid-123e4567-e89b-12d3-a456-426614174000",
  "email": "john.doe@university.edu",
  "status": "SUSPENDED",
  "message": "User status updated successfully",
  "lastname": "Doe",
  "firstname": "John",
  "updatedAt": "2024-01-25T16:45:00Z"
}
Response examples (400)
{
  "error": "Bad Request",
  "message": [
    "status must be one of: ACTIVE, SUSPENDED, DELETED",
    "id must be a valid UUID"
  ],
  "statusCode": 400
}
Response examples (401)
{
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 401
}
Response examples (403)
{
  "error": "Forbidden",
  "message": "Insufficient permissions to modify user status",
  "statusCode": 403
}
Response examples (404)
{
  "error": "Not Found",
  "message": "User not found",
  "statusCode": 404
}