Skip to main content
Update an Effect in an Action
curl --request PATCH \
  --url https://sapi.withsutro.com/applications/{applicationId}/actions/{actionId}/effects/{effectId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-sutro-api-client: <api-key>' \
  --data '
{
  "effect": "<string>",
  "params": {},
  "bindParams": {},
  "next": "<string>",
  "onError": {
    "nextId": "<string>",
    "continueOriginalFlow": true
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "scode": {
    "requirements": [
      {
        "id": "<string>",
        "type": "usability",
        "description": "<string>",
        "importanceForUser": "critical",
        "importanceForBusiness": "critical",
        "frequencyOfUse": "always",
        "parentId": "<string>"
      }
    ],
    "appId": "<string>",
    "version": "<string>",
    "appOverview": {
      "name": "<string>",
      "jobToBeDone": "<string>",
      "unsupportedUserJourneys": [
        {
          "name": "<string>",
          "description": "<string>",
          "reason": "<string>",
          "steps": [
            "<string>"
          ]
        }
      ],
      "draftUserJourneys": [
        {
          "name": "<string>",
          "outcome": "<string>",
          "steps": [
            "<string>"
          ]
        }
      ]
    },
    "appDescription": "<string>",
    "appDraft": {
      "sitemap": {
        "nodes": [
          {
            "id": "<string>",
            "route": "<string>",
            "content": [
              {
                "title": "<string>",
                "description": "<string>"
              }
            ]
          }
        ],
        "edges": [
          {
            "from": "<string>",
            "to": "<string>",
            "type": "<string>"
          }
        ]
      },
      "requirements": [
        {
          "id": "<string>",
          "description": "<string>",
          "parentId": "<string>"
        }
      ]
    },
    "domainModel": {
      "models": [
        {
          "name": "<string>",
          "fields": [
            {
              "name": "<string>",
              "type": "<string>",
              "relationshipType": "hasOne"
            }
          ],
          "requirements": [
            {
              "id": "<string>",
              "description": "<string>",
              "parentId": "<string>"
            }
          ],
          "isUserModel": true
        }
      ]
    },
    "actions": [
      {
        "id": "<string>",
        "effects": [
          {
            "actionEffectId": "<string>",
            "effect": "<string>",
            "params": {},
            "bindParams": {},
            "next": "<string>",
            "onError": {
              "nextId": "<string>",
              "continueOriginalFlow": true
            }
          }
        ],
        "startEffectId": "<string>",
        "bindReturnValue": "<string>",
        "onError": {
          "nextId": "<string>",
          "continueOriginalFlow": true
        },
        "referenceRequirements": [
          "<string>"
        ]
      }
    ],
    "triggers": [
      {
        "trigger": {
          "id": "<string>",
          "type": "<unknown>",
          "eventName": "<string>",
          "payload": {}
        },
        "actionId": "<string>",
        "initialState": {},
        "validation": [
          "<string>"
        ],
        "isPublic": true,
        "referenceRequirements": [
          "<string>"
        ]
      }
    ],
    "userModelId": "<string>",
    "models": [
      {
        "id": "<string>",
        "name": "<string>",
        "fields": [
          {
            "id": "<string>",
            "name": "<string>",
            "relationshipOwner": true,
            "min": 123,
            "max": 123,
            "to": "<string>",
            "accessControl": {
              "rules": [
                {
                  "access": "allow",
                  "criteria": "<string>"
                }
              ],
              "defaultAccess": "allow"
            },
            "computed": "<string>",
            "defaultValue": "<unknown>",
            "enum": [
              "<string>"
            ]
          }
        ],
        "accessControl": {
          "rules": [
            {
              "access": "allow",
              "criteria": "<string>"
            }
          ],
          "defaultAccess": "allow"
        },
        "referenceRequirements": [
          "<string>"
        ]
      }
    ],
    "moduleDefinitions": [
      [
        "<string>",
        {
          "id": "<string>",
          "llmMeta": {
            "name": "<string>",
            "description": "<string>",
            "whenToUse": "<string>"
          },
          "plugs": [
            {
              "id": "<string>",
              "llmMeta": {
                "name": "<string>",
                "description": "<string>",
                "whenToUse": "<string>"
              },
              "capability": {
                "id": "<string>",
                "llmMeta": {
                  "name": "<string>",
                  "description": "<string>",
                  "whenToUse": "<string>"
                },
                "specifics": "@construct/dataModel"
              }
            }
          ],
          "sockets": [
            {
              "id": "<string>",
              "llmMeta": {
                "name": "<string>",
                "description": "<string>",
                "whenToUse": "<string>"
              },
              "capability": {
                "id": "<string>",
                "llmMeta": {
                  "name": "<string>",
                  "description": "<string>",
                  "whenToUse": "<string>"
                },
                "specifics": "@construct/dataModel"
              },
              "fanIn": "single"
            }
          ],
          "constraints": [
            {
              "id": "<string>",
              "llmMeta": {
                "name": "<string>",
                "description": "<string>",
                "whenToUse": "<string>"
              }
            }
          ],
          "behaviors": [
            {
              "type": "<unknown>",
              "details": {}
            }
          ],
          "importFrom": "<string>"
        }
      ]
    ],
    "modules": [
      [
        "<string>",
        {
          "id": "<string>",
          "definitionId": "<string>",
          "plugs": [
            {
              "id": "<string>",
              "capability": "<string>",
              "providedBy": {
                "type": "@construct/dataModel",
                "id": "<string>"
              }
            }
          ],
          "sockets": [
            {
              "id": "<string>",
              "capability": "<string>",
              "plugId": "<string>"
            }
          ],
          "constraints": [
            {
              "id": "<string>",
              "llmMeta": {
                "name": "<string>",
                "description": "<string>",
                "whenToUse": "<string>"
              }
            }
          ],
          "behaviors": [
            {
              "type": "<unknown>",
              "details": {}
            }
          ],
          "internalModuleData": {}
        }
      ]
    ],
    "personas": [
      {
        "name": "<string>"
      }
    ]
  },
  "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": {
    "jobs": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "implementationJobId": "<string>",
        "jobType": "figma_code_generation",
        "status": "queued",
        "customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "metadata": {},
        "errorMessage": "<string>",
        "errorStack": "<string>",
        "startedAt": "<string>",
        "completedAt": "<string>"
      }
    ]
  },
  "name": "<string>",
  "serverVersion": "<string>",
  "lastPublishedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Builder authentication and authorization

x-sutro-api-client
string
header
required

A unique identifier for the API Client making a request

Path Parameters

applicationId
string<uuid>
required
actionId
string<uuid>
required
effectId
string<uuid>
required

Body

application/json
effect
string

The ID of the effect to run

params
object

Static input parameters for the action effect

bindParams
object

Dynamic input parameters for the action effect. These MUST be SCodeValues

next
string

This is the ID of the next action effect in the sequence (if any)

onError
object

Response

200 - application/json

The updated application

An application

id
string<uuid>
required

Unique identifier for the application

scode
SCode representation of an Application · object
required

The application's SCode definition

projectId
string<uuid>
required

The project this application belongs to

status
object
required
name
string

The name of the application

serverVersion
string

The current server version (semver)

lastPublishedAt
string<date-time>

When the application was last published