Models

Models define the schema for records — the fields, their types, validation rules, resolution policies, computed field expressions, and relationship declarations. Every record in the system belongs to exactly one model.

Endpoints

Method
Path
Description

POST

/models

Create a model

GET

/models

List models

GET

/models/{modelId}

Get a model

PATCH

/models/{modelId}

Update model properties

PUT

/models/{modelId}/status/{targetStatus}

Lifecycle transition

DELETE

/models/{modelId}

Delete a model

Lifecycle

Models progress through three states:

draft → active → archived
  • Draft — the model is being configured. Records cannot be created against it.

  • Active — the model is live. Records can be created, read, updated, and deleted. Fields can be added and modified individually.

  • Archived — the model is frozen. Existing records remain accessible, but no new records can be created and the field schema cannot be modified.

Transitions are one-directional. A model cannot move from archived back to draft.

Create a model

Accepts a complete definition — model metadata and the fields array — and creates everything in a single transaction.

Request

Response 201 Created

The model is created in draft status. Server-assigned fields (modelId, fieldId, createdAt) are populated in the response.

Get a model

Returns the complete definition including all fields.

Response 200 OK

Same shape as the create response.

List models

Returns a paginated list of models. Supports standard filtering and sorting.

Useful filters

Update a model

Partial update — only the provided properties are changed. Lifecycle status is not modified through PATCH; use the dedicated lifecycle endpoint.

Request

Response 200 OK

Returns the full updated model.

Lifecycle transition

Transitions the model's lifecycle. The server validates that the transition is permitted.

Examples

Response 200 OK

Returns the model with the new status.

Error cases

Scenario
Status

Invalid transition (e.g., archiveddraft)

422 Unprocessable Entity

Activating a model triggers compilation of the definition used by the platform's processing pipeline.

Delete a model

Performs a soft delete — the model is excluded from list results and system operations but retained for auditing.

Preconditions

Deletion is guarded by two preconditions:

  1. The model must be in archived status

  2. The model must have no active (non-deleted) records

If either condition is not met, the request is rejected with 409 Conflict.

Error cases

Scenario
Status

Model is not in archived status

409 Conflict

Model has active (non-deleted) records

409 Conflict

Response 204 No Content

No response body on successful deletion.

Last updated