Identifying Task Manager Resources: REST API Modeling
Learn how to define the 'Tasks' and 'Users' resources for a Task Manager application. Master resource modeling to build a clean, intuitive REST API.

Previously in this course, we covered the fundamental shift toward designing resources as nouns and established a URI hierarchy to organize our endpoints. Now that you understand the "shape" of a RESTful system, it is time to apply those concepts to our running project: the Task Manager.
In this lesson, we will identify the primary resources that drive our application, define their responsibilities, and map the relationships that connect them.
Defining the 'Users' Resource
Every Task Manager needs an identity context. Without users, a task is an orphan—it belongs to no one and has no owner. In REST, we treat an entity that "owns" other data as a primary resource.
The Users resource represents the individual interacting with your system. In our API, Users serves two purposes:
- Namespace: It provides a container for tasks owned by a specific person.
- Context: It allows the API to enforce access control (you shouldn't see tasks belonging to other users).
When you model Users, think of the resource as the root of your ownership hierarchy. Your URI structure will often reflect this, such as /users/{userId}/tasks.
Defining the 'Tasks' Resource

The Tasks resource is the core of our domain. A task is a unit of work that contains state (e.g., "pending" or "completed") and metadata (e.g., due dates, descriptions).
Unlike Users, which are often static, Tasks are highly dynamic. Because they represent the "doing" part of a Task Manager, they will be the resources you interact with most frequently via CRUD operations.
A well-modeled Task resource should be:
- Atomic: It should represent a single, complete unit of work.
- Independent: It should be retrievable via its own unique identifier (e.g.,
/tasks/{taskId}).
Mapping Relationships
In a relational system, data is rarely isolated. To build a functional API, we must define the relationships between Users and Tasks.
The most common relationship in a Task Manager is One-to-Many: One user can possess many tasks, but each task is assigned to exactly one user.
| Relationship Type | Direction | REST Implementation |
|---|---|---|
| One-to-Many | User -> Tasks | /users/{userId}/tasks |
| Many-to-One | Task -> User | /tasks/{taskId}/owner |
Mapping these relationships early is critical. If you fail to define these links, you will end up with a "flat" API where every task is listed in a single, unmanageable global bucket.
Example: Resource Structure
Imagine we are sketching out the endpoints. By identifying Users and Tasks, we can now visualize our API tree:
Flow diagram: API Root → /users; API Root → /tasks
Hands-on Exercise
Grab a piece of paper or a digital scratchpad. Based on our requirements, list three properties you believe the Users resource needs (e.g., username) and three properties for the Tasks resource (e.g., title).
Once you have your list, answer this: If a user deletes their account, what should happen to their tasks? (Hint: Does it make sense to have "orphaned" tasks in your database?)
Common Pitfalls
- Over-nesting: Avoid going deeper than two levels (e.g.,
/users/{userId}/tasks/{taskId}/comments/attachments). If you find yourself nesting too deep, your resource modeling is likely too rigid. - Confusing Actions with Resources: Beginners often create endpoints like
/users/create-task. Remember, the resource is the Task; the POST method handles the creation. - Ignoring Ownership: Neglecting to define the
Userrelationship early makes it difficult to add multi-tenant features later. Always consider who owns the data from day one.
FAQ
Q: Should I include the user ID inside the Task resource?
A: Yes. Even if you access tasks through /users/{userId}/tasks, the individual task object should typically contain an ownerId or userId field to make the resource self-describing.
Q: What if a task doesn't have a user?
A: In some systems, tasks can be public. If your Task Manager allows for "global" tasks, ensure your API handles the missing userId gracefully, perhaps by allowing requests to the root /tasks collection.
Recap

We have successfully identified the two pillars of our Task Manager: Users (the owners) and Tasks (the work items). We mapped their one-to-many relationship and established a hierarchical structure that will keep our API intuitive and scalable. By anchoring our design in these nouns, we ensure that our API remains predictable as the project grows.
Up next: We will dive into Defining the Data Schema to give our resources concrete structure and types.
Work with me

Laravel REST API Development
Clean, secure, well-documented Laravel REST APIs — the backend engine for your app, mobile client, or SaaS. Built by an API specialist.

Headless WordPress + Next.js Frontend Development
Keep WordPress for content, get a lightning-fast Next.js frontend. The best of both worlds — familiar editing, modern speed.

