Skip to content

Create a metaobject

View as Markdown
post /rest/api/metaobjects

Creates a Metaobject resource.

Creates a metaobject - one record of a definition. Reference the definition, give it a handle (a unique slug within its type), and supply the fields values. Each field is validated against the definition’s fieldDefinitions.

Headers

NameTypeRequiredDescription
X-Flowkiwi-Organization-IdstringrequiredThe organization the request acts as. Determines the identity, permissions and ownership applied when reading or modifying data on the instance.

Request body

PropertyTypeRequiredDescription
definitionMetaobjectDefinition.MetaobjectDefinitionCreateInputrequiredThe MetaobjectDefinition (IRI) this metaobject is a record of.
Show definition fields
PropertyTypeRequiredDescription
typestringrequired
namestringrequired
descriptionstring | null-
displayNameFieldstring | null-The key of the field definition used as the display name for records of this type. Optional - when omitted it is null and records have no derived display name. When set, it must match the key of one of this definition's fieldDefinitions, otherwise the request is rejected with 422.
fieldDefinitionsEmbeddedMetaobjectFieldDefinitionResource[]-The field definitions that make up this metaobject definition.
Show fieldDefinitions fields
PropertyTypeRequiredDescription
keystringrequiredThe field key, unique within the definition (referenced by metaobject fields).
namestringrequiredThe human-readable name of the field.
descriptionstring | null-An optional description of the field.
typestringrequiredThe field data type, as an IRI to the field-type resource.
requiredboolean-Whether a value for this field is required on metaobjects of the definition.
validationsEmbeddedMetaobjectFieldDefinitionValidationResource[]-The validation rules applied to values of this field.
handlestringrequiredThe metaobject's unique slug within its definition type.
status"DRAFT" | "ACTIVE"-The publication status of the metaobject.
fieldsMetaobjectFieldInput[]-The field values of the metaobject, one entry per field definition.
Show fields fields
PropertyTypeRequiredDescription
keystringrequired
valuestring | null-

Response

201 - Metaobject resource created

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
idstring-The resource's unique identifier (UUID).
definitionstring-The MetaobjectDefinition (IRI) this metaobject is a record of.
handlestring-The metaobject's unique slug within its definition type.
status"DRAFT" | "ACTIVE"-The publication status of the metaobject.
displayNamestring | null-The human-readable label, derived from the field named by the definition's displayNameField.

Errors

400 - Invalid input

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
titlestring | null-A short, human-readable summary of the problem.
detailstring | null-A human-readable explanation specific to this occurrence of the problem.
statusnumber | null-
instancestring | null-A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
typestring-A URI reference that identifies the problem type

403 - Access denied. The caller is missing one or more identity permissions required for this operation.

Content-Type: application/problem+json

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
typestring-
titlestring-
statusinteger-
detailstring-
missingPermissionsstring[]-Identity permissions that the caller is missing for this operation. Present only when the 403 is caused by a denied identity:* permission.

422 - An error occurred

PropertyTypeRequiredDescription
@contextobject-
@idstringrequired
@typestringrequired
statusinteger-
violationsobject[]-
Show violations fields
PropertyTypeRequiredDescription
propertyPathstringrequiredThe property path of the violation
messagestringrequiredThe message associated with the violation
codestring-The code of the violation
hintstring-An extra hint to understand the violation
payloadobject-The serialized payload of the violation
detailstring-
typestring-
titlestring | null-
instancestring | null-