Skip to content
Connect an agent

Organisations

Save a diagram as one of the organisation's patterns

Saves source as a pattern in the built-in format, checked as the built-in ones are, with every problem answered at once.

POST/orgs/{org}/patterns

TL;DR

QuestionAnswer
What does it do?Save a diagram as one of the organisation's patterns.
What does it take?A JSON body of type CreateOrganisationPatternBody.
What does it return?Status 201 with a body of type OrganisationPattern.
What can go wrong?400 the body is not valid; 401 not signed in; 403 the role may not (orgs.forbidden), the plan does not include the policies (plan.governance_not_included), the organisation has 50 patterns (orgs.pattern_limit_reached), or the request came from an origin that may not make changes; 404 no such organisation, or the caller is not a member of it; 409 the organisation has a pattern of that name (orgs.pattern_exists); 422 the pattern has problems (orgs.pattern_invalid, every problem in details); 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope.

What it does

Saves source as a pattern in the built-in format, checked as the built-in ones are, with every problem answered at once. Its id is org:, and find_pattern offers it first to the organisation's agents. The owner and admins, on Enterprise.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type CreateOrganisationPatternBody.

FieldTypeRequiredDescription
namestringyesThe name after org:: lowercase letters, digits and single hyphens, such as payments-service. Never changes. at least 1 character; at most 50 characters.
titlestringyesat most 80 characters.
summarystringyesOne sentence: what the diagram shows. at most 300 characters.
whenToUsestringnoTwo or three sentences: when to start from it, and when not to. at most 600 characters.
tagsstring[]noWords a search should match, such as payments.
templatesobjectyesThe Plotwork source of each flavour (neutral, aws, azure, gcp), at least one, with {{slot}} markers inside quoted labels.
templates.neutralstringnoat most 10000 characters.
templates.awsstringnoat most 10000 characters.
templates.azurestringnoat most 10000 characters.
templates.gcpstringnoat most 10000 characters.
slotsobject[]no
slots[].idstringyesLowercase words joined with hyphens; written {{id}} inside a quoted label of the source. at least 1 character; at most 40 characters.
slots[].defaultstringyesThe text the slot has when nothing replaces it. No quotes or line breaks. at most 60 characters.
slots[].meaningstringyesOne line on what belongs in the slot, so an agent fills it with the right thing. at most 200 characters.
notesobjectnoWhat to keep, what to rename, and when to split. Left out, each has a plain default.
notes.keepstringnoat most 400 characters.
notes.renamestringnoat most 400 characters.
notes.splitstringnoat most 400 characters.

Responses

StatusMeaningBody
201The pattern as saved.OrganisationPattern
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403The role may not (orgs.forbidden), the plan does not include the policies (plan.governance_not_included), the organisation has 50 patterns (orgs.pattern_limit_reached), or the request came from an origin that may not make changes.ErrorResponse
404No such organisation, or the caller is not a member of it.ErrorResponse
409The organisation has a pattern of that name (orgs.pattern_exists).ErrorResponse
422The pattern has problems (orgs.pattern_invalid, every problem in details).ErrorResponse
429Too many requests.ErrorResponse
503Organisations are not set up on this server.ErrorResponse

Response body

A 201 answer has the type OrganisationPattern.

FieldTypeRequiredDescription
idstringyesWhat the tools take: org:<name>.
namestringyesThe name after org:.
titlestringyes
summarystringyes
whenToUsestringyes
kindstringyesThe kind of diagram, such as flow.
tagsstring[]yes
flavours("neutral" | "aws" | "azure" | "gcp")[]yes
slotCountintegeryesminimum 0.
createdAtintegeryes
updatedAtintegeryes
updatedBystring | nullyesThe account that last saved it, or null once that account is gone.
templatesobjectyesThe Plotwork source of each flavour (neutral, aws, azure, gcp), at least one, with {{slot}} markers inside quoted labels.
templates.neutralstringnoat most 10000 characters.
templates.awsstringnoat most 10000 characters.
templates.azurestringnoat most 10000 characters.
templates.gcpstringnoat most 10000 characters.
slotsobject[]yes
slots[].idstringyesLowercase words joined with hyphens; written {{id}} inside a quoted label of the source. at least 1 character; at most 40 characters.
slots[].defaultstringyesThe text the slot has when nothing replaces it. No quotes or line breaks. at most 60 characters.
slots[].meaningstringyesOne line on what belongs in the slot, so an agent fills it with the right thing. at most 200 characters.
notesobjectyes
notes.keepstringyesWhat to leave exactly as it is.
notes.renamestringyesWhat to rename or replace, and how.
notes.splitstringyesWhen the diagram has grown too big, and where to cut it.

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools