Skip to content
Connect an agent

Patterns

Check pattern

Check a pattern file.

POST/v1/patterns/check

TL;DR

QuestionAnswer
What does it do?Check a pattern file.
Which tool does the same?check_pattern
What does it take?A JSON body of type CheckPatternInput.
What does it return?Status 200 with a body of type CheckPatternResponse.
What can go wrong?400 the body failed schema validation; 401 the api key is missing or not valid; 403 the account is on the free plan, which does not include the rest drawing and checking routes (plan.rest_not_included); 413 the body is larger than the size cap; 429 too many requests. Every failure uses the one error envelope.

What it does

Checks a pattern file as a save to an organisation checks it. A file that would not be saved is a normal 200 result with valid false and every problem with its field and a fix; a valid one comes back with each flavour filled with its slot defaults. Stores nothing; saving is POST /orgs/{org}/patterns.

Request body

The body has the type CheckPatternInput.

FieldTypeRequiredDescription
patternobjectyesThe pattern file. Every field is described at https://docs.plotwork.dev/schemas/plotwork.pattern.json (opens in a new tab); get_pattern with file true gives one to start from.
pattern.$schemastringno
pattern.namestringyes
pattern.titlestringyes
pattern.summarystringyes
pattern.whenToUsestringno
pattern.tagsstring[]no
pattern.templatesobjectyes
pattern.templates.neutralstringno
pattern.templates.awsstringno
pattern.templates.azurestringno
pattern.templates.gcpstringno
pattern.slotsobject[]no
pattern.slots[].idstringyes
pattern.slots[].defaultstringyes
pattern.slots[].meaningstringyes
pattern.notesobjectno
pattern.notes.keepstringno
pattern.notes.renamestringno
pattern.notes.splitstringno

Responses

StatusMeaningBody
200Whether it would be saved, its problems, and the source of each flavour.CheckPatternResponse
400The body failed schema validation.ErrorResponse
401The API key is missing or not valid.ErrorResponse
403The account is on the Free plan, which does not include the REST drawing and checking routes (plan.rest_not_included).ErrorResponse
413The body is larger than the size cap.ErrorResponse
429Too many requests.ErrorResponse

Response body

A 200 answer has the type CheckPatternResponse.

FieldTypeRequiredDescription
validbooleanyesTrue when the file passes every check a save runs, so publish_pattern or the portal's import would take it.
idstring | nullyesThe id it would have, org:; null when the name is not valid.
kindstring | nullyesThe kind of diagram every flavour draws; null when not valid.
flavours("neutral" | "aws" | "azure" | "gcp")[]yesThe flavours the file gives.
problemsobject[]yesEvery problem at once, each with its field and a fix. Empty when valid.
problems[].fieldstringyesWhere the problem is: name, title, templates.aws, slots.0.default, and so on; json for a file that is not JSON.
problems[].messagestringyes
problems[].hintstringyesHow to fix it.
sourcesobjectyesEach flavour filled with the slot defaults, keyed by flavour: send one to draw_diagram to see it and its warnings. Empty when not valid.
nextstringyesThe next step in one sentence.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
check_patternThe same operation as an MCP tool
Tool referenceThe operations as callable tools