Skip to main content
Add a field to a model in the Application

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
modelId
string
required
Pattern: ^urn:sutro:model:.*$

Body

application/json
id
string
required

The unique identifier for an edge, e.g. urn:sutro:edge:owners. Must start with "urn:sutro:edge:".

Pattern: ^urn:sutro:edge:
name
string
required

The name of the field, e.g. user

relationshipOwner
boolean
required

If true, this field's parent model is the owner of the relationship - basically always except if this is a 'belongs to' pointer. Every relationship needs to point to another model's field.

min
number
required

The minimum number of values that can be stored in this field

max
number | null
required

The maximum number of values that can be stored in this field

to
required

The type of the field's value

Pattern: ^urn:sutro:model:
accessControl
object
required
computed
string

Optional computed expression for the field

defaultValue
any

The default value for the field

enum
(string | number | boolean)[]

If set, the field is an enum and can only take on these values

Response

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
isActive
boolean
required

Whether the application is currently active for billing/runtime purposes

name
string

The name of the application

serverVersion
string

The current saved server version (semver)

lastPublishedAt
string<date-time>

When the application was last published

lastUnpublishedAt
string<date-time>

When the application was last unpublished