{
	"info": {
		"_postman_id": "magik-crm-api-collection",
		"name": "Magik CRM API",
		"description": "Magik CRM API — multi-channel chat CRM platform.\n\nServers:\n- Development: http://localhost:3000\n- Staging: https://sv-staging.magikcrm.com\n- Production: https://sv.magikcrm.com\n\nAuthentication: Bearer Token (JWT) via Authorization header.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"variable": [
		{
			"key": "base_url",
			"value": "http://localhost:3000",
			"type": "string"
		},
		{
			"key": "token",
			"value": "",
			"type": "string"
		}
	],
	"item": [
		{
			"name": "Authentication",
			"item": [
				{
					"name": "Sign In",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"email\": \"user@example.com\",\n  \"password\": \"password123\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/auth/sign_in",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "auth", "sign_in"]
						},
						"description": "Authenticate a user and receive a JWT token. No auth header required."
					},
					"response": []
				},
				{
					"name": "Sign Out",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/auth/sign_out",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "auth", "sign_out"]
						},
						"description": "Sign out the current user and invalidate the JWT token."
					},
					"response": []
				}
			]
		},
		{
			"name": "Users",
			"item": [
				{
					"name": "Create User",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"user\": {\n    \"email\": \"user@example.com\",\n    \"password\": \"password1234\",\n    \"name\": \"John Doe\",\n    \"role\": \"user\",\n    \"color\": \"#F4A29E\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/users",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "users"]
						},
						"description": "Create a new user."
					},
					"response": []
				},
				{
					"name": "Update User",
					"request": {
						"method": "PUT",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"user\": {\n    \"email\": \"user@example.com\",\n    \"password\": \"P@ssw0rd!\",\n    \"name\": \"Jane Doe\",\n    \"first_name\": \"Jane\",\n    \"last_name\": \"Doe\",\n    \"role\": \"user\",\n    \"phone_number\": \"+1234567890\",\n    \"color\": \"#F4A29E\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/users/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "users", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "User ID"
								}
							]
						},
						"description": "Update an existing user by ID."
					},
					"response": []
				},
				{
					"name": "Delete User",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/users/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "users", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "User ID"
								}
							]
						},
						"description": "Delete a user by ID."
					},
					"response": []
				}
			]
		},
		{
			"name": "Contacts",
			"item": [
				{
					"name": "Export Contacts",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/contacts/export?page=1&items_per_page=100&filters[name]&filters[created_from]&filters[created_to]&filters[session_id]&filters[tag_id]&filters[funnel_id]&filters[notifications_enabled]",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "contacts", "export"],
							"query": [
								{
									"key": "page",
									"value": "1"
								},
								{
									"key": "items_per_page",
									"value": "100"
								},
								{
									"key": "filters[name]",
									"value": "",
									"description": "Filter by contact name"
								},
								{
									"key": "filters[created_from]",
									"value": "",
									"description": "Filter by creation date (from)"
								},
								{
									"key": "filters[created_to]",
									"value": "",
									"description": "Filter by creation date (to)"
								},
								{
									"key": "filters[session_id]",
									"value": "",
									"description": "Filter by session ID"
								},
								{
									"key": "filters[tag_id]",
									"value": "",
									"description": "Filter by tag ID"
								},
								{
									"key": "filters[funnel_id]",
									"value": "",
									"description": "Filter by funnel ID"
								},
								{
									"key": "filters[notifications_enabled]",
									"value": "",
									"description": "Filter by notifications enabled"
								}
							]
						},
						"description": "Export contacts with pagination and optional filters."
					},
					"response": []
				},
				{
					"name": "Update Contact",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"contact\": {\n    \"name\": \"John Doe\",\n    \"number\": \"+123456789\",\n    \"notes\": \"VIP customer\",\n    \"email\": \"john@example.com\",\n    \"dob\": \"1990-01-01\",\n    \"gender\": \"female\",\n    \"address\": \"123 Main St\",\n    \"city\": \"New York\",\n    \"country\": \"US\",\n    \"postal_code\": \"10001\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/contacts/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "contacts", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Contact ID"
								}
							]
						},
						"description": "Update a contact by ID."
					},
					"response": []
				},
				{
					"name": "Delete Contacts",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/contacts?ids[]=1&ids[]=2",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "contacts"],
							"query": [
								{
									"key": "ids[]",
									"value": "1"
								},
								{
									"key": "ids[]",
									"value": "2"
								}
							]
						},
						"description": "Delete multiple contacts by IDs."
					},
					"response": []
				}
			]
		},
		{
			"name": "Chats",
			"item": [
				{
					"name": "Update Chat",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat\": {\n    \"tag_ids\": \"1,2,3\",\n    \"email\": \"user@example.com\",\n    \"notifications_enabled\": true,\n    \"funnel_id\": 1,\n    \"agent_id\": 1,\n    \"notes\": \"VIP\",\n    \"open\": true\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/chats/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "chats", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Chat ID"
								}
							]
						},
						"description": "Update a chat by ID."
					},
					"response": []
				},
				{
					"name": "Import Contacts",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "file",
									"type": "file",
									"src": "",
									"description": "CSV or Excel file with contacts to import"
								}
							]
						},
						"url": {
							"raw": "{{base_url}}/api/v1/chats/import_contacts",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "chats", "import_contacts"]
						},
						"description": "Import contacts from a file (multipart/form-data)."
					},
					"response": []
				},
				{
					"name": "Update Contact DOB",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat_id\": 1,\n  \"dob\": \"1990-01-01\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/chats/update_contact_dob",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "chats", "update_contact_dob"]
						},
						"description": "Update the date of birth for a contact associated with a chat."
					},
					"response": []
				}
			]
		},
		{
			"name": "Messages",
			"item": [
				{
					"name": "Create Message",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"message\": {\n    \"chat_id\": \"1\",\n    \"message\": \"This is a test message\",\n    \"message_type\": \"text\",\n    \"is_webchat\": \"false\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/messages",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "messages"]
						},
						"description": "Send a new message to a chat."
					},
					"response": []
				}
			]
		},
		{
			"name": "Internal Messages",
			"item": [
				{
					"name": "Create Internal Message",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat_id\": 1,\n  \"message\": \"This is an internal message\",\n  \"sticker_id\": null\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/internal_messages",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "internal_messages"]
						},
						"description": "Create a new internal message."
					},
					"response": []
				},
				{
					"name": "Update Internal Message",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"content\": \"Updated internal message\",\n  \"mimetype\": \"text/plain\",\n  \"state\": \"success\",\n  \"sticker_id\": null,\n  \"notification_data\": {}\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/internal_messages/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "internal_messages", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Internal Message ID"
								}
							]
						},
						"description": "Update an internal message by ID."
					},
					"response": []
				},
				{
					"name": "Delete Internal Message",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/internal_messages/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "internal_messages", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Internal Message ID"
								}
							]
						},
						"description": "Delete an internal message by ID."
					},
					"response": []
				}
			]
		},
		{
			"name": "Meetings",
			"item": [
				{
					"name": "Create Meeting",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"meeting\": {\n    \"title\": \"Team Sync\",\n    \"description\": \"Weekly team sync meeting\",\n    \"location\": \"Conference Room A\",\n    \"start_time\": \"2025-08-10T10:00:00\",\n    \"end_time\": \"2025-08-10T11:00:00\",\n    \"timezone\": \"Asia/Kolkata\",\n    \"agent_ids\": [1, 2],\n    \"attendees\": [\"user@example.com\"],\n    \"is_recurring\": false\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/meetings",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "meetings"]
						},
						"description": "Create a new meeting."
					},
					"response": []
				},
				{
					"name": "Update Meeting",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"meeting\": {\n    \"title\": \"Updated Team Sync\",\n    \"description\": \"Updated weekly sync\",\n    \"start_time\": \"2025-08-08T10:30:00+05:30\",\n    \"end_time\": \"2025-08-08T11:30:00+05:30\",\n    \"status\": \"scheduled\",\n    \"color_code\": \"#FFAA00\",\n    \"agent_ids\": [1, 3],\n    \"attendees\": [\"client@example.com\"]\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/meetings/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "meetings", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Meeting ID"
								}
							]
						},
						"description": "Update a meeting by ID."
					},
					"response": []
				},
				{
					"name": "Delete Meeting",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/meetings/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "meetings", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Meeting ID"
								}
							]
						},
						"description": "Delete a meeting by ID."
					},
					"response": []
				}
			]
		},
		{
			"name": "Sales",
			"item": [
				{
					"name": "Create Sale",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"sale\": {\n    \"chat_id\": 1,\n    \"funnel_id\": 1,\n    \"notes\": \"Initial sale note\",\n    \"contact_id\": 1,\n    \"agent_id\": 1,\n    \"currency\": \"USD\",\n    \"products\": [\n      {\n        \"product_id\": 1,\n        \"currency\": \"USD\",\n        \"left_quantity\": 1\n      }\n    ]\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/sales",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "sales"]
						},
						"description": "Create a new sale."
					},
					"response": []
				},
				{
					"name": "Update Sale",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"sale\": {\n    \"funnel_id\": 1,\n    \"notes\": \"Updated sale note\",\n    \"currency\": \"USD\",\n    \"products\": [\n      {\n        \"product_id\": 1\n      }\n    ]\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/sales/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "sales", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Sale ID"
								}
							]
						},
						"description": "Update a sale by ID."
					},
					"response": []
				},
				{
					"name": "Delete Sale",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"comment\": \"Reason for deletion\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/sales/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "sales", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Sale ID"
								}
							]
						},
						"description": "Delete a sale by ID with a reason comment."
					},
					"response": []
				},
				{
					"name": "Add Sale Comment",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"sales_comment\": {\n    \"content\": \"This is a test comment\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/sales/:id/comments",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "sales", ":id", "comments"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Sale ID"
								}
							]
						},
						"description": "Add a comment to a sale."
					},
					"response": []
				}
			]
		},
		{
			"name": "Tags",
			"item": [
				{
					"name": "Create Tag",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"name\": \"New Tag\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/tags",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tags"]
						},
						"description": "Create a new tag."
					},
					"response": []
				},
				{
					"name": "Update Tag",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"tag\": {\n    \"name\": \"Updated Tag\",\n    \"color\": \"#FF00FF\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/tags/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tags", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Tag ID"
								}
							]
						},
						"description": "Update a tag by ID."
					},
					"response": []
				},
				{
					"name": "Delete Tag",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/tags/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "tags", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Tag ID"
								}
							]
						},
						"description": "Delete a tag by ID."
					},
					"response": []
				}
			]
		},
		{
			"name": "Funnels",
			"item": [
				{
					"name": "Create Funnel",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"funnel\": {\n    \"name\": \"Sales Funnel\",\n    \"workspace_id\": 1,\n    \"is_sale\": true,\n    \"notifications_enabled\": true\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/funnels",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "funnels"]
						},
						"description": "Create a new funnel."
					},
					"response": []
				},
				{
					"name": "Update Funnel",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"funnel\": {\n    \"name\": \"Updated Funnel\",\n    \"lft\": 2,\n    \"color\": \"#FFAA00\",\n    \"notifications_enabled\": true,\n    \"hidden\": false,\n    \"icon\": \"mdi-filter\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/funnels/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "funnels", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Funnel ID"
								}
							]
						},
						"description": "Update a funnel by ID."
					},
					"response": []
				}
			]
		},
		{
			"name": "Leaderboard Tasks",
			"item": [
				{
					"name": "Create Leaderboard Task",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"leaderboard_task\": {\n    \"board_id\": 12,\n    \"funnel_id\": 34,\n    \"title\": \"Prepare launch checklist\",\n    \"description\": \"<p>Landing page QA</p>\",\n    \"points\": 5,\n    \"assignees\": [\"Ana\", \"Bruno\"],\n    \"start_date\": \"2026-03-18\",\n    \"due_date\": \"2026-03-21\",\n    \"completed\": false,\n    \"checklists\": [\n      {\n        \"title\": \"Launch\",\n        \"items\": [\n          {\n            \"text\": \"Review copy\",\n            \"checked\": true\n          }\n        ]\n      }\n    ]\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/leaderboard_tasks",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "leaderboard_tasks"]
						},
						"description": "Create a new leaderboard task."
					},
					"response": []
				},
				{
					"name": "Update Leaderboard Task",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"leaderboard_task\": {\n    \"title\": \"Updated task\",\n    \"points\": 10,\n    \"completed\": true\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/leaderboard_tasks/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "leaderboard_tasks", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Leaderboard Task ID"
								}
							]
						},
						"description": "Update a leaderboard task by ID."
					},
					"response": []
				},
				{
					"name": "Delete Leaderboard Task",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/leaderboard_tasks/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "leaderboard_tasks", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Leaderboard Task ID"
								}
							]
						},
						"description": "Delete a leaderboard task by ID."
					},
					"response": []
				}
			]
		},
		{
			"name": "Program Messages",
			"item": [
				{
					"name": "Create Program Message",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"program_message\": {\n    \"source_type\": \"bot\",\n    \"source_id\": 1,\n    \"start_time\": \"2025-08-12T10:00:00Z\",\n    \"content\": \"Your message content here\",\n    \"mimetype\": \"text/plain\",\n    \"frequency\": \"daily\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/program_messages",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "program_messages"]
						},
						"description": "Create a new program message."
					},
					"response": []
				},
				{
					"name": "Update Program Message",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"program_message\": {\n    \"start_time\": \"2025-08-12T10:00:00Z\",\n    \"content\": \"Updated program message\",\n    \"status\": \"active\",\n    \"frequency\": \"daily\",\n    \"interval\": 1,\n    \"end_type\": \"never\"\n  }\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/program_messages/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "program_messages", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Program Message ID"
								}
							]
						},
						"description": "Update a program message by ID."
					},
					"response": []
				},
				{
					"name": "Delete Program Message",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/program_messages/:id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "program_messages", ":id"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Program Message ID"
								}
							]
						},
						"description": "Delete a program message by ID."
					},
					"response": []
				},
				{
					"name": "Update Program Message Status",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"status\": \"pause\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/program_messages/:id/status",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "program_messages", ":id", "status"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Program Message ID"
								}
							]
						},
						"description": "Update the status of a program message (e.g., pause, resume)."
					},
					"response": []
				}
			]
		},
		{
			"name": "Play (Casino)",
			"item": [
				{
					"name": "Edit Chips",
					"request": {
						"method": "PATCH",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat_id\": 10,\n  \"amount\": 50.0,\n  \"operation\": \"add\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/play/edit_chips",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "play", "edit_chips"]
						},
						"description": "Add or remove chips for a casino user."
					},
					"response": []
				},
				{
					"name": "Check Casino User",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"name\": \"testuser\",\n  \"chat_id\": 1\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/play/check_casino_user",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "play", "check_casino_user"]
						},
						"description": "Check if a casino user exists."
					},
					"response": []
				},
				{
					"name": "Create Casino User",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat_id\": 1,\n  \"name\": \"testuser\",\n  \"user_id\": \"123\",\n  \"hall_id\": \"1\",\n  \"password\": \"pass123\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/play/create_casino_user",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "play", "create_casino_user"]
						},
						"description": "Create a new casino user."
					},
					"response": []
				},
				{
					"name": "Get Balance",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat_id\": 1\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/play/balance",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "play", "balance"]
						},
						"description": "Get the balance for a casino user."
					},
					"response": []
				},
				{
					"name": "Move Halls",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat_id\": 1,\n  \"hall_id\": \"2\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/play/move_halls",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "play", "move_halls"]
						},
						"description": "Move a casino user to a different hall."
					},
					"response": []
				},
				{
					"name": "Sync Casino User",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"chat_id\": 1,\n  \"name\": \"testuser\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/play/sync_casino_user",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "play", "sync_casino_user"]
						},
						"description": "Sync a casino user's data."
					},
					"response": []
				}
			]
		},
		{
			"name": "Notifications",
			"item": [
				{
					"name": "Unregister Device",
					"request": {
						"method": "DELETE",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"device_id\": \"device-abc-123\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/notifications/unregister_device_by_id",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "notifications", "unregister_device_by_id"]
						},
						"description": "Unregister a device by its device ID."
					},
					"response": []
				},
				{
					"name": "Send Notification",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"user_ids\": [1, 2],\n  \"notification\": {\n    \"title\": \"Alert\",\n    \"body\": \"Something happened\",\n    \"image\": \"\"\n  },\n  \"data\": {}\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/notifications/send",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "notifications", "send"]
						},
						"description": "Send a notification to specific users."
					},
					"response": []
				},
				{
					"name": "Broadcast Notification",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"notification\": {\n    \"title\": \"Broadcast\",\n    \"body\": \"Message to all\"\n  },\n  \"data\": {}\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/notifications/broadcast",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "notifications", "broadcast"]
						},
						"description": "Broadcast a notification to all users."
					},
					"response": []
				},
				{
					"name": "Send to Topic",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"topic\": \"general\",\n  \"notification\": {\n    \"title\": \"Topic Alert\",\n    \"body\": \"Message\"\n  },\n  \"data\": {},\n  \"platform\": \"android\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/notifications/send_to_topic",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "notifications", "send_to_topic"]
						},
						"description": "Send a notification to a specific topic."
					},
					"response": []
				},
				{
					"name": "List Devices",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/notifications/devices",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "notifications", "devices"]
						},
						"description": "List all registered devices."
					},
					"response": []
				},
				{
					"name": "Test Notification",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/notifications/test",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "notifications", "test"]
						},
						"description": "Send a test notification."
					},
					"response": []
				}
			]
		},
		{
			"name": "Stories",
			"item": [
				{
					"name": "Publish Story",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"session_id\": 1,\n  \"type\": \"text\",\n  \"text\": \"Hello World\",\n  \"background_color\": \"#000000\",\n  \"sync\": true\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/stories/publish",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "publish"]
						},
						"description": "Publish a single story."
					},
					"response": []
				},
				{
					"name": "Publish Bulk Stories",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"platform\": \"whatsapp\",\n  \"session_ids\": [1, 2],\n  \"story\": {\n    \"type\": \"text\",\n    \"text\": \"Bulk story\"\n  },\n  \"campaign_name\": \"My Campaign\",\n  \"max_concurrent\": 5,\n  \"fail_fast\": false,\n  \"sync\": false\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/stories/publish_bulk",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "publish_bulk"]
						},
						"description": "Publish stories in bulk to multiple sessions."
					},
					"response": []
				},
				{
					"name": "Get Story Status",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/stories/status/:id?platform=whatsapp",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "status", ":id"],
							"query": [
								{
									"key": "platform",
									"value": "whatsapp"
								}
							],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Story/Publication ID"
								}
							]
						},
						"description": "Get the status of a published story."
					},
					"response": []
				},
				{
					"name": "Create Campaign",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"name\": \"My Campaign\",\n  \"platform\": \"whatsapp\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/stories/campaigns",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "campaigns"]
						},
						"description": "Create a new story campaign."
					},
					"response": []
				},
				{
					"name": "List Campaigns",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/stories/campaigns?status=&platform=&page=&per_page=",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "campaigns"],
							"query": [
								{
									"key": "status",
									"value": "",
									"description": "Filter by campaign status"
								},
								{
									"key": "platform",
									"value": "",
									"description": "Filter by platform"
								},
								{
									"key": "page",
									"value": "",
									"description": "Page number"
								},
								{
									"key": "per_page",
									"value": "",
									"description": "Items per page"
								}
							]
						},
						"description": "List all story campaigns with optional filters."
					},
					"response": []
				},
				{
					"name": "Get Campaign",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/stories/campaigns/:id?include_publications=true",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "campaigns", ":id"],
							"query": [
								{
									"key": "include_publications",
									"value": "true",
									"description": "Include publication details"
								}
							],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Campaign ID"
								}
							]
						},
						"description": "Get a specific campaign by ID."
					},
					"response": []
				},
				{
					"name": "Publish Campaign",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"session_ids\": [1, 2],\n  \"story\": {\n    \"type\": \"image\",\n    \"media\": \"base64...\"\n  },\n  \"max_concurrent\": 5,\n  \"fail_fast\": false,\n  \"sync\": false\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/stories/campaigns/:id/publish",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "campaigns", ":id", "publish"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Campaign ID"
								}
							]
						},
						"description": "Publish a story to a campaign."
					},
					"response": []
				},
				{
					"name": "Retry Campaign Publications",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"publication_ids\": [1, 2]\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/stories/campaigns/:id/retry",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "campaigns", ":id", "retry"],
							"variable": [
								{
									"key": "id",
									"value": "1",
									"description": "Campaign ID"
								}
							]
						},
						"description": "Retry failed publications in a campaign."
					},
					"response": []
				},
				{
					"name": "Get Instagram Stories",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/stories/instagram?session_id=1&fields=id,timestamp",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "instagram"],
							"query": [
								{
									"key": "session_id",
									"value": "1",
									"description": "Session ID"
								},
								{
									"key": "fields",
									"value": "id,timestamp",
									"description": "Comma-separated list of fields to return"
								}
							]
						},
						"description": "Get Instagram stories for a session."
					},
					"response": []
				},
				{
					"name": "Get Instagram Stories Bulk",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/stories/instagram/bulk?session_ids[]=1&session_ids[]=2",
							"host": ["{{base_url}}"],
							"path": ["api", "stories", "instagram", "bulk"],
							"query": [
								{
									"key": "session_ids[]",
									"value": "1"
								},
								{
									"key": "session_ids[]",
									"value": "2"
								}
							]
						},
						"description": "Get Instagram stories for multiple sessions."
					},
					"response": []
				}
			]
		},
		{
			"name": "Web Chat Withdraw Receipts",
			"item": [
				{
					"name": "Create Withdraw Receipt",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"withdraw_request_id\": 1,\n  \"provider_request_id\": \"req-123\",\n  \"receipt_delivery_id\": \"del-456\",\n  \"receipt_file_name\": \"receipt.pdf\",\n  \"receipt_file_mimetype\": \"application/pdf\",\n  \"receipt_file_data\": \"base64data...\"\n}"
						},
						"url": {
							"raw": "{{base_url}}/api/v1/web_chat/withdraw_receipts",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "web_chat", "withdraw_receipts"]
						},
						"description": "Create a withdraw receipt for web chat."
					},
					"response": []
				}
			]
		},
		{
			"name": "Statistics & Reports",
			"item": [
				{
					"name": "Get Chat Stats",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/statistics/chat_stats",
							"host": ["{{base_url}}"],
							"path": ["api", "statistics", "chat_stats"]
						},
						"description": "Get chat statistics."
					},
					"response": []
				},
				{
					"name": "Export Delay Report",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json"
							},
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"start_date\": \"2025-07-01\",\n  \"end_date\": \"2025-07-21\",\n  \"user_id\": 6\n}"
						},
						"url": {
							"raw": "{{base_url}}/exports/delay_report",
							"host": ["{{base_url}}"],
							"path": ["exports", "delay_report"]
						},
						"description": "Export a delay report for a specific user and date range."
					},
					"response": []
				}
			]
		},
		{
			"name": "Events",
			"item": [
				{
					"name": "List Events",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/api/v1/events?model=Contact&id=1",
							"host": ["{{base_url}}"],
							"path": ["api", "v1", "events"],
							"query": [
								{
									"key": "model",
									"value": "Contact",
									"description": "Model type (e.g., Contact)"
								},
								{
									"key": "id",
									"value": "1",
									"description": "Model ID"
								}
							]
						},
						"description": "List events for a specific model and ID."
					},
					"response": []
				}
			]
		},
		{
			"name": "Health & Utilities",
			"item": [
				{
					"name": "Health Check",
					"request": {
						"method": "GET",
						"header": [
							{
								"key": "Authorization",
								"value": "Bearer {{token}}"
							}
						],
						"url": {
							"raw": "{{base_url}}/health",
							"host": ["{{base_url}}"],
							"path": ["health"]
						},
						"description": "Check the health status of the API."
					},
					"response": []
				}
			]
		}
	]
}