{
  "info": {
    "name": "WRNexus recipient inbox",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Use a short-lived recipient token issued by your backend, never a business API key. Environment and recipient identity are bound by the token. Fill IDs privately before writing. Reuse installationId when the FCM/APNs token rotates. Marketing consent must reflect the actual recipient choice. The stream uses SSE and ends periodically; clients reconnect with a refreshed token. Documentation: https://docs.wrnexus.com/sdk/inbox"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{recipientToken}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://notifications.wrnexus.com",
      "type": "string"
    },
    {
      "key": "platform",
      "value": "android",
      "type": "string"
    },
    {
      "key": "recipientToken",
      "value": "",
      "type": "string"
    },
    {
      "key": "messageId",
      "value": "",
      "type": "string"
    },
    {
      "key": "connectionId",
      "value": "",
      "type": "string"
    },
    {
      "key": "installationId",
      "value": "",
      "type": "string"
    },
    {
      "key": "pushToken",
      "value": "",
      "type": "string"
    },
    {
      "key": "deviceId",
      "value": "",
      "type": "string"
    },
    {
      "key": "dispatchId",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "List messages",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{baseUrl}}/api/v1/inbox/messages?limit=50"
      }
    },
    {
      "name": "Report observed mobile push event",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/mobile-events",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"dispatchId\": \"{{dispatchId}}\",\n  \"deviceId\": \"{{deviceId}}\",\n  \"kind\": \"received\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Mark read",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/messages",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"id\": \"{{messageId}}\",\n  \"action\": \"read\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Archive",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/messages",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"id\": \"{{messageId}}\",\n  \"action\": \"archive\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Preferences and branding",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{baseUrl}}/api/v1/inbox/preferences"
      }
    },
    {
      "name": "Save preferences",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/preferences",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"category\": \"*\",\n  \"inAppEnabled\": true,\n  \"marketingEnabled\": false\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Devices and connections",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{baseUrl}}/api/v1/inbox/devices"
      }
    },
    {
      "name": "Register or rotate mobile token",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/devices",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"action\": \"register-mobile\",\n  \"connectionId\": \"{{connectionId}}\",\n  \"installationId\": \"{{installationId}}\",\n  \"name\": \"Phone\",\n  \"platform\": \"{{platform}}\",\n  \"token\": \"{{pushToken}}\",\n  \"marketingConsent\": false,\n  \"consentEvidence\": \"\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Unregister mobile device",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/devices",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"action\": \"unregister-mobile\",\n  \"deviceId\": \"{{deviceId}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Unregister web device",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/devices",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"action\": \"unregister\",\n  \"deviceId\": \"{{deviceId}}\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Subscribe to inbox stream",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "text/event-stream"
          }
        ],
        "url": "{{baseUrl}}/api/v1/inbox/stream"
      }
    }
  ]
}