How to: Configure the State Machine for Entity type

For information about prerequisites, see Integrate with Entities.

To configure the state of an Entity Type, call the Register State Machine Config endpoint. Request bodies are specified in JSON format. The following example shows a request body for configuring the state machine for Entity Type:

{
   "states": [
       {
           "name": "onboarding",
           "defaultSubState": "onboarding",
           "subStates": [{
               "name": "onboarding",
               "transitions": [{
                   "eventCode": "E-001",
                   "destination": "active:active"
                  
               }],
               "ttl": {
                   "time": "40s",
                   "destination": "onboarding:onboarding"
               }
           }]
       },{
           "name": "active",
           "defaultSubState": "active",
           "subStates": [{
               "name": "active",
               "transitions": [{
                   "eventCode": "E-002",
                   "destination": "inactive:inactive"
                  
               }],
               "ttl": {
                   "time": "40s",
                   "destination": "active:active"
               }
           }]
       },{
           "name": "inactive",
           "defaultSubState": "inactive",
           "subStates": [{
               "name": "inactive",
               "transitions": [{
                   "eventCode": "E-004",
                   "destination": "inactive:inactive"
                  
               }],
               "ttl": {
                   "time": "40s",
                   "destination": "inactive:inactive"
               }
           }]
       }
   ],
   "terminalTTL": "300s",
   "callback": "https://examplecallbackurl.com"
}