---
agentTools:
  projectIndex: https://docs.agilite.io/llms.txt
---

# /execute

Execute a BPM Record that has been registered or that is in an Active Step

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Agilit-e BPM",
    "version": "7"
  },
  "servers": [
    {
      "url": "https://api.agilite.io/bpm"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "api-key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/execute": {
      "post": {
        "summary": "/execute",
        "description": "Execute a BPM Record that has been registered or that is in an Active Step",
        "operationId": "execute",
        "parameters": [
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "process-key",
            "in": "header",
            "description": "The BPM Profile Key of the relevant BPM Process",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bpm-record-id",
            "in": "header",
            "description": "The Record Id of the record that was registered with Agilit-e",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "option-selected",
            "in": "header",
            "description": "The Step Option to execute",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "current-user",
            "in": "header",
            "description": "The Name, Email, Id of the user executing the record",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "current-step",
            "in": "header",
            "description": "The Current Step Key or Name that record is in",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "comments",
            "in": "header",
            "description": "Any options comments to be added to the History entry for this record",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include-history",
            "in": "header",
            "description": "Whether the successful response needs to include the history object",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "include-step-options",
            "in": "header",
            "description": "Whether the successful response needs to include the step options",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "include-visible-objects",
            "in": "header",
            "description": "Whether the successful response needs to include the visible objects",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "include-keywords",
            "in": "header",
            "description": "Whether the successful response needs to include the keywords",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "iso-language",
            "in": "header",
            "description": "Language to use when registering the BPM Record",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "log-profile-key",
            "in": "header",
            "description": "Profile Key of the Batch Logging Profile configured for logging",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "string",
                    "format": "json"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"_id\": \"1602155920922\",\n    \"description\": \"\",\n    \"duration\": \"0\",\n    \"instructions\": \"\",\n    \"key\": \"second_step\",\n    \"name\": \"Second Step\",\n    \"stepType\": \"Active Step\",\n    \"notificationTemplate\": \"\",\n    \"processKey\": \"process-key\",\n    \"processStage\": \"Second\",\n    \"recordId\": \"008007c0-7b89-11ed-ae86-218be3159061\",\n    \"recordRef\": \"node-red-testing-4\",\n    \"referenceUrl\": \"\",\n    \"responsibleRole\": \"Originator\",\n    \"submittedIntoStep\": \"2022-12-14T08:27:03.389Z\",\n    \"targetTimeDuration\": \"9999-12-31T00:00:00.000Z\",\n    \"targetTimeDurationPercentage\": 0,\n    \"eventStampHistory\": [\n        {\n            \"eventName\": \"DateCreated\",\n            \"timeStamp\": \"2022-12-14T08:26:26.748Z\"\n        },\n        {\n            \"eventName\": \"DateSubmitted\",\n            \"timeStamp\": \"2022-12-14T08:27:03.389Z\"\n        },\n        {\n            \"eventName\": \"DatePending\",\n            \"timeStamp\": \"2022-12-14T08:27:03.389Z\"\n        }\n    ],\n    \"history\": [\n        {\n            \"comments\": \"\",\n            \"currentRole\": \"Originator\",\n            \"currentUser\": \"user@acme.com\",\n            \"fromStep\": \"new\",\n            \"fromStepName\": \"New\",\n            \"optionKey\": \"createdocument\",\n            \"optionSelected\": \"Create Document\",\n            \"processStage\": \"Draft\",\n            \"responsibleRole\": \"Originator\",\n            \"submissionDate\": \"2022-12-14T08:26:26.748Z\",\n            \"targetTimeDuration\": \"9999-12-31T00:00:00.000Z\",\n            \"toProcessStage\": \"Draft\",\n            \"toStep\": \"first_step\",\n            \"toStepName\": \"First Step\",\n            \"eventStamp\": [\n                \"DateCreated\"\n            ],\n            \"responsibleUsers\": [\n                \"user@acme.com\"\n            ],\n            \"processKey\": \"node-red-testing\",\n            \"recordId\": \"008007c0-7b89-11ed-ae86-218be3159061\",\n            \"recordRef\": \"record-ref\",\n            \"duration\": 0\n        },\n        {\n            \"comments\": \"\",\n            \"currentRole\": \"Originator\",\n            \"currentUser\": \"user@acme.com\",\n            \"fromStep\": \"first_step\",\n            \"fromStepName\": \"First Step\",\n            \"optionKey\": \"submit\",\n            \"optionSelected\": \"Submit\",\n            \"processStage\": \"Draft\",\n            \"responsibleRole\": \"Originator\",\n            \"submissionDate\": \"2022-12-14T08:27:03.389Z\",\n            \"targetTimeDuration\": \"9999-12-31T00:00:00.000Z\",\n            \"toProcessStage\": \"Second\",\n            \"toStep\": \"second_step\",\n            \"toStepName\": \"Second Step\",\n            \"eventStamp\": [\n                \"DateSubmitted\",\n                \"DatePending\"\n            ],\n            \"responsibleUsers\": [\n                \"user@acme.com\"\n            ],\n            \"processKey\": \"node-red-testing\",\n            \"recordId\": \"008007c0-7b89-11ed-ae86-218be3159061\",\n            \"recordRef\": \"node-red-testing-4\",\n            \"duration\": 0\n        }\n    ],\n    \"keywords\": [],\n    \"responsibleUsers\": [\n        \"user@acme.com\"\n    ],\n    \"roles\": [\n        {\n            \"name\": \"Originator\",\n            \"users\": [\n                {\n                    \"email\": \"user@acme.com\"\n                }\n            ]\n        }\n    ],\n    \"stepOptions\": [\n        {\n            \"_id\": \"1607419189437\",\n            \"isNewEntry\": true,\n            \"isActive\": true,\n            \"key\": \"submit\",\n            \"name\": \"Submit\",\n            \"description\": \"\",\n            \"nextStep\": \"completed\",\n            \"visibleObjects\": [],\n            \"notes\": \"\",\n            \"keywords\": [],\n            \"isActiveDescription\": \"Yes\"\n        }\n    ],\n    \"visibleObjects\": [],\n    \"lockedStatus\": {\n        \"isLocked\": false,\n        \"actionedBy\": \"\",\n        \"timestamp\": null\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_id": {
                      "type": "string",
                      "example": "1602155920922"
                    },
                    "description": {
                      "type": "string",
                      "example": ""
                    },
                    "duration": {
                      "type": "string",
                      "example": "0"
                    },
                    "instructions": {
                      "type": "string",
                      "example": ""
                    },
                    "key": {
                      "type": "string",
                      "example": "second_step"
                    },
                    "name": {
                      "type": "string",
                      "example": "Second Step"
                    },
                    "stepType": {
                      "type": "string",
                      "example": "Active Step"
                    },
                    "notificationTemplate": {
                      "type": "string",
                      "example": ""
                    },
                    "processKey": {
                      "type": "string",
                      "example": "process-key"
                    },
                    "processStage": {
                      "type": "string",
                      "example": "Second"
                    },
                    "recordId": {
                      "type": "string",
                      "example": "008007c0-7b89-11ed-ae86-218be3159061"
                    },
                    "recordRef": {
                      "type": "string",
                      "example": "node-red-testing-4"
                    },
                    "referenceUrl": {
                      "type": "string",
                      "example": ""
                    },
                    "responsibleRole": {
                      "type": "string",
                      "example": "Originator"
                    },
                    "submittedIntoStep": {
                      "type": "string",
                      "example": "2022-12-14T08:27:03.389Z"
                    },
                    "targetTimeDuration": {
                      "type": "string",
                      "example": "9999-12-31T00:00:00.000Z"
                    },
                    "targetTimeDurationPercentage": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "eventStampHistory": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "eventName": {
                            "type": "string",
                            "example": "DateCreated"
                          },
                          "timeStamp": {
                            "type": "string",
                            "example": "2022-12-14T08:26:26.748Z"
                          }
                        }
                      }
                    },
                    "history": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "comments": {
                            "type": "string",
                            "example": ""
                          },
                          "currentRole": {
                            "type": "string",
                            "example": "Originator"
                          },
                          "currentUser": {
                            "type": "string",
                            "example": "user@acme.com"
                          },
                          "fromStep": {
                            "type": "string",
                            "example": "new"
                          },
                          "fromStepName": {
                            "type": "string",
                            "example": "New"
                          },
                          "optionKey": {
                            "type": "string",
                            "example": "createdocument"
                          },
                          "optionSelected": {
                            "type": "string",
                            "example": "Create Document"
                          },
                          "processStage": {
                            "type": "string",
                            "example": "Draft"
                          },
                          "responsibleRole": {
                            "type": "string",
                            "example": "Originator"
                          },
                          "submissionDate": {
                            "type": "string",
                            "example": "2022-12-14T08:26:26.748Z"
                          },
                          "targetTimeDuration": {
                            "type": "string",
                            "example": "9999-12-31T00:00:00.000Z"
                          },
                          "toProcessStage": {
                            "type": "string",
                            "example": "Draft"
                          },
                          "toStep": {
                            "type": "string",
                            "example": "first_step"
                          },
                          "toStepName": {
                            "type": "string",
                            "example": "First Step"
                          },
                          "eventStamp": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "example": "DateCreated"
                            }
                          },
                          "responsibleUsers": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "example": "user@acme.com"
                            }
                          },
                          "processKey": {
                            "type": "string",
                            "example": "node-red-testing"
                          },
                          "recordId": {
                            "type": "string",
                            "example": "008007c0-7b89-11ed-ae86-218be3159061"
                          },
                          "recordRef": {
                            "type": "string",
                            "example": "record-ref"
                          },
                          "duration": {
                            "type": "integer",
                            "example": 0,
                            "default": 0
                          }
                        }
                      }
                    },
                    "keywords": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "responsibleUsers": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "user@acme.com"
                      }
                    },
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "example": "Originator"
                          },
                          "users": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "email": {
                                  "type": "string",
                                  "example": "user@acme.com"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "stepOptions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "_id": {
                            "type": "string",
                            "example": "1607419189437"
                          },
                          "isNewEntry": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "isActive": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "key": {
                            "type": "string",
                            "example": "submit"
                          },
                          "name": {
                            "type": "string",
                            "example": "Submit"
                          },
                          "description": {
                            "type": "string",
                            "example": ""
                          },
                          "nextStep": {
                            "type": "string",
                            "example": "completed"
                          },
                          "visibleObjects": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {}
                            }
                          },
                          "notes": {
                            "type": "string",
                            "example": ""
                          },
                          "keywords": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {}
                            }
                          },
                          "isActiveDescription": {
                            "type": "string",
                            "example": "Yes"
                          }
                        }
                      }
                    },
                    "visibleObjects": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {}
                      }
                    },
                    "lockedStatus": {
                      "type": "object",
                      "properties": {
                        "isLocked": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "actionedBy": {
                          "type": "string",
                          "example": ""
                        },
                        "timestamp": {}
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 400,\n    \"errorMessage\": \"An Error Occurred\",\n    \"additionalMessages\": [\"An Error Occured\"]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 400,
                      "default": 0
                    },
                    "errorMessage": {
                      "type": "string",
                      "example": "An Error Occurred"
                    },
                    "additionalMessages": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "An Error Occured"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "5fc0c5ba525f16005dcefb99:5fc0c5ba525f16005dcefbe1"
}
```