canonical: https://jentic.com/apis/opto22.com/opto22-pac

# Opto22 PAC Control REST API

The PAC Control REST API provides HTTPS access to variables and I/O tags running inside an Opto 22 SNAP-PAC-R or SNAP-PAC-S series industrial controller. It exposes the controller's strategy, letting external systems read and write integer, float, string, and table variables, plus analog and digital I/O points by name. Authentication is HTTP Basic Auth carrying an API key id and value, and JSON payloads are capped at 3KB to match the controller's onboard buffer.

## For AI agents

Read and write SNAP-PAC controller strategy variables and analog or digital I/O points over HTTPS using an API key in HTTP Basic Auth.

## Scope

Does not handle PAC strategy compilation, firmware updates, or groov-family controllers - use for SNAP-PAC named variable and I/O access only.

## Capabilities

- Read scalar strategy variables by name from a SNAP-PAC controller
- Write values to integer, float, and string variables on the controller
- Read analog input engineering units for a named I/O point
- Set analog output values and digital output states
- Read and write table variables across int32, float, and string types
- Query controller and strategy metadata for routing and validation

## Use cases

### Plant Variable Bridge to Higher-Level Systems

Expose SNAP-PAC strategy variables to an MES, SCADA, or analytics system without writing custom controller code. The REST API returns named int32, float, and string variables as JSON, so an integration can map them directly to records in the upstream system.

Example prompt: GET `/device/strategy/vars/int32s` to read all integer variables and post them to a time-series database every 60 seconds

### Recipe and Setpoint Push from ERP

Allow an ERP or scheduling system to push job recipes into a SNAP-PAC by writing named variables on the controller. The named-variable model means the integration code does not need to track register addresses - it writes by symbol.

Example prompt: POST a JSON value to the named float variable for the recipe target temperature when an ERP job is released

### Engineering Units for HMI Tiles

Drive HMI tiles or operator dashboards directly from analog inputs on a SNAP-PAC by requesting the engineering-unit value of each named I/O point. The dedicated /eu endpoint returns the scaled value the controller already computed, so the dashboard does not need to repeat scaling logic.

Example prompt: GET `/device/strategy/ios/analogInputs/{ioName}/eu` for each gauge tile every 2 seconds

### Table Variable Inspection for Diagnostics

Read large table variables - int32, float, or string - from a SNAP-PAC strategy to inspect history buffers, alarm queues, or batch logs that the controller maintains in memory. The REST API exposes both whole tables and single indexed elements.

Example prompt: GET the named float table variable to download the last 100 batch results into a diagnostics report

### Agent-Driven SNAP-PAC Operations via Jentic

An AI assistant for controls engineers can read and write SNAP-PAC variables and I/O points through Jentic without exposing the API key id and value to the model. The agent searches by intent and Jentic returns the matching named-variable read or write operation.

Example prompt: Search Jentic for 'write a value to a SNAP-PAC float variable', load the operation schema, and execute against the engineer's controller

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/device` | Get device info |
| GET | `/device/strategy` | Get running strategy info |
| GET | `/device/strategy/ios/analogInputs/{ioName}/eu` | Read analog input engineering units |
| GET | `/device/strategy/ios/digitalInputs/{ioName}/state` | Read digital input state |
| GET | `/device/strategy/ios/analogOutputs` | List analog outputs |

## Key resources

- **Device** — Top-level controller info and strategy status
- **Strategy Variables** — Scalar int32, float, and string variables exposed by the running strategy
- **Tables** — Indexed int32, float, and string table variables
- **Analog I/O** — Analog input and output points with engineering-unit endpoints
- **Digital I/O** — Digital input states and digital output state writes

## Why Jentic

- **Setup:** Wiring the PAC Control REST API by hand means building the Basic Auth header from the API key id and value and navigating its named-variable and I/O route tree on the SNAP-PAC controller yourself. Through Jentic you install once, import the PAC Control REST API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** PAC Control puts the I/O point name in the URL path (`/device/strategy/ios/analogInputs/{ioName}/eu`), so a rule can pin your agent to reading one input. You choose the operations it may call, so output writes are not included unless you add them.
- **Credential handling:** Your PAC Control key id and value are stored once, encrypted, by your own Jentic One instance as a single Basic Auth credential and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'write a value to a SNAP-PAC float variable' or 'read an analog input', and Jentic returns the matching named-variable operation with its parameter schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **groov View Public API** — Same vendor, but for groov EPIC and groov RIO data store rather than SNAP-PAC variables
- **Particle Device Cloud API** — General-purpose IoT device cloud for connected microcontrollers
- **Blynk IoT API** — Consumer and prosumer IoT platform with mobile dashboards

## FAQ

### What authentication does the PAC Control REST API use?

HTTP Basic Auth with an API key. The API key id is sent as the username and the API key value as the password. Through Jentic, both halves are stored encrypted in the vault and the agent never sees the raw credential.

### Can I write to strategy variables and I/O points with the PAC Control REST API?

Yes. The API exposes named writes for int32, float, and string variables and for analog and digital output points. Writes are constrained to a 3KB JSON body - fine for individual setpoints but not bulk table loads in a single call.

### How many endpoints does the PAC Control REST API expose?

Fifty-five endpoints covering device info, the running strategy, scalar variables, table variables, and analog and digital I/O. The surface mirrors the named-variable model that PAC Control programs use, so endpoint paths follow the variable and I/O point names.

### What is the maximum payload size for a PAC Control request?

The vendor docs cap JSON payloads at 3KB (3072 bytes) for both POSTs and GETs. Designs that need to read or write many table elements at once should chunk the calls below that limit.

### How do I read an analog input through Jentic?

Install the SDK with pip install jentic, then search Jentic for 'read an analog input value from a SNAP-PAC'. Jentic returns the GET `/device/strategy/ios/analogInputs/{ioName}/eu` operation with its schema; load it, supply the I/O point name, and execute. Run it through Jentic One, the self-hosted execution layer.

### Can I limit what my agent is allowed to do with the PAC Control REST API?

Yes. Jentic One is self-hosted, so your own rules decide which of the 55 operations and which Basic Auth credential the agent may use. Because PAC Control puts the I/O point name in the URL path, such as GET `/device/strategy/ios/analogInputs/{ioName}/eu`, you can pin the agent to reading a single analog input or a specific set of named variables. You pick the operations it can call, so analog and digital output writes are excluded unless you explicitly add them.
