Skip to main content
POST
/
applications
/
{applicationId}
/
models
Add a model to the application
curl --request POST \
  --url https://local.withsutro.com/applications/{applicationId}/models \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-sutro-api-client: <api-key>' \
  --data '
{
  "model": {
    "fields": [
      {
        "id": "<string>",
        "name": "<string>",
        "relationshipOwner": true,
        "min": 123,
        "max": 123,
        "to": "<string>",
        "accessControl": {},
        "computed": "<string>",
        "defaultValue": "<unknown>",
        "enum": [
          "<string>"
        ]
      }
    ],
    "accessControl": {}
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "definition": {
    "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": [
      "<array>"
    ],
    "modules": [
      "<array>"
    ],
    "personas": [
      {
        "name": "<string>"
      }
    ]
  }
}

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

Body

application/json

The model to add to the application

model
object
required

Response

The updated application

An application

id
string<uuid>
required
Example:

"b08631ad-a4ec-4c27-9995-01287e83d565"

name
string
required

The name of the Application

Example:

"My Cool App"

definition
SCode representation of an Application · object
required