Skip to content

Inconsistent Status Codes for Resource Creation (201 vs. 200) #254

@DeepeshKalura

Description

@DeepeshKalura

I noticed that in several places within the backend, we are returning 200 OK for resource creation instead of 201 Created. According to MDN documentation, 201 is the appropriate status code when a new resource is successfully created.

Image

Steps to Reproduce:

Make a request to create a resource (e.g., POST /api/v1/conversations/).
Observe the response status code (should be 201 but sometimes returns 200).

Affected Endpoints:

POST `/api/v1/signup` 
POST `/api/v1/parse`
POST `/api/v1/conversations/`,  
POST `/api/v1/conversations/{conversation_id}/message/`,  

maybe more but this is the scope of my Issue.

Expected Behavior:

When a resource is created, the API should return 201 Created instead of 200 OK.
Consistent usage of status codes across the project.

Proposed Fix:

Update all affected endpoints to return 201 Created when a resource is successfully created.
Review API responses for consistency.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions