Example enumeration type message
- Last UpdatedSep 04, 2025
- 2 minute read
The following is a sample type request that will create an Enumeration Type message. You can copy this sample and modify it for your use.
Note: To bypass the PI Web API CSRF defense setting, add an X-Requested-With header with any value to the OMF HTTP request. For additional headers supported in message specification, see Message headers.
Authorization: {your own value}
Content-Type: application/json
messageformat: json
omfversion: 1.2
messagetype: type
action: create
[
{
"id": "WidgetColorEnum",
"enum": {
"type": "integer",
"format": "int16",
"values": [
{
"name": "Red",
"value": 0
},
{
"name": "Blue",
"value": 1
},
{
"name": "Green",
"value": 2
}
]
}
}
]
This message creates an AF Enumeration Set shown in the following image.

Enumerations that meet the requirements defined in the Type message limitations topic will also result in a Digital State Set being created. The enumeration type given above meets these requirements, and so will produce a Digital State Set like shown in the following image:

For more information about when Digital State Sets are created during enumeration type messages, see Type message limitations.