Models/Actions
Create a new action
Get Started
Architecture
Documents
Copilot
Collaborate
Integrations
API Reference
- Introduction
- Models
- Models/Parts
- Models/Ports
- Models/Actions
- Models/States
- Models/Transitions
- Models/Signals
- Models/Interfaces
- Models/Requirements
- OpenAPI Specification
Models/Actions
Create a new action
Creates a new action in the specified model
POST
/
api
/
models
/
{modelId}
/
actions
curl --request POST \
--url http://localhost:3000/api/models/{modelId}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": {}
}'
{
"label": "<string>",
"scriptName": "<string>",
"inputs": [
{
"id": "<string>",
"name": "<string>",
"expression": "<string>",
"value": 123,
"unitName": "<string>",
"prefix": "<string>",
"lastUpdated": 123,
"constraints": [
"<string>"
],
"isLeftAligned": true
}
],
"outputs": [
{
"id": "<string>",
"name": "<string>",
"expression": "<string>",
"value": 123,
"unitName": "<string>",
"prefix": "<string>",
"lastUpdated": 123,
"constraints": [
"<string>"
],
"isLeftAligned": true
}
],
"notes": "<string>"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
ID of the model
Body
application/json
Response
201
application/json
Action created successfully
An action in the model that can be executed
curl --request POST \
--url http://localhost:3000/api/models/{modelId}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"type": "<string>",
"name": "<string>",
"description": "<string>",
"metadata": {}
}'
{
"label": "<string>",
"scriptName": "<string>",
"inputs": [
{
"id": "<string>",
"name": "<string>",
"expression": "<string>",
"value": 123,
"unitName": "<string>",
"prefix": "<string>",
"lastUpdated": 123,
"constraints": [
"<string>"
],
"isLeftAligned": true
}
],
"outputs": [
{
"id": "<string>",
"name": "<string>",
"expression": "<string>",
"value": 123,
"unitName": "<string>",
"prefix": "<string>",
"lastUpdated": 123,
"constraints": [
"<string>"
],
"isLeftAligned": true
}
],
"notes": "<string>"
}