> ## Documentation Index
> Fetch the complete documentation index at: https://docs.industrialpmr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Overview & Architecture

> RESTful endpoints and real-time APIs for querying machines, telemetry streams, and shift reports.

Industrial PMR exposes a robust REST API alongside real-time WebSocket and MQTT telemetry feeds for third-party ERP platforms, manufacturing execution systems (MES), corporate Business Intelligence (BI) dashboards, and data lakes.

***

## Production Endpoints

| Service Role | Production Endpoint | Protocol | Description |
| :- | :- | :- | :- |
| **REST Middleware** | `https://rest-middleware-01.industrialpmr.com` | HTTPS | Primary machine status, server time sync, and high-frequency telemetry ingestion. |
| **Cloud Administration API** | `https://us-central1-industrialpmr.cloudfunctions.net/admin` | HTTPS | Shift report aggregation, user governance, and machine configuration management. |
| **MQTT Telemetry Broker** | `mqtts://mqtt.industrialpmr.com:8883` | MQTTS | Secure TLS broker for edge sensor streaming. |
| **WebSockets Stream** | `wss://mqtt.industrialpmr.com:8084/mqtt` | WSS | Browser WebSocket interface for sub-second dashboard dials. |

***

## Request Standards

All API requests must use HTTPS and provide standard JSON content headers:

```http theme={null}
Content-Type: application/json
Accept: application/json
Authorization: Bearer <YOUR_ACCESS_TOKEN>
```

***

## Standard Response Format

All API responses adhere to a consistent JSON envelope structure:

### Successful Response

```json theme={null}
{
  "success": true,
  "data": {
    "total": 5,
    "items": [
      {
        "machine_id": "imm_01",
        "name": "NISSEI 120",
        "status": "RUNNING",
        "current_kw": 14.85,
        "active_mold": "TEST_FILAMENT",
        "operator": "A - Shahid Bhai"
      }
    ]
  },
  "timestamp": 1713801240
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {
    "code": "MACHINE_NOT_FOUND",
    "message": "The specified machine identifier does not exist in the active factory profile."
  },
  "timestamp": 1713801240
}
```

***

## Common HTTP Status Codes

| Status Code | Meaning | Resolution |
| :- | :- | :- |
| **200 OK** | Request succeeded. | Payload returned in `data`. |
| **400 Bad Request** | Missing required parameters or invalid JSON body. | Verify request syntax and payload formatting. |
| **401 Unauthorized** | Missing or expired Bearer token. | Refresh credentials via the [Authentication API](https://docs.industrialpmr.com/api-reference/authentication.md). |
| **403 Forbidden** | Insufficient role permissions. | Verify your account has administrative or manager rights for this factory. |
| **404 Not Found** | Resource identifier not recognized. | Check machine ID, department code, or report timestamp. |
| **429 Too Many Requests** | Rate limit threshold reached. | Implement exponential backoff (standard limit: 120 req/min). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.