Skip to content

Encode a model with a template

GET
/models/{modelId}/template/{templateId}
curl --request GET \
--url https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/template/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>'

Encode model

modelId
required
string format: uuid
templateId
required
string format: uuid

OK

Media typeapplication/json
object
document
required
string
logEntries
Array<object>
object
code
required
string
logLevel
required

INFO entries are informational — something the reader should know that is not a defect, notably the “unverifiable” verdicts of profile resolution. An INFO entry never makes a model invalid.

string
Allowed values: WARN ERROR INFO
title
required
string
detailMessage
required
string
modelElementId
string format: uuid
property
string
valueIndex
integer
otherElementId

The other element a finding is about, where it concerns two: the element whose key or value this one repeats, or the dependency element publishing the same IRI.

string format: uuid
fingerprint

A hash of the value the finding was about. Sent with modelElementId (as elementId, left out for a model-level finding), code and property to POST /models/{modelId}/dismissals to dismiss the finding; the dismissal holds while the value hashes the same.

string
dismissed

Who dismissed this warning or informational finding and when, where a dismissal of the model names it by element, code, property and fingerprint, so while the value it was about is unchanged. Never on an error, nor on a finding on an element another model answers for.

object
by
required

Who dismissed it: a person (USER) with their current name. name is absent where nothing answers to the id any more, such as an erased user.

object
id
required
string format: uuid
type
required

USER is a person, MACHINE a service account, and SYSTEM the platform itself, whose commits (metamodel seeding and re-pins) the commit log hides unless asked for them.

string
Allowed values: USER ORGANIZATION SYSTEM MACHINE
name

The display name, where one is known: a person’s from their account, a service account’s as stored with what it wrote. Left out for the platform and for a person whose account holds no name.

string
at
string format: date-time
subject

What exactly a finding is about, when its check can report more than one finding at the same code, element and property: a relation target, an offending value (with its language tag for a language string) or an identifier the check is about. Exactly one of target, value and name is present, language only beside value.

object
target
string format: uuid
value
string
language
string
name
string
key

The finding’s identity across validation runs: the lowercase hex SHA-256 of the canonical JSON of code, modelElementId (as elementId), property and subject, each left out when absent, keys sorted and no whitespace. Neither valueIndex nor the message is part of it. Present on every entry of a validation result.

string
/^[0-9a-f]{64}$/

Example

{
"logEntries": [
{
"logLevel": "WARN",
"dismissed": {
"by": {
"type": "USER"
}
}
}
]
}

Not found

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}