Create one validation rule for an entity definition.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/admin/entity-definitions/example/validation-rules"), Content = new StringContent("{ \"Name\": \"example\", \"DisplayName\": \"example\", \"Expression\": \"example\", \"Message\": \"example\", \"Enabled\": true, \"MessageTranslations\": { \"additionalProperty\": \"example\" } }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/admin/entity-definitions/example/validation-rules';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"Name":"example","DisplayName":"example","Expression":"example","Message":"example","Enabled":true,"MessageTranslations":{"additionalProperty":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspace/admin/entity-definitions/example/validation-rules \ --header 'Content-Type: application/json' \ --data '{ "Name": "example", "DisplayName": "example", "Expression": "example", "Message": "example", "Enabled": true, "MessageTranslations": { "additionalProperty": "example" } }'Authorizations
Section titled “Authorizations”- None
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Query Parameters
Section titled “Query Parameters”Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.
Request Body
Section titled “Request Body”Create one entity validation rule.
object
Stable technical validation rule key.
User-facing validation rule label.
Boolean validation expression.
User-facing validation failure message.
Whether this validation rule is active.
Optional localized validation failure message templates keyed by locale.
object
Examplegenerated
{ "Name": "example", "DisplayName": "example", "Expression": "example", "Message": "example", "Enabled": true, "MessageTranslations": { "additionalProperty": "example" }}Create one entity validation rule.
object
Stable technical validation rule key.
User-facing validation rule label.
Boolean validation expression.
User-facing validation failure message.
Whether this validation rule is active.
Optional localized validation failure message templates keyed by locale.
object
Examplegenerated
{ "Name": "example", "DisplayName": "example", "Expression": "example", "Message": "example", "Enabled": true, "MessageTranslations": { "additionalProperty": "example" }}Create one entity validation rule.
object
Stable technical validation rule key.
User-facing validation rule label.
Boolean validation expression.
User-facing validation failure message.
Whether this validation rule is active.
Optional localized validation failure message templates keyed by locale.
object
Examplegenerated
{ "Name": "example", "DisplayName": "example", "Expression": "example", "Message": "example", "Enabled": true, "MessageTranslations": { "additionalProperty": "example" }}Responses
Section titled “Responses”OK
object
Administrative entity validation rule definition.
object
Validation rule identifier.
Owning entity definition identifier.
Stable technical validation rule key.
User-facing validation rule label.
Validation expression.
User-facing validation failure message.
Optional localized validation failure message templates keyed by locale.
object
Whether this validation rule is active.
Validation rule ordering inside the entity definition.
Whether the validation rule is soft-deleted.
Soft-delete timestamp when deleted.
Concurrency token.
Stable NET package root id when package-owned.
NET package artifact id when package-owned.
Stable Moltaro id when package-owned.
object
object
object
object
Example
{ "Data": { "SchemaSource": 0 }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Bad Request
object
Administrative entity validation rule definition.
object
Validation rule identifier.
Owning entity definition identifier.
Stable technical validation rule key.
User-facing validation rule label.
Validation expression.
User-facing validation failure message.
Optional localized validation failure message templates keyed by locale.
object
Whether this validation rule is active.
Validation rule ordering inside the entity definition.
Whether the validation rule is soft-deleted.
Soft-delete timestamp when deleted.
Concurrency token.
Stable NET package root id when package-owned.
NET package artifact id when package-owned.
Stable Moltaro id when package-owned.
object
object
object
object
Example
{ "Data": { "SchemaSource": 0 }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Forbidden
object
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
Administrative entity validation rule definition.
object
Validation rule identifier.
Owning entity definition identifier.
Stable technical validation rule key.
User-facing validation rule label.
Validation expression.
User-facing validation failure message.
Optional localized validation failure message templates keyed by locale.
object
Whether this validation rule is active.
Validation rule ordering inside the entity definition.
Whether the validation rule is soft-deleted.
Soft-delete timestamp when deleted.
Concurrency token.
Stable NET package root id when package-owned.
NET package artifact id when package-owned.
Stable Moltaro id when package-owned.
object
object
object
object
Example
{ "Data": { "SchemaSource": 0 }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Conflict
object
Administrative entity validation rule definition.
object
Validation rule identifier.
Owning entity definition identifier.
Stable technical validation rule key.
User-facing validation rule label.
Validation expression.
User-facing validation failure message.
Optional localized validation failure message templates keyed by locale.
object
Whether this validation rule is active.
Validation rule ordering inside the entity definition.
Whether the validation rule is soft-deleted.
Soft-delete timestamp when deleted.
Concurrency token.
Stable NET package root id when package-owned.
NET package artifact id when package-owned.
Stable Moltaro id when package-owned.
object
object
object
object
Example
{ "Data": { "SchemaSource": 0 }, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}