{
	"info": {
		"_postman_id": "e080f818-0441-444c-86ce-e4906c36b0e5",
		"name": "STRATAON miniPLC",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "6572756",
		"_collection_link": "https://strataon.postman.co/workspace/Strataon-Workspace~e178a14a-ea4b-4ea7-821a-42c4c5b8f6a5/collection/6572756-e080f818-0441-444c-86ce-e4906c36b0e5?action=share&source=collection_link&creator=6572756"
	},
	"item": [
		{
			"name": "Get IO map",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "http://{{ip_device}}/api/v1/map",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"map"
					]
				},
				"description": "Requires `READ` or `READ/WRITE` token.\n\nGets all available variables on the device.\n\nThe variables are grouped in the following keys:\n\n`di` - digital inputs\n\n`do` - digital outputs\n\n`vb` - virtual booleans\n\n`vl` - virtual longs"
			},
			"response": [
				{
					"name": "Get IO map",
					"originalRequest": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "http://{{ip_device}}/api/v1/map",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"map"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "895"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"di\": [\n        \"DI0\",\n        \"DI1\",\n        \"DI2\",\n        \"DI3\",\n        \"DI4\",\n        \"DI5\",\n        \"DI6\",\n        \"DI7\",\n        \"DI8\",\n        \"DI9\",\n        \"DI10\",\n        \"DI11\",\n        \"DI12\",\n        \"DI13\",\n        \"DI14\",\n        \"DI15\",\n        \"DI16\",\n        \"DI17\",\n        \"DI18\",\n        \"DI19\",\n        \"DI20\",\n        \"DI21\",\n        \"DI22\",\n        \"DI23\",\n        \"DI24\",\n        \"DI25\",\n        \"DI26\",\n        \"DI27\",\n        \"DI28\",\n        \"DI29\",\n        \"DI30\",\n        \"DI31\"\n    ],\n    \"do\": [\n        \"DO0\",\n        \"DO1\",\n        \"DO2\",\n        \"DO3\",\n        \"DO4\",\n        \"DO5\",\n        \"DO6\",\n        \"DO7\",\n        \"DO8\",\n        \"DO9\",\n        \"DO10\",\n        \"DO11\",\n        \"DO12\",\n        \"DO13\",\n        \"DO14\",\n        \"DO15\",\n        \"DO16\",\n        \"DO17\",\n        \"DO18\",\n        \"DO19\",\n        \"DO20\",\n        \"DO21\",\n        \"DO22\",\n        \"DO23\",\n        \"DO24\",\n        \"DO25\",\n        \"DO26\",\n        \"DO27\",\n        \"DO28\",\n        \"DO29\",\n        \"DO30\",\n        \"DO31\"\n    ],\n    \"vb\": [\n        \"VB0\",\n        \"VB1\",\n        \"VB2\",\n        \"VB3\",\n        \"VB4\",\n        \"VB5\",\n        \"VB6\",\n        \"VB7\",\n        \"VB8\",\n        \"VB9\",\n        \"VB10\",\n        \"VB11\",\n        \"VB12\",\n        \"VB13\",\n        \"VB14\",\n        \"VB15\",\n        \"VB16\",\n        \"VB17\",\n        \"VB18\",\n        \"VB19\",\n        \"VB20\",\n        \"VB21\",\n        \"VB22\",\n        \"VB23\",\n        \"VB24\",\n        \"VB25\",\n        \"VB26\",\n        \"VB27\",\n        \"VB28\",\n        \"VB29\",\n        \"VB30\",\n        \"VB31\"\n    ],\n    \"vl\": [\n        \"VL0\",\n        \"VL1\",\n        \"VL2\",\n        \"VL3\",\n        \"VL4\",\n        \"VL5\",\n        \"VL6\",\n        \"VL7\",\n        \"VL8\",\n        \"VL9\",\n        \"VL10\",\n        \"VL11\",\n        \"VL12\",\n        \"VL13\",\n        \"VL14\",\n        \"VL15\",\n        \"VL16\",\n        \"VL17\",\n        \"VL18\",\n        \"VL19\",\n        \"VL20\",\n        \"VL21\",\n        \"VL22\",\n        \"VL23\",\n        \"VL24\",\n        \"VL25\",\n        \"VL26\",\n        \"VL27\",\n        \"VL28\",\n        \"VL29\",\n        \"VL30\",\n        \"VL31\"\n    ]\n}"
				}
			]
		},
		{
			"name": "Get single IO state",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\"value\": true, \"pulse_ms\": 800}"
				},
				"url": {
					"raw": "http://{{ip_device}}/api/v1/io/{{type}}/{{index}}",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"io",
						"{{type}}",
						"{{index}}"
					]
				},
				"description": "Requires `READ` or `READ/WRITE` token.\n\nGets state of a single IO state on device.\n\nType can be:\n\n`di` - digital inputs\n\n`do` - digital outputs\n\n`vb` - virtual booleans\n\n`vl` - virtual longs\n\n---\n\nIndex is the index of the output (`<1-max>`)."
			},
			"response": [
				{
					"name": "Get IO snapshot",
					"originalRequest": {
						"method": "GET",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"value\": true, \"pulse_ms\": 800}"
						},
						"url": {
							"raw": "http://{{ip_device}}/api/v1/io/{{type}}/{{index}}",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"io",
								"{{type}}",
								"{{index}}"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "41"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"kind\": \"di\",\n    \"idx\": 1,\n    \"value\": 1\n}"
				}
			]
		},
		{
			"name": "Get IO snapshot",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"method": "GET",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\"value\": true, \"pulse_ms\": 800}"
				},
				"url": {
					"raw": "http://{{ip_device}}/api/v1/io",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"io"
					]
				},
				"description": "Requires `READ` or `READ/WRITE` token.\n\nGets a current snapshot of all IO state on device, grouped by type.\n\n`di` - digital inputs -- `1=HIGH` `0=LOW`\n\n`do` - digital outputs -- `1=HIGH` `0=LOW`\n\n`vb` - virtual booleans -- bool\n\n`vl` - virtual longs -- integer"
			},
			"response": [
				{
					"name": "Get IO snapshot",
					"originalRequest": {
						"method": "GET",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"value\": true, \"pulse_ms\": 800}"
						},
						"url": {
							"raw": "http://{{ip_device}}/api/v1/io",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"io"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "423"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"di\": [\n        1,\n        1,\n        1,\n        1,\n        1,\n        1,\n        1,\n        1,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0\n    ],\n    \"do\": [\n        0,\n        1,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0\n    ],\n    \"vb\": [\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false,\n        false\n    ],\n    \"vl\": [\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0,\n        0\n    ]\n}"
				}
			]
		},
		{
			"name": "Get date/time",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "http://{{ip_device}}/api/v1/get_datetime",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"get_datetime"
					]
				},
				"description": "Requires `READ` or `READ/WRITE` token.\n\nGets date/time of device in format `dd/mm/yyyy hh:ii:ss`"
			},
			"response": [
				{
					"name": "Get date/time",
					"originalRequest": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "http://{{ip_device}}/api/v1/get_datetime",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"get_datetime"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "63"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"datetime\": \"23/02/2026 15:48:15\",\n    \"epoch\": 1771861695\n}"
				}
			]
		},
		{
			"name": "Info",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "http://{{ip_device}}/api/v1/info",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"info"
					]
				},
				"description": "Requires `READ` or `READ/WRITE` token.\n\nGets general information about device (IP address, serial number, firmware version, etc...)"
			},
			"response": [
				{
					"name": "Info",
					"originalRequest": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "http://{{ip_device}}/api/v1/info",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"info"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "275"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"board_id\": \"miniplc002001\",\n    \"serial_id\": \"002001\",\n    \"version\": \"1.0.6\",\n    \"language\": \"pt_BR\",\n    \"media\": \"wired\",\n    \"mac\": \"3e:e9:0e:8b:94:40\",\n    \"ip\": \"192.168.15.162\",\n    \"dns1\": \"\",\n    \"dns2\": \"\",\n    \"gateway\": \"192.168.15.1\",\n    \"mask\": \"255.255.255.0\",\n    \"runtime\": {\n        \"uptime_s\": 3540,\n        \"epoch\": 1771861606\n    }\n}"
				}
			]
		},
		{
			"name": "Device health",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "http://{{ip_device}}/api/v1/health",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"health"
					]
				},
				"description": "Requires `READ` or `READ/WRITE` token.\n\nGets information about device health (uptime, general status, current date, etc...)"
			},
			"response": [
				{
					"name": "Device health",
					"originalRequest": {
						"method": "GET",
						"header": [],
						"url": {
							"raw": "http://{{ip_device}}/api/v1/health",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"health"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "60"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"status\": \"ok\",\n    \"uptime_s\": 3056,\n    \"epoch\": 1771861122\n}"
				}
			]
		},
		{
			"name": "Set date/time",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\n \"year\": 2026,\n \"mon\": 2,\n \"day\": 23,\n \"hour\": 15,\n \"min\": 49,\n \"sec\": 30\n}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://{{ip_device}}/api/v1/set_datetime",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"set_datetime"
					]
				},
				"description": "Requires `READ/WRITE` token.\n\nSets device current date/time."
			},
			"response": [
				{
					"name": "Set date/time",
					"originalRequest": {
						"method": "POST",
						"header": [],
						"body": {
							"mode": "raw",
							"raw": "{\n \"year\": 2026,\n \"mon\": 2,\n \"day\": 23,\n \"hour\": 15,\n \"min\": 49,\n \"sec\": 30\n}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "http://{{ip_device}}/api/v1/set_datetime",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"set_datetime"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "63"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"datetime\": \"23/02/2026 15:49:30\",\n    \"epoch\": 1771861770\n}"
				}
			]
		},
		{
			"name": "Set digital output state",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\"value\": true}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://{{ip_device}}/api/v1/io/do/{{index}}",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"io",
						"do",
						"{{index}}"
					]
				},
				"description": "Sets a digital output to either LOW (0) or HIGH (0) state.\n\nThe mapping of all digital output available can be seen in the `/api/v1/map` endpoint.\n\n# TL;DR\n\nDigital output from `1-`"
			},
			"response": [
				{
					"name": "Set digital output state",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"value\": true}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "http://{{ip_device}}/api/v1/io/do/1",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"io",
								"do",
								"1"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "41"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"kind\": \"do\",\n    \"idx\": 1,\n    \"value\": 1\n}"
				}
			]
		},
		{
			"name": "Set digital output state - pulse",
			"request": {
				"method": "POST",
				"header": [
					{
						"key": "Content-Type",
						"value": "application/json",
						"type": "text"
					}
				],
				"body": {
					"mode": "raw",
					"raw": "{\"value\": true, \"pulse_ms\": 800}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "http://{{ip_device}}/api/v1/io/do/{{index}}",
					"protocol": "http",
					"host": [
						"{{ip_device}}"
					],
					"path": [
						"api",
						"v1",
						"io",
						"do",
						"{{index}}"
					]
				},
				"description": "Sets a digital output to either LOW (0) or HIGH (0) state for `pulse_ms` miliseconds.\n\nAfter `pulse_ms`, the digital output will be set permanently to the opposite state defined in the `value` field.\n\nThe mapping of all digital output available can be seen in the `/api/v1/map` endpoint.\n\n# TL;DR\n\nDigital output from `1-`"
			},
			"response": [
				{
					"name": "Set digital output state - pulse",
					"originalRequest": {
						"method": "POST",
						"header": [
							{
								"key": "Content-Type",
								"value": "application/json",
								"type": "text"
							}
						],
						"body": {
							"mode": "raw",
							"raw": "{\"value\": true, \"pulse_ms\": 800}",
							"options": {
								"raw": {
									"language": "json"
								}
							}
						},
						"url": {
							"raw": "http://{{ip_device}}/api/v1/io/do/1",
							"protocol": "http",
							"host": [
								"{{ip_device}}"
							],
							"path": [
								"api",
								"v1",
								"io",
								"do",
								"1"
							]
						}
					},
					"status": "OK",
					"code": 200,
					"_postman_previewlanguage": null,
					"header": [
						{
							"key": "Content-Type",
							"value": "application/json"
						},
						{
							"key": "Content-Length",
							"value": "77"
						}
					],
					"cookie": [],
					"body": "{\n    \"ok\": true,\n    \"kind\": \"do\",\n    \"idx\": 1,\n    \"value\": 1,\n    \"pulse_ms\": 800,\n    \"during\": 0,\n    \"final\": 1\n}"
				}
			]
		}
	],
	"auth": {
		"type": "bearer",
		"bearer": [
			{
				"key": "token",
				"value": "{{auth_token}}",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"requests": {},
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "ip_device",
			"value": ""
		},
		{
			"key": "auth_token",
			"value": ""
		}
	]
}