{
	"info": {
		"_postman_id": "location-tracker-api-v1",
		"name": "Location Tracker API",
		"description": "Location Tracker App - All API Endpoints\n\nBase URL: {{base_url}}/api\nAuth: Laravel Sanctum Bearer Token",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"variable": [
		{
			"key": "base_url",
			"value": "http://127.0.0.1:8000",
			"type": "string"
		},
		{
			"key": "token",
			"value": "",
			"type": "string"
		},
		{
			"key": "circle_id",
			"value": "1",
			"type": "string"
		},
		{
			"key": "place_id",
			"value": "1",
			"type": "string"
		},
		{
			"key": "user_id",
			"value": "2",
			"type": "string"
		}
	],
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{token}}",
				"type": "string"
			}
		]
	},
	"item": [
		{
			"name": "Auth",
			"description": "Authentication & Profile APIs",
			"item": [
				{
					"name": "Register / Login",
					"event": [
						{
							"listen": "test",
							"script": {
								"type": "text/javascript",
								"exec": [
									"var jsonData = pm.response.json();",
									"if (jsonData.success && jsonData.data && jsonData.data.token) {",
									"    pm.collectionVariables.set('token', jsonData.data.token);",
									"    console.log('Token saved: ' + jsonData.data.token);",
									"}"
								]
							}
						}
					],
					"request": {
						"auth": {
							"type": "noauth"
						},
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Ali Khan\",\n    \"phone\": \"+923001234567\",\n    \"fcm_token\": \"firebase_token_here\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/auth/register",
							"host": ["{{base_url}}"],
							"path": ["api", "auth", "register"]
						},
						"description": "Register ya Login karo phone number se.\nAgar phone exist karta hai toh login, nahi toh naya user ban jayega.\nToken automatically save ho jayega collection variable mein."
					},
					"response": [
						{
							"name": "Success - 201",
							"originalRequest": {
								"method": "POST",
								"url": {
									"raw": "{{base_url}}/api/auth/register",
									"host": ["{{base_url}}"],
									"path": ["api", "auth", "register"]
								}
							},
							"status": "Created",
							"code": 201,
							"body": "{\n    \"success\": true,\n    \"message\": \"User registered successfully\",\n    \"data\": {\n        \"user\": {\n            \"id\": 1,\n            \"name\": \"Ali Khan\",\n            \"phone\": \"+923001234567\",\n            \"avatar_url\": null,\n            \"created_at\": \"2026-03-27T10:00:00.000000Z\",\n            \"updated_at\": \"2026-03-27T10:00:00.000000Z\"\n        },\n        \"token\": \"1|abc123xyz456tokenvalue...\"\n    }\n}"
						}
					]
				},
				{
					"name": "Get Profile (Me)",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/auth/me",
							"host": ["{{base_url}}"],
							"path": ["api", "auth", "me"]
						},
						"description": "Current logged in user ki profile aur latest location return karta hai."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"Ali Khan\",\n        \"phone\": \"+923001234567\",\n        \"avatar_url\": null,\n        \"created_at\": \"2026-03-27T10:00:00.000000Z\",\n        \"updated_at\": \"2026-03-27T10:00:00.000000Z\",\n        \"latest_location\": {\n            \"user_id\": 1,\n            \"latitude\": \"24.8607343\",\n            \"longitude\": \"67.0011364\",\n            \"battery_level\": 85,\n            \"activity_type\": \"still\",\n            \"is_moving\": false,\n            \"updated_at\": \"2026-03-27T10:30:00.000000Z\"\n        }\n    }\n}"
						}
					]
				},
				{
					"name": "Update Profile",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Ali Ahmed Khan\",\n    \"avatar_url\": \"https://example.com/avatar.jpg\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/auth/profile",
							"host": ["{{base_url}}"],
							"path": ["api", "auth", "profile"]
						},
						"description": "User apna naam ya avatar update kar sakta hai.\nDono fields optional hain — jo bhejna ho wo bhejo."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Profile updated successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"Ali Ahmed Khan\",\n        \"phone\": \"+923001234567\",\n        \"avatar_url\": \"https://example.com/avatar.jpg\",\n        \"created_at\": \"2026-03-27T10:00:00.000000Z\",\n        \"updated_at\": \"2026-03-27T11:00:00.000000Z\"\n    }\n}"
						}
					]
				},
				{
					"name": "Update FCM Token",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"fcm_token\": \"new_firebase_token_value_here\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/auth/fcm-token",
							"host": ["{{base_url}}"],
							"path": ["api", "auth", "fcm-token"]
						},
						"description": "Firebase Cloud Messaging token update karna push notifications ke liye."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"FCM token updated successfully\"\n}"
						}
					]
				},
				{
					"name": "Logout",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/auth/logout",
							"host": ["{{base_url}}"],
							"path": ["api", "auth", "logout"]
						},
						"description": "Current token delete kar deta hai. Dobara login karna padega."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Logged out successfully\"\n}"
						}
					]
				}
			]
		},
		{
			"name": "Circles",
			"description": "Circle CRUD APIs",
			"item": [
				{
					"name": "Get All Circles",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles",
							"host": ["{{base_url}}"],
							"path": ["api", "circles"]
						},
						"description": "User jin circles ka member hai wo sab return karta hai with owner & members."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 1,\n            \"name\": \"Family\",\n            \"user_id\": 1,\n            \"invite_code\": \"ABC-XYZ\",\n            \"invite_code_expires_at\": \"2026-03-28T10:00:00.000000Z\",\n            \"owner\": {\n                \"id\": 1,\n                \"name\": \"Ali Khan\",\n                \"phone\": \"+923001234567\",\n                \"avatar_url\": null\n            },\n            \"members\": [\n                {\n                    \"id\": 1,\n                    \"name\": \"Ali Khan\",\n                    \"pivot\": { \"role\": \"admin\" }\n                },\n                {\n                    \"id\": 2,\n                    \"name\": \"Sara Khan\",\n                    \"pivot\": { \"role\": \"member\" }\n                }\n            ]\n        }\n    ]\n}"
						}
					]
				},
				{
					"name": "Create Circle",
					"event": [
						{
							"listen": "test",
							"script": {
								"type": "text/javascript",
								"exec": [
									"var jsonData = pm.response.json();",
									"if (jsonData.success && jsonData.data && jsonData.data.circle) {",
									"    pm.collectionVariables.set('circle_id', jsonData.data.circle.id);",
									"    console.log('Circle ID saved: ' + jsonData.data.circle.id);",
									"}"
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Family\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/circles",
							"host": ["{{base_url}}"],
							"path": ["api", "circles"]
						},
						"description": "Naya circle banata hai.\n- Creator automatically admin member ban jata hai\n- 24 ghante ka invite code generate hota hai\n- Circle ID automatically save ho jayega"
					},
					"response": [
						{
							"name": "Success - 201",
							"status": "Created",
							"code": 201,
							"body": "{\n    \"success\": true,\n    \"message\": \"Circle created successfully\",\n    \"data\": {\n        \"circle\": {\n            \"id\": 1,\n            \"name\": \"Family\",\n            \"user_id\": 1,\n            \"invite_code\": \"ABC-XYZ\",\n            \"invite_code_expires_at\": \"2026-03-28T10:00:00.000000Z\",\n            \"owner\": { \"id\": 1, \"name\": \"Ali Khan\" },\n            \"members\": [{ \"id\": 1, \"name\": \"Ali Khan\", \"pivot\": { \"role\": \"admin\" } }]\n        },\n        \"invite_link\": \"http://your-domain.com/join?code=ABC-XYZ\"\n    }\n}"
						}
					]
				},
				{
					"name": "Get Circle Details",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}"]
						},
						"description": "Ek circle ki poori details — owner, members, aur places sab.\nSirf circle member hi dekh sakta hai."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"Family\",\n        \"user_id\": 1,\n        \"invite_code\": \"ABC-XYZ\",\n        \"owner\": { \"id\": 1, \"name\": \"Ali Khan\" },\n        \"members\": [{ \"id\": 1, \"name\": \"Ali Khan\" }],\n        \"places\": [{ \"id\": 1, \"name\": \"Home\", \"latitude\": \"24.8607343\", \"longitude\": \"67.0011364\", \"radius\": 100 }]\n    }\n}"
						},
						{
							"name": "Not a Member - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"You are not a member of this circle\"\n}"
						}
					]
				},
				{
					"name": "Update Circle Name",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Meri Family\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}"]
						},
						"description": "Circle ka naam change karna. Sirf owner hi kar sakta hai."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Circle updated successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"Meri Family\"\n    }\n}"
						},
						{
							"name": "Not Owner - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"Only the circle owner can update it\"\n}"
						}
					]
				},
				{
					"name": "Delete Circle",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}"]
						},
						"description": "Circle delete karna. Sirf owner hi kar sakta hai.\nSab members aur places bhi delete ho jayenge (cascade)."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Circle deleted successfully\"\n}"
						},
						{
							"name": "Not Owner - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"Only the circle owner can delete it\"\n}"
						}
					]
				}
			]
		},
		{
			"name": "Circle Actions",
			"description": "Join, Leave, Remove Member, Regenerate Code, Members Locations",
			"item": [
				{
					"name": "Join Circle (Invite Code)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"invite_code\": \"ABC-XYZ\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/circles/join",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "join"]
						},
						"description": "Invite code daal ke circle mein join hona.\n- Code case-insensitive hai (abc-xyz = ABC-XYZ)\n- Code 24 ghante baad expire ho jata hai\n- Agar already member ho toh 409 error"
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Successfully joined the circle\",\n    \"data\": {\n        \"id\": 1,\n        \"name\": \"Family\",\n        \"owner\": { \"id\": 1, \"name\": \"Ali Khan\" },\n        \"members\": [\n            { \"id\": 1, \"name\": \"Ali Khan\", \"pivot\": { \"role\": \"admin\" } },\n            { \"id\": 2, \"name\": \"Sara Khan\", \"pivot\": { \"role\": \"member\" } }\n        ]\n    }\n}"
						},
						{
							"name": "Invalid Code - 404",
							"status": "Not Found",
							"code": 404,
							"body": "{\n    \"success\": false,\n    \"message\": \"Invalid invite code\"\n}"
						},
						{
							"name": "Code Expired - 410",
							"status": "Gone",
							"code": 410,
							"body": "{\n    \"success\": false,\n    \"message\": \"Invite code has expired. Ask the circle owner for a new code.\"\n}"
						},
						{
							"name": "Already Member - 409",
							"status": "Conflict",
							"code": 409,
							"body": "{\n    \"success\": false,\n    \"message\": \"You are already a member of this circle\"\n}"
						}
					]
				},
				{
					"name": "Leave Circle",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/leave",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "leave"]
						},
						"description": "Circle chhod dena.\nOwner leave nahi kar sakta — usse circle delete karna padega."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"You have left the circle\"\n}"
						},
						{
							"name": "Owner Cannot Leave - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"Circle owner cannot leave. Delete the circle instead.\"\n}"
						}
					]
				},
				{
					"name": "Remove Member (Owner Only)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"user_id\": {{user_id}}\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/remove-member",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "remove-member"]
						},
						"description": "Owner kisi bhi member ko circle se nikal sakta hai.\nOwner khud ko nahi nikal sakta."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Member removed successfully\"\n}"
						},
						{
							"name": "Not Owner - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"Only the circle owner can remove members\"\n}"
						},
						{
							"name": "Cannot Remove Owner - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"Cannot remove the circle owner\"\n}"
						}
					]
				},
				{
					"name": "Regenerate Invite Code (Owner Only)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/regenerate-code",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "regenerate-code"]
						},
						"description": "Purana code expire karke naya code generate karta hai.\n24 ghante ki nayi expiry ke saath."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Invite code regenerated successfully\",\n    \"data\": {\n        \"invite_code\": \"NEW-COD\",\n        \"invite_code_expires_at\": \"2026-03-28T12:00:00.000000Z\",\n        \"invite_link\": \"http://your-domain.com/join?code=NEW-COD\"\n    }\n}"
						},
						{
							"name": "Not Owner - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"Only the circle owner can regenerate the invite code\"\n}"
						}
					]
				},
				{
					"name": "Get Members with Locations",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/members-locations",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "members-locations"]
						},
						"description": "Circle ke sab members ki latest location.\nMap pe sab members dikhane ke liye use hota hai."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 1,\n            \"name\": \"Ali Khan\",\n            \"phone\": \"+923001234567\",\n            \"avatar_url\": null,\n            \"pivot\": { \"circle_id\": 1, \"user_id\": 1, \"role\": \"admin\" },\n            \"latest_location\": {\n                \"user_id\": 1,\n                \"latitude\": \"24.8607343\",\n                \"longitude\": \"67.0011364\",\n                \"battery_level\": 85,\n                \"activity_type\": \"still\",\n                \"is_moving\": false,\n                \"updated_at\": \"2026-03-27T10:30:00.000000Z\"\n            }\n        },\n        {\n            \"id\": 2,\n            \"name\": \"Sara Khan\",\n            \"phone\": \"+923009876543\",\n            \"avatar_url\": null,\n            \"pivot\": { \"circle_id\": 1, \"user_id\": 2, \"role\": \"member\" },\n            \"latest_location\": {\n                \"user_id\": 2,\n                \"latitude\": \"24.8710000\",\n                \"longitude\": \"67.0280000\",\n                \"battery_level\": 42,\n                \"activity_type\": \"driving\",\n                \"is_moving\": true,\n                \"updated_at\": \"2026-03-27T10:35:00.000000Z\"\n            }\n        }\n    ]\n}"
						},
						{
							"name": "Not a Member - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"You are not a member of this circle\"\n}"
						}
					]
				}
			]
		},
		{
			"name": "Locations",
			"description": "Location tracking APIs - Save & History",
			"item": [
				{
					"name": "Save Single Location",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"latitude\": 24.8607343,\n    \"longitude\": 67.0011364,\n    \"battery_level\": 85,\n    \"activity_type\": \"still\",\n    \"is_moving\": false,\n    \"recorded_at\": \"2026-03-27T10:30:00Z\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/locations",
							"host": ["{{base_url}}"],
							"path": ["api", "locations"]
						},
						"description": "Ek location save karta hai.\n- History mein save hota hai\n- Latest location bhi update ho jata hai\n- activity_type: still, walking, running, driving, cycling, unknown"
					},
					"response": [
						{
							"name": "Success - 201",
							"status": "Created",
							"code": 201,
							"body": "{\n    \"success\": true,\n    \"message\": \"Location saved successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"user_id\": 1,\n        \"latitude\": \"24.8607343\",\n        \"longitude\": \"67.0011364\",\n        \"battery_level\": 85,\n        \"activity_type\": \"still\",\n        \"is_moving\": false,\n        \"recorded_at\": \"2026-03-27T10:30:00.000000Z\",\n        \"created_at\": \"2026-03-27T10:30:05.000000Z\",\n        \"updated_at\": \"2026-03-27T10:30:05.000000Z\"\n    }\n}"
						}
					]
				},
				{
					"name": "Batch Save Locations (Offline Sync)",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"locations\": [\n        {\n            \"latitude\": 24.8607343,\n            \"longitude\": 67.0011364,\n            \"battery_level\": 90,\n            \"activity_type\": \"still\",\n            \"is_moving\": false,\n            \"recorded_at\": \"2026-03-27T09:00:00Z\"\n        },\n        {\n            \"latitude\": 24.8710000,\n            \"longitude\": 67.0280000,\n            \"battery_level\": 85,\n            \"activity_type\": \"driving\",\n            \"is_moving\": true,\n            \"recorded_at\": \"2026-03-27T09:15:00Z\"\n        },\n        {\n            \"latitude\": 24.8800000,\n            \"longitude\": 67.0350000,\n            \"battery_level\": 80,\n            \"activity_type\": \"walking\",\n            \"is_moving\": true,\n            \"recorded_at\": \"2026-03-27T09:30:00Z\"\n        }\n    ]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/locations/batch",
							"host": ["{{base_url}}"],
							"path": ["api", "locations", "batch"]
						},
						"description": "Jab phone offline tha tab ki saari buffered locations ek saath bhejne ke liye.\n- Maximum 500 locations ek batch mein\n- recorded_at required hai batch mein\n- Sabse latest recorded_at wali location se latest_location update hota hai"
					},
					"response": [
						{
							"name": "Success - 201",
							"status": "Created",
							"code": 201,
							"body": "{\n    \"success\": true,\n    \"message\": \"3 locations saved successfully\",\n    \"data\": {\n        \"saved_count\": 3\n    }\n}"
						}
					]
				},
				{
					"name": "Get Location History",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/locations/history?from=2026-03-27&to=2026-03-27&limit=50",
							"host": ["{{base_url}}"],
							"path": ["api", "locations", "history"],
							"query": [
								{
									"key": "from",
									"value": "2026-03-27",
									"description": "Start date (optional)"
								},
								{
									"key": "to",
									"value": "2026-03-27",
									"description": "End date (optional)"
								},
								{
									"key": "limit",
									"value": "50",
									"description": "Max records (1-1000, default: 100)"
								}
							]
						},
						"description": "User ki location history.\n- Date range filter (from, to)\n- Limit filter (default 100, max 1000)\n- Newest first order"
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 3,\n            \"user_id\": 1,\n            \"latitude\": \"24.8800000\",\n            \"longitude\": \"67.0350000\",\n            \"battery_level\": 80,\n            \"activity_type\": \"walking\",\n            \"is_moving\": true,\n            \"recorded_at\": \"2026-03-27T09:30:00.000000Z\"\n        },\n        {\n            \"id\": 2,\n            \"user_id\": 1,\n            \"latitude\": \"24.8710000\",\n            \"longitude\": \"67.0280000\",\n            \"battery_level\": 85,\n            \"activity_type\": \"driving\",\n            \"is_moving\": true,\n            \"recorded_at\": \"2026-03-27T09:15:00.000000Z\"\n        }\n    ]\n}"
						}
					]
				}
			]
		},
		{
			"name": "Places (Geofences)",
			"description": "Place / Geofence CRUD APIs - Nested under Circles",
			"item": [
				{
					"name": "Get All Places in Circle",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/places",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "places"]
						},
						"description": "Circle ke saare places/geofences return karta hai with creator info."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 1,\n            \"circle_id\": 1,\n            \"created_by\": 1,\n            \"name\": \"Home\",\n            \"latitude\": \"24.8607343\",\n            \"longitude\": \"67.0011364\",\n            \"radius\": 100,\n            \"address\": \"House #123, Block A, Gulshan, Karachi\",\n            \"creator\": { \"id\": 1, \"name\": \"Ali Khan\" }\n        },\n        {\n            \"id\": 2,\n            \"circle_id\": 1,\n            \"created_by\": 2,\n            \"name\": \"Office\",\n            \"latitude\": \"24.8710000\",\n            \"longitude\": \"67.0280000\",\n            \"radius\": 200,\n            \"address\": \"I.I. Chundrigar Road, Karachi\",\n            \"creator\": { \"id\": 2, \"name\": \"Sara Khan\" }\n        }\n    ]\n}"
						}
					]
				},
				{
					"name": "Create Place / Geofence",
					"event": [
						{
							"listen": "test",
							"script": {
								"type": "text/javascript",
								"exec": [
									"var jsonData = pm.response.json();",
									"if (jsonData.success && jsonData.data) {",
									"    pm.collectionVariables.set('place_id', jsonData.data.id);",
									"    console.log('Place ID saved: ' + jsonData.data.id);",
									"}"
								]
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Home\",\n    \"latitude\": 24.8607343,\n    \"longitude\": 67.0011364,\n    \"radius\": 150,\n    \"address\": \"House #123, Block A, Gulshan, Karachi\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/places",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "places"]
						},
						"description": "Circle mein naya place/geofence add karna.\n- radius: 50 se 5000 meters (default: 100)\n- Circle ka koi bhi member create kar sakta hai\n- Place ID automatically save ho jayega"
					},
					"response": [
						{
							"name": "Success - 201",
							"status": "Created",
							"code": 201,
							"body": "{\n    \"success\": true,\n    \"message\": \"Place created successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"circle_id\": 1,\n        \"created_by\": 1,\n        \"name\": \"Home\",\n        \"latitude\": \"24.8607343\",\n        \"longitude\": \"67.0011364\",\n        \"radius\": 150,\n        \"address\": \"House #123, Block A, Gulshan, Karachi\",\n        \"creator\": { \"id\": 1, \"name\": \"Ali Khan\" }\n    }\n}"
						}
					]
				},
				{
					"name": "Update Place / Geofence",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							},
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n    \"name\": \"Ghar\",\n    \"radius\": 200,\n    \"address\": \"Updated address here\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/places/{{place_id}}",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "places", "{{place_id}}"]
						},
						"description": "Existing place/geofence ko update karna.\nCircle ka koi bhi member update kar sakta hai.\nSirf wo fields bhejo jo change karni hain."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Place updated successfully\",\n    \"data\": {\n        \"id\": 1,\n        \"circle_id\": 1,\n        \"created_by\": 1,\n        \"name\": \"Ghar\",\n        \"latitude\": \"24.8607343\",\n        \"longitude\": \"67.0011364\",\n        \"radius\": 200,\n        \"address\": \"Updated address here\"\n    }\n}"
						}
					]
				},
				{
					"name": "Delete Place / Geofence",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Accept",
								"value": "application/json"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/circles/{{circle_id}}/places/{{place_id}}",
							"host": ["{{base_url}}"],
							"path": ["api", "circles", "{{circle_id}}", "places", "{{place_id}}"]
						},
						"description": "Place/geofence delete karna.\nSirf circle owner ya place creator delete kar sakta hai."
					},
					"response": [
						{
							"name": "Success - 200",
							"status": "OK",
							"code": 200,
							"body": "{\n    \"success\": true,\n    \"message\": \"Place deleted successfully\"\n}"
						},
						{
							"name": "Not Authorized - 403",
							"status": "Forbidden",
							"code": 403,
							"body": "{\n    \"success\": false,\n    \"message\": \"Only the circle owner or place creator can delete it\"\n}"
						}
					]
				}
			]
		}
	]
}
