{
  "info": {
    "_postman_id": "6f2f2d5e-7a0c-4c4e-8c3e-8f2a3e5a3b11",
    "name": "PBX AlephoraX API",
    "description": "Postman collection for https://pbx.alephorax.com/api",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://pbx.alephorax.com/api"
    },
    {
      "key": "token",
      "value": ""
    },
    {
      "key": "device_token",
      "value": ""
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{token}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Login",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"agent@example.com\",\n  \"password\": \"password123\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "login"
              ]
            }
          }
        },
        {
          "name": "Mobile Profile",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/mobile/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "mobile",
                "profile"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Mobile Call Logs",
      "item": [
        {
          "name": "List Call Logs",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/mobile/call-logs?per_page=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "mobile",
                "call-logs"
              ],
              "query": [
                {
                  "key": "per_page",
                  "value": "20"
                }
              ]
            }
          }
        },
        {
          "name": "Create Call Log",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone_number\": \"+8801712345678\",\n  \"call_type\": \"outgoing\",\n  \"duration_seconds\": 120,\n  \"cost_amount\": 10.5,\n  \"network_type\": \"4G\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/mobile/call-logs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "mobile",
                "call-logs"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Source Device",
      "item": [
        {
          "name": "Heartbeat",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"device_token\": \"{{device_token}}\",\n  \"battery_level\": 90,\n  \"network_type\": \"4G\",\n  \"app_status\": \"running\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/source/heartbeat",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "source",
                "heartbeat"
              ]
            }
          }
        },
        {
          "name": "Call Status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"device_token\": \"{{device_token}}\",\n  \"call_id\": \"CALL-12345\",\n  \"status\": \"CALL_ENDED\",\n  \"start_time\": \"2026-05-22T10:00:00Z\",\n  \"answer_time\": \"2026-05-22T10:00:10Z\",\n  \"end_time\": \"2026-05-22T10:02:00Z\",\n  \"duration_seconds\": 110,\n  \"error_message\": null\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/source/call-status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "source",
                "call-status"
              ]
            }
          }
        },
        {
          "name": "Next Command",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"device_token\": \"{{device_token}}\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/source/next-command",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "source",
                "next-command"
              ]
            }
          }
        },
        {
          "name": "Logs",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"device_token\": \"{{device_token}}\",\n  \"level\": \"info\",\n  \"message\": \"Source app started successfully.\",\n  \"context\": {\n    \"version\": \"1.0.0\"\n  },\n  \"created_at\": \"2026-05-22T10:00:00Z\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/source/logs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "source",
                "logs"
              ]
            }
          }
        },
        {
          "name": "SMS Status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{}"
            },
            "url": {
              "raw": "{{baseUrl}}/source/sms-status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "source",
                "sms-status"
              ]
            }
          }
        },
        {
          "name": "USSD Status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"device_token\": \"{{device_token}}\",\n  \"command_id\": \"CMD-12345\",\n  \"ussd_code\": \"*123#\",\n  \"status\": \"USSD_REPLY\",\n  \"reply_text\": \"Balance: 100\",\n  \"error_message\": null\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/source/ussd-status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "source",
                "ussd-status"
              ]
            }
          }
        }
      ]
    }
  ]
}
