CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/api-design-patterns

REST API design patterns — response envelopes, pagination, filtering, status codes, and resource naming

87

1.78x
Quality

83%

Does it follow best practices?

Impact

98%

1.78x

Average score across 4 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-4/

User Management API for an Admin Dashboard

Problem Description

A SaaS company needs an internal API for their admin dashboard to manage users. The system has thousands of users and admins need to search, filter, and sort them efficiently.

Build a Python/FastAPI REST API that supports:

  • Listing users with filtering by role (admin, editor, viewer), account status (active, suspended, pending), and registration date range
  • Sorting the user list by name, email, or registration date
  • Searching users by name or email (partial match)
  • Getting a single user's details
  • Creating a new user account
  • Updating a user's profile (e.g., changing their role or name without affecting other fields)
  • Deactivating a user account (soft delete — marks as suspended, does not remove)

Users have: id, name, email, role, status, created_at, and last_login_at.

Output Specification

Implement the API in a main.py file (or split across a src/ directory). Use an in-memory list or SQLite for storage.

Produce a requirements.txt with dependencies.

Do not start the server — just produce the source files.

evals

tile.json