{
	"info": {
		"_postman_id": "public-api-notification-microservice",
		"name": "Notification Microservice - Public API",
		"description": "Streamlined Postman collection for integrating your application with the Notification Microservice.\n\n**This collection includes only essential endpoints for the core integration workflow:**\n1. Health Check - Verify service connectivity\n2. Authentication - User registration, login, and token refresh\n3. User Management - Get profile, update push tokens, and Pusher authentication\n4. Events - Send events from your application to trigger notifications\n5. Notifications - List, acknowledge, and get unread count\n\n**Integration Flow:**\n- Your Application → Sends Events → Notification Service → Creates Notifications → Delivers to Users → Your Application\n\n**See CATHOLICPAY_INTEGRATION_FLOW.md for detailed integration examples and patterns.**",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "notification-microservice-public"
	},
	"item": [
		{
			"name": "1. Setup & Health",
			"item": [
				{
					"name": "Health Check",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response has status field\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('status');",
									"    pm.expect(jsonData.status).to.eql('ok');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "{{BASE_URL}}/health",
							"host": ["{{BASE_URL}}"],
							"path": ["health"]
						},
						"description": "Basic health check endpoint. No authentication required. Use this to verify the service is running."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [],
								"url": {
									"raw": "{{BASE_URL}}/health",
									"host": ["{{BASE_URL}}"],
									"path": ["health"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"status\": \"ok\",\n  \"timestamp\": \"2024-01-15T10:30:00.000Z\"\n}"
						}
					]
				},
				{
					"name": "Project Status Check",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Project is active\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('status');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/projects/me/status",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "projects", "me", "status"]
						},
						"description": "Check if your project is active and accessible. Requires API key authentication."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/projects/me/status",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "projects", "me", "status"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"status\": \"ok\",\n  \"timestamp\": \"2024-01-15T10:30:00.000Z\",\n  \"message\": \"Project is active and accessible\"\n}"
						}
					]
				}
			],
			"description": "Health check and project status verification endpoints.\n\n**Use Cases:**\n- Verify notification service is running\n- Check project connectivity\n- Monitor service health\n- Integration testing\n\n**Integration:**\n- Call health check endpoint during application startup\n- Use project status check to verify API credentials\n- Monitor service availability"
		},
		{
			"name": "2. Authentication",
			"item": [
				{
					"name": "User Registration",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 201\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"pm.test(\"Response contains access token\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('accessToken');",
									"    pm.expect(jsonData).to.have.property('refreshToken');",
									"    ",
									"    // Save tokens to collection variables",
									"    pm.collectionVariables.set('jwt_token', jsonData.accessToken);",
									"    pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"email\": \"user@example.com\",\n  \"password\": \"securePassword123!\",\n  \"fullName\": \"John Doe\",\n  \"externalUserId\": \"ext_user_123\",\n  \"roles\": [\"user\"]\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{BASE_URL}}/api/v1/auth/register",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "auth", "register"]
						},
						"description": "Register a new user in the notification service.\n\n**Flow:**\n1. User registers with email/password\n2. User is created with status = 'pending'\n3. JWT tokens are returned BUT user cannot use them yet\n4. Admin must approve user via POST /api/v1/users/:id/approve\n5. User status changes to 'active'\n6. User can now login via POST /api/v1/auth/login\n\n**Important:**\n- Requires API key authentication (X-API-Key and X-API-Secret)\n- User receives tokens but cannot login until approved\n- See AUTHENTICATION_FLOW.md for complete workflow\n\n**Alternative:** Use POST /api/v1/users for server-to-server user creation (no tokens returned)"
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									},
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"email\": \"user@example.com\",\n  \"password\": \"securePassword123!\",\n  \"fullName\": \"John Doe\",\n  \"externalUserId\": \"ext_user_123\",\n  \"roles\": [\"user\"]\n}"
								},
								"url": {
									"raw": "{{BASE_URL}}/api/v1/auth/register",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "auth", "register"]
								}
							},
							"status": "Created",
							"code": 201,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC05YWJjLWRlZmctMDEyMy00NTY3LTg5MGFiY2RlZjAxMiIsImVtYWlsIjoidXNlckBleGFtcGxlLmNvbSIsInJvbGVzIjpbInVzZXIiXSwicHJvamVjdElkIjoicHJvamVjdF8xMjMiLCJpYXQiOjE3MDUzMjE4MDAsImV4cCI6MTcwNTMyNTQwMH0.example\",\n  \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC05YWJjLWRlZmctMDEyMy00NTY3LTg5MGFiY2RlZjAxMiIsInR5cGUiOiJyZWZyZXNoIiwiaWF0IjoxNzA1MzIxODAwLCJleHAiOjE3MDYxODU4MDB9.example\",\n  \"user\": {\n    \"id\": \"12345678-9abc-def0-1234-567890abcdef01\",\n    \"email\": \"user@example.com\",\n    \"fullName\": \"John Doe\",\n    \"roles\": [\"user\"],\n    \"status\": \"pending\"\n  }\n}"
						}
					]
				},
				{
					"name": "User Login",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains access token\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('accessToken');",
									"    pm.expect(jsonData).to.have.property('refreshToken');",
									"    ",
									"    // Save tokens to collection variables",
									"    pm.collectionVariables.set('jwt_token', jsonData.accessToken);",
									"    pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"email\": \"user@example.com\",\n  \"password\": \"securePassword123!\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{BASE_URL}}/api/v1/auth/login",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "auth", "login"]
						},
						"description": "Login and receive JWT access token and refresh token.\n\n**Requirements:**\n- User must exist in the project\n- User must have status = 'active' (not 'pending', 'disabled', or 'unverified')\n- Correct email and password\n\n**Flow:**\n1. User provides email/password\n2. System verifies credentials\n3. System checks user status (must be 'active')\n4. If valid, returns JWT tokens\n5. User can now access protected endpoints\n\n**Note:** This endpoint requires API key authentication (X-API-Key and X-API-Secret headers) to identify the project.\n\n**If user is pending:** You'll get error: \"User account is pending. Please contact an administrator.\"\n**Solution:** Admin must approve user via POST /api/v1/users/:id/approve"
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									},
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"email\": \"user@example.com\",\n  \"password\": \"securePassword123!\"\n}"
								},
								"url": {
									"raw": "{{BASE_URL}}/api/v1/auth/login",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "auth", "login"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC05YWJjLWRlZmctMDEyMy00NTY3LTg5MGFiY2RlZjAxMiIsImVtYWlsIjoidXNlckBleGFtcGxlLmNvbSIsInJvbGVzIjpbInVzZXIiXSwicHJvamVjdElkIjoicHJvamVjdF8xMjMiLCJpYXQiOjE3MDUzMjE4MDAsImV4cCI6MTcwNTMyNTQwMH0.example\",\n  \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC05YWJjLWRlZmctMDEyMy00NTY3LTg5MGFiY2RlZjAxMiIsInR5cGUiOiJyZWZyZXNoIiwiaWF0IjoxNzA1MzIxODAwLCJleHAiOjE3MDYxODU4MDB9.example\",\n  \"user\": {\n    \"id\": \"12345678-9abc-def0-1234-567890abcdef01\",\n    \"email\": \"user@example.com\",\n    \"fullName\": \"John Doe\",\n    \"roles\": [\"user\"],\n    \"status\": \"active\"\n  }\n}"
						}
					]
				},
				{
					"name": "Refresh Token",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains new access token\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('accessToken');",
									"    pm.expect(jsonData).to.have.property('refreshToken');",
									"    ",
									"    // Save new tokens to collection variables",
									"    pm.collectionVariables.set('jwt_token', jsonData.accessToken);",
									"    pm.collectionVariables.set('refresh_token', jsonData.refreshToken);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"refreshToken\": \"{{refresh_token}}\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{BASE_URL}}/api/v1/auth/refresh",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "auth", "refresh"]
						},
						"description": "Refresh the access token using a refresh token. This endpoint is public and doesn't require authentication. Use this when your access token expires (typically after 1 hour)."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"refreshToken\": \"{{refresh_token}}\"\n}"
								},
								"url": {
									"raw": "{{BASE_URL}}/api/v1/auth/refresh",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "auth", "refresh"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC05YWJjLWRlZmctMDEyMy00NTY3LTg5MGFiY2RlZjAxMiIsImVtYWlsIjoidXNlckBleGFtcGxlLmNvbSIsInJvbGVzIjpbInVzZXIiXSwicHJvamVjdElkIjoicHJvamVjdF8xMjMiLCJpYXQiOjE3MDUzMjU0MDAsImV4cCI6MTcwNTMyOTAwMH0.new\",\n  \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC05YWJjLWRlZmctMDEyMy00NTY3LTg5MGFiY2RlZjAxMiIsInR5cGUiOiJyZWZyZXNoIiwiaWF0IjoxNzA1MzI1NDAwLCJleHAiOjE3MDYxODk0MDB9.new\",\n  \"user\": {\n    \"id\": \"12345678-9abc-def0-1234-567890abcdef01\",\n    \"email\": \"user@example.com\",\n    \"fullName\": \"John Doe\",\n    \"roles\": [\"user\"],\n    \"status\": \"active\"\n  }\n}"
						}
					]
				}
			],
			"description": "User authentication endpoints.\n\n**Authentication Flow:**\n1. Register: POST /api/v1/auth/register (creates user with 'pending' status)\n2. Admin Approval: POST /api/v1/users/:id/approve (changes status to 'active')\n3. Login: POST /api/v1/auth/login (only 'active' users can login)\n4. Refresh: POST /api/v1/auth/refresh (get new tokens when expired)\n\n**Two Authentication Types:**\n- API Key Auth: For registration/login (identifies project)\n- JWT Auth: For user operations (identifies user)\n\nSee AUTHENTICATION_FLOW.md for detailed explanation."
		},
		{
			"name": "3. User Management",
			"item": [
				{
					"name": "Get Current User Profile",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains user data\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('id');",
									"    pm.expect(jsonData).to.have.property('email');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/users/me",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "users", "me"]
						},
						"description": "Get the current authenticated user's profile information. Requires JWT authentication."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/users/me",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "users", "me"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"12345678-9abc-def0-1234-567890abcdef01\",\n  \"email\": \"user@example.com\",\n  \"fullName\": \"John Doe\",\n  \"phone\": \"+1234567890\",\n  \"roles\": [\"user\"],\n  \"status\": \"active\",\n  \"externalUserId\": \"ext_user_123\",\n  \"pushTokens\": {\n    \"fcm\": \"fcm_token_here_for_android\",\n    \"apns\": \"apns_token_here_for_ios\"\n  },\n  \"soundEnabled\": true,\n  \"createdAt\": \"2024-01-15T10:00:00.000Z\",\n  \"updatedAt\": \"2024-01-15T10:30:00.000Z\",\n  \"lastLoginAt\": \"2024-01-15T10:30:00.000Z\"\n}"
						}
					]
				},
				{
					"name": "Update Current User Profile",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"fullName\": \"John Updated Doe\",\n  \"phone\": \"+1234567890\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{BASE_URL}}/api/v1/users/me",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "users", "me"]
						},
						"description": "Update the current authenticated user's profile. Only provided fields will be updated. Requires JWT authentication."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "PATCH",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									},
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"fullName\": \"John Updated Doe\",\n  \"phone\": \"+1234567890\"\n}"
								},
								"url": {
									"raw": "{{BASE_URL}}/api/v1/users/me",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "users", "me"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"12345678-9abc-def0-1234-567890abcdef01\",\n  \"email\": \"user@example.com\",\n  \"fullName\": \"John Updated Doe\",\n  \"phone\": \"+1234567890\",\n  \"roles\": [\"user\"],\n  \"status\": \"active\",\n  \"externalUserId\": \"ext_user_123\",\n  \"pushTokens\": {\n    \"fcm\": \"fcm_token_here_for_android\",\n    \"apns\": \"apns_token_here_for_ios\"\n  },\n  \"soundEnabled\": true,\n  \"createdAt\": \"2024-01-15T10:00:00.000Z\",\n  \"updatedAt\": \"2024-01-15T10:35:00.000Z\",\n  \"lastLoginAt\": \"2024-01-15T10:30:00.000Z\"\n}"
						}
					]
				},
				{
					"name": "Update Push Notification Tokens",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"fcm\": \"fcm_token_here_for_android\",\n  \"apns\": \"apns_token_here_for_ios\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{BASE_URL}}/api/v1/users/me/push-tokens",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "users", "me", "push-tokens"]
						},
						"description": "Update push notification tokens for the current user. Provide FCM token for Android devices and APNS token for iOS devices. These tokens are used to send push notifications when the user is offline.\n\n**Integration:**\n- Call this endpoint when user logs into your mobile app\n- Update tokens when device token changes (e.g., app reinstall)\n- Required for offline push notifications (FCM/APNs)\n\n**Flow:**\n1. User logs into your mobile app\n2. App gets FCM/APNs token from device\n3. App calls this endpoint with tokens\n4. Notification service stores tokens\n5. When user is offline, notifications are sent via push\n\n**Note:** Update these tokens whenever the user logs in or the device token changes. See CATHOLICPAY_INTEGRATION_FLOW.md for integration examples."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "PATCH",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									},
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"fcm\": \"fcm_token_here_for_android\",\n  \"apns\": \"apns_token_here_for_ios\"\n}"
								},
								"url": {
									"raw": "{{BASE_URL}}/api/v1/users/me/push-tokens",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "users", "me", "push-tokens"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"12345678-9abc-def0-1234-567890abcdef01\",\n  \"pushTokens\": {\n    \"fcm\": \"fcm_token_here_for_android\",\n    \"apns\": \"apns_token_here_for_ios\"\n  },\n  \"updatedAt\": \"2024-01-15T10:40:00.000Z\"\n}"
						}
					]
				},
				{
					"name": "Get Pusher Authentication",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains auth signature\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('auth');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/users/me/pusher-auth?socket_id=123.456&channel_name=private-user-{{user_id}}",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "users", "me", "pusher-auth"],
							"query": [
								{
									"key": "socket_id",
									"value": "123.456",
									"description": "Pusher socket ID"
								},
								{
									"key": "channel_name",
									"value": "private-user-{{user_id}}",
									"description": "Pusher channel name (e.g., private-user-123)"
								}
							]
						},
						"description": "Get Pusher authentication signature for private channels. This is used when initializing Pusher on the client side to authenticate private channel subscriptions.\n\n**Integration Flow:**\n1. User logs into your application\n2. Your app gets JWT token from notification service\n3. Initialize Pusher with this auth endpoint\n4. Subscribe to user's private channel: `private-user-{userId}`\n5. Receive real-time notifications via Pusher\n\n**Usage in client code:**\n```javascript\nconst pusher = new Pusher('YOUR_PUSHER_KEY', {\n  cluster: 'us2',\n  authEndpoint: 'https://notification-service.com/api/v1/users/me/pusher-auth',\n  auth: {\n    headers: {\n      Authorization: `Bearer ${jwtToken}`\n    }\n  }\n});\n\n// Subscribe to user's notification channel\nconst channel = pusher.subscribe(`private-user-${userId}`);\nchannel.bind('notification', (data) => {\n  // Display notification in your app\n  showNotification(data);\n});\n```\n\n**See CATHOLICPAY_INTEGRATION_FLOW.md for complete client-side integration examples.**"
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/users/me/pusher-auth?socket_id=123.456&channel_name=private-user-{{user_id}}",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "users", "me", "pusher-auth"],
									"query": [
										{
											"key": "socket_id",
											"value": "123.456"
										},
										{
											"key": "channel_name",
											"value": "private-user-{{user_id}}"
										}
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"auth\": \"pusher_app_key:signature_here\"\n}"
						}
					]
				}
			],
			"description": "User profile management endpoints.\n\n**All endpoints require JWT authentication** (Authorization: Bearer <jwt_token>)\n\n**Available Operations:**\n- Get current user profile\n- Update profile information\n- Update push notification tokens (FCM/APNS)\n- Get Pusher authentication for real-time channels\n\n**Integration:**\n- Display user profile in your application\n- Sync user information between your app and notification service\n- Configure push notifications for mobile apps\n- Setup real-time notification channels via Pusher\n\n**Note:** These endpoints use JWT tokens obtained from login, not API keys. See AUTHENTICATION_FLOW.md for authentication details."
		},
		{
			"name": "4. Events",
			"item": [
				{
					"name": "Create Event",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 201\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"pm.test(\"Response contains event ID\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('id');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"type\": \"pending_transaction\",\n  \"payload\": {\n    \"transactionId\": \"TX_123\",\n    \"amount\": 50000,\n    \"currency\": \"NGN\",\n    \"status\": \"pending\",\n    \"userId\": \"user_123\"\n  },\n  \"clientEventId\": \"client_event_123\"\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{BASE_URL}}/api/v1/events",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "events"]
						},
						"description": "Ingest a new event into the notification system. Events are automatically evaluated against active rules, and notifications are created and delivered accordingly.\n\n**Event Flow:**\n1. Your application sends event (e.g., transaction created, payment successful)\n2. Event is ingested and stored\n3. Active rules are evaluated against the event\n4. Matching rules create notifications for target users/roles\n5. Notifications are delivered via Pusher (if user is online) or queued for push notification (if user is offline)\n6. Webhook is triggered (if configured)\n\n**Common Event Types:**\n- `pending_transaction` - Transaction awaiting approval\n- `payment_successful` - Payment completed\n- `payment_failed` - Payment failed\n- `balance_update` - Account balance changed\n- `transaction_approved` - Transaction approved\n- `transaction_rejected` - Transaction rejected\n\n**Example Use Case:**\nWhen a user makes a payment in your app, send a `payment_successful` event. The notification service will evaluate rules and send notifications to relevant users.\n\n**Note:** Requires API key authentication (server-to-server). See CATHOLICPAY_INTEGRATION_FLOW.md for integration examples."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									},
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"type\": \"pending_transaction\",\n  \"payload\": {\n    \"transactionId\": \"TX_123\",\n    \"amount\": 50000,\n    \"currency\": \"NGN\",\n    \"status\": \"pending\",\n    \"userId\": \"user_123\"\n  },\n  \"clientEventId\": \"client_event_123\"\n}"
								},
								"url": {
									"raw": "{{BASE_URL}}/api/v1/events",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "events"]
								}
							},
							"status": "Created",
							"code": 201,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"event-uuid-1234-5678-90ab-cdef\",\n  \"type\": \"pending_transaction\",\n  \"payload\": {\n    \"transactionId\": \"TX_123\",\n    \"amount\": 50000,\n    \"currency\": \"NGN\",\n    \"status\": \"pending\",\n    \"userId\": \"user_123\"\n  },\n  \"clientEventId\": \"client_event_123\",\n  \"projectId\": \"project_123\",\n  \"receivedAt\": \"2024-01-15T10:45:00.000Z\",\n  \"createdAt\": \"2024-01-15T10:45:00.000Z\"\n}"
						}
					]
				},
				{
					"name": "Create Batch Events",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 201\", function () {",
									"    pm.response.to.have.status(201);",
									"});",
									"",
									"pm.test(\"Response contains results array\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('results');",
									"    pm.expect(jsonData.results).to.be.an('array');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"events\": [\n    {\n      \"type\": \"pending_transaction\",\n      \"payload\": {\n        \"transactionId\": \"TX_123\",\n        \"amount\": 50000,\n        \"currency\": \"NGN\"\n      },\n      \"clientEventId\": \"client_event_123\"\n    },\n    {\n      \"type\": \"balance_update\",\n      \"payload\": {\n        \"accountId\": \"ACC_456\",\n        \"newBalance\": 1000000,\n        \"currency\": \"NGN\"\n      },\n      \"clientEventId\": \"client_event_456\"\n    }\n  ]\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "{{BASE_URL}}/api/v1/events/batch",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "events", "batch"]
						},
						"description": "Ingest multiple events in a single request. This is more efficient than sending individual events when you need to send multiple events at once.\n\n**Use Cases:**\n- Bulk import of historical events\n- Batch processing of transactions\n- Synchronizing events from external systems\n- Reducing API calls when processing multiple events\n\n**Example:**\nWhen processing multiple transactions, send them all in one batch request instead of individual API calls.\n\n**Note:** Requires API key authentication (server-to-server)."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "Content-Type",
										"value": "application/json"
									},
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"body": {
									"mode": "raw",
									"raw": "{\n  \"events\": [\n    {\n      \"type\": \"pending_transaction\",\n      \"payload\": {\n        \"transactionId\": \"TX_123\",\n        \"amount\": 50000,\n        \"currency\": \"NGN\"\n      },\n      \"clientEventId\": \"client_event_123\"\n    },\n    {\n      \"type\": \"balance_update\",\n      \"payload\": {\n        \"accountId\": \"ACC_456\",\n        \"newBalance\": 1000000,\n        \"currency\": \"NGN\"\n      },\n      \"clientEventId\": \"client_event_456\"\n    }\n  ]\n}"
								},
								"url": {
									"raw": "{{BASE_URL}}/api/v1/events/batch",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "events", "batch"]
								}
							},
							"status": "Created",
							"code": 201,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"results\": [\n    {\n      \"id\": \"event-uuid-1234-5678-90ab-cdef\",\n      \"type\": \"pending_transaction\",\n      \"clientEventId\": \"client_event_123\",\n      \"status\": \"success\"\n    },\n    {\n      \"id\": \"event-uuid-5678-90ab-cdef-1234\",\n      \"type\": \"balance_update\",\n      \"clientEventId\": \"client_event_456\",\n      \"status\": \"success\"\n    }\n  ],\n  \"total\": 2,\n  \"successful\": 2,\n  \"failed\": 0\n}"
						}
					]
				},
				{
					"name": "Get Event by ID",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains event data\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('id');",
									"    pm.expect(jsonData).to.have.property('type');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/events/:event_id",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "events", ":event_id"],
							"variable": [
								{
									"key": "event_id",
									"value": "event-uuid-here",
									"description": "Event UUID"
								}
							]
						},
						"description": "Get event details by ID. Useful for tracking event processing status and debugging.\n\n**Note:** Requires API key authentication (server-to-server)."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/events/:event_id",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "events", ":event_id"],
									"variable": [
										{
											"key": "event_id",
											"value": "event-uuid-here"
										}
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"event-uuid-1234-5678-90ab-cdef\",\n  \"type\": \"pending_transaction\",\n  \"payload\": {\n    \"transactionId\": \"TX_123\",\n    \"amount\": 50000,\n    \"currency\": \"NGN\",\n    \"status\": \"pending\",\n    \"userId\": \"user_123\"\n  },\n  \"clientEventId\": \"client_event_123\",\n  \"projectId\": \"project_123\",\n  \"receivedAt\": \"2024-01-15T10:45:00.000Z\",\n  \"createdAt\": \"2024-01-15T10:45:00.000Z\"\n}"
						}
					]
				}
			],
			"description": "Event ingestion endpoints. Send events from your application to trigger notification rules and create notifications.\n\n**Integration Pattern:**\n1. Something happens in your application (transaction, payment, etc.)\n2. Your app sends event to notification service\n3. Notification service evaluates rules\n4. Notifications are created and delivered\n\n**Common Events:**\n- Transaction events: `pending_transaction`, `transaction_approved`, `transaction_rejected`\n- Payment events: `payment_successful`, `payment_failed`, `payment_initiated`\n- Account events: `balance_update`, `account_created`, `account_updated`\n- User events: `user_registered`, `user_verified`, `user_action`\n\n**See CATHOLICPAY_INTEGRATION_FLOW.md for detailed integration examples and event patterns.**"
		},
		{
			"name": "5. Notifications",
			"item": [
				{
					"name": "List Notifications",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains notifications array\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('data');",
									"    pm.expect(jsonData.data).to.be.an('array');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/notifications?page=1&limit=20",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "notifications"],
							"query": [
								{
									"key": "page",
									"value": "1",
									"description": "Page number (default: 1)"
								},
								{
									"key": "limit",
									"value": "20",
									"description": "Items per page (default: 20, max: 100)"
								}
							]
						},
						"description": "Get paginated list of notifications for the current authenticated user. Notifications are returned in reverse chronological order (newest first).\n\n**Use Cases:**\n- Display notification center in your application\n- Show notification history\n- Build notification inbox UI\n\n**Response includes:**\n- Notification ID, title, message\n- Status (unread, read, acknowledged)\n- Created timestamp\n- Associated event data\n- Sound and action (if configured)\n\n**Integration:**\nCall this endpoint from your application's notification center to display all notifications for the logged-in user."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/notifications?page=1&limit=20",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "notifications"],
									"query": [
										{
											"key": "page",
											"value": "1"
										},
										{
											"key": "limit",
											"value": "20"
										}
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"data\": [\n    {\n      \"id\": \"notif-uuid-1234-5678-90ab-cdef\",\n      \"title\": \"High Value Transaction\",\n      \"message\": \"Transaction TX_123 for ₦50,000 is pending\",\n      \"status\": \"unread\",\n      \"sound\": \"alert.mp3\",\n      \"action\": {\n        \"type\": \"open_webview\",\n        \"url\": \"https://app.example.com/transactions/TX_123\",\n        \"editableAddressBar\": true\n      },\n      \"eventId\": \"event-uuid-1234-5678-90ab-cdef\",\n      \"ruleId\": \"rule-uuid-1234-5678-90ab-cdef\",\n      \"createdAt\": \"2024-01-15T10:45:00.000Z\",\n      \"acknowledgedAt\": null\n    },\n    {\n      \"id\": \"notif-uuid-5678-90ab-cdef-1234\",\n      \"title\": \"Balance Updated\",\n      \"message\": \"Your account balance has been updated to ₦1,000,000\",\n      \"status\": \"acknowledged\",\n      \"sound\": null,\n      \"action\": null,\n      \"eventId\": \"event-uuid-5678-90ab-cdef-1234\",\n      \"ruleId\": \"rule-uuid-5678-90ab-cdef-1234\",\n      \"createdAt\": \"2024-01-15T10:30:00.000Z\",\n      \"acknowledgedAt\": \"2024-01-15T10:35:00.000Z\"\n    }\n  ],\n  \"meta\": {\n    \"page\": 1,\n    \"limit\": 20,\n    \"total\": 45,\n    \"totalPages\": 3\n  }\n}"
						}
					]
				},
				{
					"name": "Get Notification by ID",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains notification data\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('id');",
									"    pm.expect(jsonData).to.have.property('title');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/notifications/:notification_id",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "notifications", ":notification_id"],
							"variable": [
								{
									"key": "notification_id",
									"value": "notification-uuid-here",
									"description": "Notification UUID"
								}
							]
						},
						"description": "Get detailed information about a specific notification. The notification must belong to the current authenticated user."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/notifications/:notification_id",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "notifications", ":notification_id"],
									"variable": [
										{
											"key": "notification_id",
											"value": "notification-uuid-here"
										}
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"notif-uuid-1234-5678-90ab-cdef\",\n  \"title\": \"High Value Transaction\",\n  \"message\": \"Transaction TX_123 for ₦50,000 is pending\",\n  \"status\": \"unread\",\n  \"sound\": \"alert.mp3\",\n  \"action\": {\n    \"type\": \"open_webview\",\n    \"url\": \"https://app.example.com/transactions/TX_123\",\n    \"editableAddressBar\": true\n  },\n  \"eventId\": \"event-uuid-1234-5678-90ab-cdef\",\n  \"ruleId\": \"rule-uuid-1234-5678-90ab-cdef\",\n  \"event\": {\n    \"id\": \"event-uuid-1234-5678-90ab-cdef\",\n    \"type\": \"pending_transaction\",\n    \"payload\": {\n      \"transactionId\": \"TX_123\",\n      \"amount\": 50000,\n      \"currency\": \"NGN\",\n      \"status\": \"pending\"\n    }\n  },\n  \"createdAt\": \"2024-01-15T10:45:00.000Z\",\n  \"acknowledgedAt\": null\n}"
						}
					]
				},
				{
					"name": "Acknowledge Notification",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Notification is acknowledged\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('acknowledgedAt');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/notifications/:notification_id/acknowledge",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "notifications", ":notification_id", "acknowledge"],
							"variable": [
								{
									"key": "notification_id",
									"value": "notification-uuid-here",
									"description": "Notification UUID"
								}
							]
						},
						"description": "Mark a notification as acknowledged by the current user. This indicates the user has seen and interacted with the notification. Acknowledged notifications may trigger webhook events if configured."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/notifications/:notification_id/acknowledge",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "notifications", ":notification_id", "acknowledge"],
									"variable": [
										{
											"key": "notification_id",
											"value": "notification-uuid-here"
										}
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"notif-uuid-1234-5678-90ab-cdef\",\n  \"title\": \"High Value Transaction\",\n  \"message\": \"Transaction TX_123 for ₦50,000 is pending\",\n  \"status\": \"acknowledged\",\n  \"sound\": \"alert.mp3\",\n  \"action\": {\n    \"type\": \"open_webview\",\n    \"url\": \"https://app.example.com/transactions/TX_123\",\n    \"editableAddressBar\": true\n  },\n  \"eventId\": \"event-uuid-1234-5678-90ab-cdef\",\n  \"ruleId\": \"rule-uuid-1234-5678-90ab-cdef\",\n  \"createdAt\": \"2024-01-15T10:45:00.000Z\",\n  \"acknowledgedAt\": \"2024-01-15T10:50:00.000Z\"\n}"
						}
					]
				},
				{
					"name": "Get Unread Count",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains count\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('count');",
									"    pm.expect(jsonData.count).to.be.a('number');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/notifications/unread/count",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "notifications", "unread", "count"]
						},
						"description": "Get the count of unread notifications for the current authenticated user. Useful for displaying a badge or notification indicator in your UI.\n\n**Use Cases:**\n- Display unread count badge on notification icon\n- Show notification indicator in app header\n- Update badge count in real-time\n\n**Integration:**\nPoll this endpoint periodically or call it when user opens your app to show unread notification count."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/notifications/unread/count",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "notifications", "unread", "count"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"count\": 5\n}"
						}
					]
				}
			],
			"description": "Notification management endpoints. List, view, and acknowledge notifications for the authenticated user.\n\n**Integration:**\n- Build notification center in your application\n- Display notification history\n- Track notification engagement\n- Show unread count badges\n\n**Client-Side Integration:**\n- Fetch notifications to display in your app\n- Mark notifications as acknowledged when user interacts\n- Poll for unread count to show badges\n- Combine with Pusher for real-time updates\n\n**See CATHOLICPAY_INTEGRATION_FLOW.md for client-side integration examples.**"
		},
		{
			"name": "6. Rules (Read-Only)",
			"item": [
				{
					"name": "List Rules",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains rules array\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.be.an('array');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/rules",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "rules"]
						},
						"description": "List all active notification rules for the current project. Rules define when and how notifications are created based on events.\n\n**Note:** Regular users can view rules, but only admins and rule managers can create, update, or delete rules."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/rules",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "rules"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "[\n  {\n    \"id\": \"rule-uuid-1234-5678-90ab-cdef\",\n    \"name\": \"High Value Transaction Alert\",\n    \"condition\": \"event.type == 'pending_transaction' && event.payload.amount > 10000\",\n    \"targetRoles\": [\"admin\", \"finance\"],\n    \"title\": \"High Value Transaction\",\n    \"message\": \"Transaction {{event.payload.transactionId}} for {{event.payload.amount}} is pending\",\n    \"sound\": \"alert.mp3\",\n    \"action\": {\n      \"type\": \"open_webview\",\n      \"url\": \"https://app.example.com/transactions/{{event.payload.transactionId}}\",\n      \"editableAddressBar\": true\n    },\n    \"priority\": 10,\n    \"active\": true,\n    \"createdAt\": \"2024-01-15T09:00:00.000Z\",\n    \"updatedAt\": \"2024-01-15T09:00:00.000Z\"\n  },\n  {\n    \"id\": \"rule-uuid-5678-90ab-cdef-1234\",\n    \"name\": \"Balance Update Notification\",\n    \"condition\": \"event.type == 'balance_update'\",\n    \"targetRoles\": [\"user\"],\n    \"title\": \"Balance Updated\",\n    \"message\": \"Your account balance has been updated to {{event.payload.newBalance}}\",\n    \"sound\": null,\n    \"action\": null,\n    \"priority\": 5,\n    \"active\": true,\n    \"createdAt\": \"2024-01-15T08:00:00.000Z\",\n    \"updatedAt\": \"2024-01-15T08:00:00.000Z\"\n  }\n]"
						}
					]
				},
				{
					"name": "Get Rule by ID",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains rule data\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('id');",
									"    pm.expect(jsonData).to.have.property('name');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{jwt_token}}",
								"description": "JWT access token"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/rules/:rule_id",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "rules", ":rule_id"],
							"variable": [
								{
									"key": "rule_id",
									"value": "rule-uuid-here",
									"description": "Rule UUID"
								}
							]
						},
						"description": "Get detailed information about a specific notification rule. Includes rule condition, target roles, notification template, and status."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "Authorization",
										"value": "Bearer {{jwt_token}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/rules/:rule_id",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "rules", ":rule_id"],
									"variable": [
										{
											"key": "rule_id",
											"value": "rule-uuid-here"
										}
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"rule-uuid-1234-5678-90ab-cdef\",\n  \"name\": \"High Value Transaction Alert\",\n  \"condition\": \"event.type == 'pending_transaction' && event.payload.amount > 10000\",\n  \"targetRoles\": [\"admin\", \"finance\"],\n  \"title\": \"High Value Transaction\",\n  \"message\": \"Transaction {{event.payload.transactionId}} for {{event.payload.amount}} is pending\",\n  \"sound\": \"alert.mp3\",\n  \"action\": {\n    \"type\": \"open_webview\",\n    \"url\": \"https://app.example.com/transactions/{{event.payload.transactionId}}\",\n    \"editableAddressBar\": true\n  },\n  \"priority\": 10,\n  \"active\": true,\n  \"createdBy\": \"user-uuid-1234\",\n  \"createdAt\": \"2024-01-15T09:00:00.000Z\",\n  \"updatedAt\": \"2024-01-15T09:00:00.000Z\"\n}"
						}
					]
				}
			],
			"description": "Read-only access to notification rules. View active rules that determine when notifications are created.\n\n**What are Rules?**\nRules define when and how notifications are created based on events. For example:\n- \"Send notification when transaction amount > ₦10,000\"\n- \"Notify admins when payment fails\"\n- \"Alert users when balance is low\"\n\n**Use Cases:**\n- View active notification rules in your application\n- Understand what triggers notifications\n- Debug notification delivery issues\n\n**Note:** Regular users can view rules, but only admins and rule managers can create, update, or delete rules."
		},
		{
			"name": "7. Project & Billing",
			"item": [
				{
					"name": "Get Current Project",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains project data\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('id');",
									"    pm.expect(jsonData).to.have.property('name');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/projects/me",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "projects", "me"]
						},
						"description": "Get current project details including name, status, plan, and configuration. Requires API key authentication."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/projects/me",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "projects", "me"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"id\": \"project-uuid-1234-5678-90ab-cdef\",\n  \"name\": \"My Application\",\n  \"status\": \"active\",\n  \"plan\": \"professional\",\n  \"billingEmail\": \"billing@myapp.com\",\n  \"webhookUrl\": \"https://myapp.com/webhooks/notifications\",\n  \"apiKey\": \"pk_dev_abc123...\",\n  \"pusherConfig\": {\n    \"appId\": \"pusher_app_id\",\n    \"key\": \"pusher_key\",\n    \"cluster\": \"us2\"\n  },\n  \"createdAt\": \"2024-01-01T00:00:00.000Z\",\n  \"updatedAt\": \"2024-01-15T10:00:00.000Z\"\n}"
						}
					]
				},
				{
					"name": "Get Billing Information",
					"event": [
						{
							"listen": "test",
							"script": {
								"exec": [
									"pm.test(\"Status code is 200\", function () {",
									"    pm.response.to.have.status(200);",
									"});",
									"",
									"pm.test(\"Response contains billing data\", function () {",
									"    var jsonData = pm.response.json();",
									"    pm.expect(jsonData).to.have.property('plan');",
									"});"
								],
								"type": "text/javascript"
							}
						}
					],
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "X-API-Key",
								"value": "{{API_KEY}}",
								"description": "Your project API key"
							},
							{
								"key": "X-API-Secret",
								"value": "{{API_SECRET}}",
								"description": "Your project API secret"
							}
						],
						"url": {
							"raw": "{{BASE_URL}}/api/v1/billing",
							"host": ["{{BASE_URL}}"],
							"path": ["api", "v1", "billing"]
						},
						"description": "Get billing information for the current project including plan details, quota usage, and limits. Requires API key authentication."
					},
					"response": [
						{
							"name": "Success",
							"originalRequest": {
								"method": "GET",
								"header": [
									{
										"key": "X-API-Key",
										"value": "{{API_KEY}}"
									},
									{
										"key": "X-API-Secret",
										"value": "{{API_SECRET}}"
									}
								],
								"url": {
									"raw": "{{BASE_URL}}/api/v1/billing",
									"host": ["{{BASE_URL}}"],
									"path": ["api", "v1", "billing"]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n  \"plan\": \"professional\",\n  \"billingEmail\": \"billing@myapp.com\",\n  \"quota\": {\n    \"events\": {\n      \"limit\": 100000,\n      \"used\": 45230,\n      \"remaining\": 54770\n    },\n    \"notifications\": {\n      \"limit\": 50000,\n      \"used\": 23450,\n      \"remaining\": 26550\n    },\n    \"users\": {\n      \"limit\": 1000,\n      \"used\": 342,\n      \"remaining\": 658\n    }\n  },\n  \"usage\": {\n    \"eventsThisMonth\": 45230,\n    \"notificationsThisMonth\": 23450,\n    \"activeUsers\": 342\n  },\n  \"billingPeriod\": {\n    \"start\": \"2024-01-01T00:00:00.000Z\",\n    \"end\": \"2024-01-31T23:59:59.999Z\"\n  }\n}"
						}
					]
				}
			],
			"description": "Project and billing information endpoints. Get project details and billing status.\n\n**Use Cases:**\n- Monitor API quota usage\n- Check billing information\n- View project configuration\n- Track notification delivery limits\n\n**Integration:**\n- Display quota usage in your admin dashboard\n- Alert when approaching limits\n- Monitor service health and status"
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					"// Auto-refresh token if expired (optional)",
					"// This is a placeholder - implement based on your token expiry logic"
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					"// Global test script",
					"// Add any global test logic here"
				]
			}
		}
	],
	"variable": [
		{
			"key": "BASE_URL",
			"value": "http://localhost:3000",
			"type": "string",
			"description": "Base URL of the notification microservice"
		},
		{
			"key": "API_KEY",
			"value": "pk_dev_your_API_KEY_here",
			"type": "string",
			"description": "Your project API key (obtained from platform admin)"
		},
		{
			"key": "API_SECRET",
			"value": "sk_dev_your_API_SECRET_here",
			"type": "string",
			"description": "Your project API secret (obtained from platform admin, shown only once)"
		},
		{
			"key": "jwt_token",
			"value": "",
			"type": "string",
			"description": "JWT access token (automatically set after login/register)"
		},
		{
			"key": "refresh_token",
			"value": "",
			"type": "string",
			"description": "JWT refresh token (automatically set after login/register)"
		},
		{
			"key": "user_id",
			"value": "",
			"type": "string",
			"description": "Current user ID (set manually or from user profile response)"
		}
	]
}

