Request Format Guide

PulsePI supports both single and batch (multi) requests to invoke logic-based modules and actions.

Request Structure

All requests to PulsePI follow a consistent structure:

Required Fields:

  • module: The module you want to interact with
  • action: The specific action to perform
  • params: Parameters for the action (can be empty)

Single Request Format

Use this format when you want to call a single module with one action.

json
{
  "module": "posts",
  "action": "getPosts",
  "params": {}
}

Response Format

json
{
  "status": "success",
  "data": [
    {
      "id": 1,
      "title": "First post",
      "content": "This is the first post"
    },
    {
      "id": 2,
      "title": "Second post",
      "content": "This is the second post"
    }
  ],
  "meta": {
    "executedAt": "2025-04-17T14:00:00.000Z"
  }
}

Batch (Multi) Request Format

Use this format to call multiple modules and/or actions in a single request.

json
{
  "module": ["posts", "user", "blog"],
  "action": [["getPosts", "getUsers"], "list", "getTrendingPosts"],
  "params": [{}, {}, {}]
}
  • Each module[i] corresponds to action[i].
  • If action[i] is an array, multiple actions will run under that module.
  • Params are applied in order, one per action.

Batch Response Format

json
{
  "status": "multi-success",
  "results": {
    "posts": {
      "getPosts": [
        {
          "id": 1,
          "title": "First post",
          "content": "This is the first post"
        },
        {
          "id": 2,
          "title": "Second post",
          "content": "This is the second post"
        }
      ],
      "getUsers": [
        {
          "id": 1,
          "name": "John Doe"
        },
        {
          "id": 2,
          "name": "Jane Smith"
        }
      ]
    },
    "user": {
      "list": [
        {
          "_id": "6800e57a2631bfc62c9e3d30"
        },
        {
          "_id": "6800fa432df5c382263faee5",
          "name": "Test1",
          "email": "test@mail.com"
        }
      ]
    },
    "blog": {
      "getTrendingPosts": [
        {
          "id": 1,
          "title": "Trending Post 1",
          "content": "This is the trending post content"
        },
        {
          "id": 2,
          "title": "Trending Post 2",
          "content": "This is the trending post content"
        }
      ]
    }
  },
  "meta": {
    "executedAt": "2025-04-17T14:00:00.000Z"
  }
}