{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"d79eceb9-bedc-4aa7-a6f4-4e93bd652ec3","name":"CareTrip","description":"# CareTrip API Documentation\n\n## Overview\n\nCareTrip is a comprehensive healthcare travel platform API that enables travelers to find, book, and review medical services while traveling. The platform connects patients with healthcare providers, manages appointments, and facilitates medical tourism.\n\n## Base URL\n\n```\nhttp://localhost:5000\n\n ```\n\n## Authentication\n\nMost endpoints require JWT Bearer token authentication. After registering or logging in, include the token in the Authorization header:\n\n```\nAuthorization: Bearer <your_jwt_token>\n\n ```\n\n**Token Expiration:** 7 days from issuance\n\n## API Endpoints Summary\n\n| Method | Endpoint | Description | Auth Required |\n| --- | --- | --- | --- |\n| POST | /api/auth/register | Register a new user | No |\n| POST | /api/auth/login | Login user | No |\n| GET | /api/profile | Get user profile | Yes |\n| PUT | /api/profile | Update user profile | Yes |\n| POST | /api/bookings | Create a booking | Yes |\n| GET | /api/bookings | Get all bookings | Yes |\n| POST | /api/bookings/:id/review | Submit a review | Yes |\n| GET | /api/places/nearby-doctors | Find nearby doctors | Yes |\n| GET | /api/places/search-doctors | Search doctors | Yes |\n\n---\n\n## Authentication Endpoints\n\n### 1\\. Register User\n\nCreates a new user account in the system.\n\n**Endpoint:** `POST /api/auth/register`\n\n**Request Body:**\n\n``` json\n{\n    \"name\": \"string\",\n    \"email\": \"string\",\n    \"password\": \"string\",\n    \"role\": \"Traveler\" | \"Doctor\"\n}\n\n ```\n\n**Response (201 Created):**\n\n``` json\n{\n    \"success\": true,\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n    \"user\": {\n        \"id\": \"69f48e032c1f16b06d5379f1\",\n        \"name\": \"Postmannn\",\n        \"email\": \"newwithpostman@example.com\",\n        \"role\": \"Traveler\",\n        \"verificationStatus\": \"unverified\"\n    }\n}\n\n ```\n\n---\n\n### 2\\. Login User\n\nAuthenticates an existing user and returns a JWT token.\n\n**Endpoint:** `POST /api/auth/login`\n\n**Request Body:**\n\n``` json\n{\n    \"email\": \"string\",\n    \"password\": \"string\"\n}\n\n ```\n\n**Response (200 OK):**\n\n``` json\n{\n    \"success\": true,\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n    \"user\": {\n        \"id\": \"69f48e032c1f16b06d5379f1\",\n        \"name\": \"Postmannn\",\n        \"email\": \"newwithpostman@example.com\",\n        \"role\": \"Traveler\",\n        \"verificationStatus\": null\n    }\n}\n\n ```\n\n---\n\n## Profile Endpoints\n\n### 3\\. Get Profile\n\nRetrieves the authenticated user's profile information.\n\n**Endpoint:** `GET /api/profile`\n\n**Headers:**\n\n```\nAuthorization: Bearer <token>\n\n ```\n\n**Response (200 OK):**\n\n``` json\n{\n    \"success\": true,\n    \"data\": {\n        \"_id\": \"69f48e032c1f16b06d5379f1\",\n        \"name\": \"Postmannn\",\n        \"email\": \"newwithpostman@example.com\",\n        \"role\": \"Traveler\",\n        \"isVerified\": false,\n        \"preferredLanguage\": \"English\",\n        \"allergies\": \"None\",\n        \"chronicConditions\": \"None\",\n        \"createdAt\": \"2026-05-01T11:26:59.510Z\",\n        \"updatedAt\": \"2026-05-01T11:26:59.510Z\"\n    }\n}\n\n ```\n\n---\n\n### 4\\. Update Profile\n\nUpdates the authenticated user's profile information.\n\n**Endpoint:** `PUT /api/profile`\n\n**Headers:**\n\n```\nAuthorization: Bearer <token>\n\n ```\n\n**Request Body:**\n\n``` json\n{\n    \"name\": \"string\",\n    \"phone\": \"string\",\n    \"emergencyEmail\": \"string\",\n    \"emergencyWhatsApp\": \"string\",\n    \"picture\": \"string (URL)\"\n}\n\n ```\n\n**Response (200 OK):**\n\n``` json\n{\n    \"success\": true,\n    \"data\": {\n        \"_id\": \"69f48e032c1f16b06d5379f1\",\n        \"name\": \"John Updated\",\n        \"email\": \"newwithpostman@example.com\",\n        \"role\": \"Traveler\",\n        \"isVerified\": false,\n        \"preferredLanguage\": \"English\",\n        \"allergies\": \"None\",\n        \"chronicConditions\": \"None\",\n        \"createdAt\": \"2026-05-01T11:26:59.510Z\",\n        \"updatedAt\": \"2026-05-01T11:40:07.437Z\",\n        \"emergencyEmail\": \"family@example.com\",\n        \"emergencyWhatsApp\": \"+919998887776\",\n        \"phone\": \"+919876543210\",\n        \"picture\": \"https://image-url.com/photo.jpg\"\n    }\n}\n\n ```\n\n---\n\n## Booking Endpoints\n\n### 5\\. Create Booking\n\nCreates a new appointment booking with a doctor.\n\n**Endpoint:** `POST /api/bookings`\n\n**Headers:**\n\n```\nAuthorization: Bearer <token>\n\n ```\n\n**Request Body:**\n\n``` json\n{\n    \"doctorId\": \"string\",\n    \"date\": \"string\",\n    \"timeSlot\": \"string\",\n    \"reason\": \"string\",\n    \"languagePreference\": \"string\",\n    \"doctorName\": \"string\",\n    \"doctorSpecialty\": \"string\"\n}\n\n ```\n\n**Response (201 Created):**\n\n``` json\n{\n    \"success\": true,\n    \"data\": {\n        \"patientId\": \"69f48e032c1f16b06d5379f1\",\n        \"doctorId\": \"65f...123\",\n        \"doctorName\": \"Dr. Smith\",\n        \"doctorSpecialty\": \"Cardiology\",\n        \"date\": \"Tuesday, 30 Apr\",\n        \"timeSlot\": \"10:30 AM\",\n        \"reason\": \"Routine checkup\",\n        \"location\": \"Clinic/Online\",\n        \"languagePreference\": \"English\",\n        \"status\": \"Confirmed\",\n        \"reviewed\": false,\n        \"reminderSent\": false,\n        \"_id\": \"69f491e22c1f16b06d537a08\",\n        \"createdAt\": \"2026-05-01T11:43:30.389Z\",\n        \"updatedAt\": \"2026-05-01T11:43:30.389Z\"\n    }\n}\n\n ```\n\n---\n\n### 6\\. Get Bookings\n\nRetrieves all bookings for the authenticated user.\n\n**Endpoint:** `GET /api/bookings`\n\n**Headers:**\n\n```\nAuthorization: Bearer <token>\n\n ```\n\n**Response (200 OK):**\n\n``` json\n{\n    \"success\": true,\n    \"count\": 2,\n    \"data\": [\n        {\n            \"_id\": \"69f493802c1f16b06d537a14\",\n            \"patientId\": \"69f48e032c1f16b06d5379f1\",\n            \"doctorId\": \"65f...123\",\n            \"doctorName\": \"Dr. Smith\",\n            \"doctorSpecialty\": \"Cardiology\",\n            \"date\": \"Tuesday, 30 Apr\",\n            \"timeSlot\": \"10:30 AM\",\n            \"reason\": \"Routine checkup\",\n            \"location\": \"Clinic/Online\",\n            \"languagePreference\": \"English\",\n            \"status\": \"Completed\",\n            \"reviewed\": false,\n            \"reminderSent\": false,\n            \"createdAt\": \"2026-05-01T11:50:24.605Z\",\n            \"updatedAt\": \"2026-05-01T11:50:24.605Z\"\n        }\n    ]\n}\n\n ```\n\n---\n\n### 7\\. Submit Review\n\nSubmits a review for a completed booking.\n\n**Endpoint:** `POST /api/bookings/:id/review`\n\n**Headers:**\n\n```\nAuthorization: Bearer <token>\n\n ```\n\n**Path Parameters:**  \n| Parameter | Type | Description |  \n|-----------|------|-------------|  \n| id | string | Booking ID |\n\n**Request Body:**\n\n``` json\n{\n    \"rating\": 5,\n    \"text\": \"string\"\n}\n\n ```\n\n**Response (201 Created):**\n\n``` json\n{\n    \"success\": true,\n    \"data\": {\n        \"doctorId\": \"65f...123\",\n        \"bookingId\": \"69f493802c1f16b06d537a14\",\n        \"patientId\": \"69f48e032c1f16b06d5379f1\",\n        \"patientName\": \"John Updated\",\n        \"text\": \"Great experience with the doctor!\",\n        \"rating\": 5,\n        \"travelerType\": \"Tourist\",\n        \"_id\": \"69f494462c1f16b06d537a20\",\n        \"createdAt\": \"2026-05-01T11:53:42.096Z\",\n        \"updatedAt\": \"2026-05-01T11:53:42.096Z\"\n    }\n}\n\n ```\n\n---\n\n## Places/Doctor Search Endpoints\n\n### 8\\. Fetch Nearby Doctors\n\nFinds doctors near a specified location using geolocation.\n\n**Endpoint:** `GET /api/places/nearby-doctors`\n\n**Headers:**\n\n```\nAuthorization: Bearer <token>\n\n ```\n\n**Query Parameters:**  \n| Parameter | Type | Required | Description |  \n|-----------|------|----------|-------------|  \n| lat | number | Yes | Latitude coordinate |  \n| lng | number | Yes | Longitude coordinate |  \n| radius | number | Yes | Search radius in meters |  \n| keyword | string | No | Specialty filter (e.g., \"Cardiologist\") |\n\n**Example:** `/api/places/nearby-doctors?lat=21.17&lng=72.83&radius=5000&keyword=Cardiologist`\n\n**Response (200 OK):**\n\n``` json\n{\n    \"success\": true,\n    \"count\": 34,\n    \"data\": [\n        {\n            \"_id\": \"QXVR29\",\n            \"name\": \"Dr Santosh Yadav Pediatrician Clinic\",\n            \"specialty\": \"Pediatrician\",\n            \"address\": \"Roopal Industrial Society 2, Udhana, Surat, Gujarat, 395017\",\n            \"rating\": 5,\n            \"reviews\": 12,\n            \"languages\": [\"English\", \"Hindi\", \"Gujarati\"],\n            \"verified\": true,\n            \"distance\": \"0.1 km\",\n            \"distanceMeters\": 93\n        }\n    ]\n}\n\n ```\n\n---\n\n### 9\\. Search Doctors\n\nSearches for doctors by name or keyword.\n\n**Endpoint:** `GET /api/places/search-doctors`\n\n**Headers:**\n\n```\nAuthorization: Bearer <token>\n\n ```\n\n**Query Parameters:**  \n| Parameter | Type | Required | Description |  \n|-----------|------|----------|-------------|  \n| query | string | Yes | Search term (doctor/hospital name) |  \n| lat | number | Yes | Latitude for distance calculation |  \n| lng | number | Yes | Longitude for distance calculation |\n\n**Example:** `/api/places/search-doctors?query=Rujul&lat=21.17&lng=72.83`\n\n**Response (200 OK):**\n\n``` json\n{\n    \"success\": true,\n    \"count\": 1,\n    \"data\": [\n        {\n            \"_id\": \"H5HCF6\",\n            \"name\": \"Rujul Hospital\",\n            \"specialty\": \"General Physician\",\n            \"address\": \"1st Floor, Manohar Complex, Opposite Pumping Station, Saiyedpura, District Surat, Surat, Gujarat, 395003\",\n            \"rating\": 4.2,\n            \"reviews\": 75,\n            \"languages\": [\"English\", \"Hindi\", \"Gujarati\"],\n            \"verified\": true,\n            \"distance\": \"4.1 km\",\n            \"distanceMeters\": 4059,\n            \"mapplsPin\": \"H5HCF6\"\n        }\n    ]\n}\n\n ```\n\n---\n\n## Data Models\n\n### User Object\n\n| Field | Type | Description |\n| --- | --- | --- |\n| _id | string | Unique user identifier |\n| name | string | User's full name |\n| email | string | User's email address |\n| role | string | \"Traveler\" or \"Doctor\" |\n| isVerified | boolean | Email verification status |\n| preferredLanguage | string | Preferred language |\n| allergies | string | Known allergies |\n| chronicConditions | string | Chronic health conditions |\n| phone | string | Contact phone number |\n| emergencyEmail | string | Emergency contact email |\n| emergencyWhatsApp | string | Emergency WhatsApp number |\n| picture | string | Profile picture URL |\n\n### Booking Object\n\n| Field | Type | Description |\n| --- | --- | --- |\n| _id | string | Unique booking identifier |\n| patientId | string | Patient's user ID |\n| doctorId | string | Doctor's ID |\n| doctorName | string | Doctor's name |\n| doctorSpecialty | string | Doctor's specialty |\n| date | string | Appointment date |\n| timeSlot | string | Appointment time |\n| reason | string | Reason for visit |\n| location | string | Appointment location |\n| languagePreference | string | Preferred language |\n| status | string | \"Confirmed\" or \"Completed\" |\n| reviewed | boolean | Whether review submitted |\n| reminderSent | boolean | Reminder notification status |\n\n### Doctor Object\n\n| Field | Type | Description |\n| --- | --- | --- |\n| _id | string | Unique doctor/place identifier |\n| name | string | Doctor/Hospital name |\n| specialty | string | Medical specialty |\n| address | string | Full address |\n| rating | number | Average rating (1-5) |\n| reviews | number | Total review count |\n| languages | array | Supported languages |\n| verified | boolean | Verification status |\n| distance | string | Distance from search location |\n| distanceMeters | number | Distance in meters |\n| mapplsPin | string | Mappls location pin |\n\n### Review Object\n\n| Field | Type | Description |\n| --- | --- | --- |\n| _id | string | Unique review identifier |\n| doctorId | string | Doctor's ID |\n| bookingId | string | Associated booking ID |\n| patientId | string | Patient's user ID |\n| patientName | string | Patient's name |\n| text | string | Review text |\n| rating | number | Rating (1-5) |\n| travelerType | string | Type of traveler |\n\n---\n\n## Error Responses\n\nAll endpoints may return the following error responses:\n\n**401 Unauthorized:**\n\n``` json\n{\n    \"success\": false,\n    \"error\": \"Not authorized to access this route\"\n}\n\n ```\n\n**400 Bad Request:**\n\n``` json\n{\n    \"success\": false,\n    \"error\": \"Validation error message\"\n}\n\n ```\n\n**404 Not Found:**\n\n``` json\n{\n    \"success\": false,\n    \"error\": \"Resource not found\"\n}\n\n ```\n\n**500 Server Error:**\n\n``` json\n{\n    \"success\": false,\n    \"error\": \"Server Error\"\n}\n\n ```\n\n---\n\n## Rate Limiting\n\nAPI requests may be subject to rate limiting. Please implement appropriate retry logic with exponential backoff.\n\n## Support\n\nFor API support or issues, please contact the development team.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"50841045","team":12208186,"collectionId":"d79eceb9-bedc-4aa7-a6f4-4e93bd652ec3","publishedId":"2sBXqKnzCC","public":true,"publicUrl":"https://documenter-api.postman.tech/view/50841045/2sBXqKnzCC","privateUrl":"https://go.postman.co/documentation/50841045-d79eceb9-bedc-4aa7-a6f4-4e93bd652ec3","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.11.6","publishDate":"2026-05-01T13:55:23.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/92e61afb3c0b38cd589ab66d0f760c691190440e5b815d173e485b269b11d079","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2sBXqKnzCC"}