Change one of the organisation's templates
curl --request PUT \ --url https://api.whatsbuilt.fi/v1/organisation/templates/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "example", "is_default": true, "fail_reason_list_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "steps": [ { "name": "example", "description": "example", "required": true, "sequential": true, "check_group_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "fail_reason_list_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ] }'Inspections already opened keep the steps they started with. A change still being saved 25 seconds after the request arrived answers 400 VALIDATION_ERROR with the reason TIME_LIMIT in details and writes nothing: send fewer step changes at a time. A change whose added plus removed steps times the inspections that use the template exceed 30 000 answers 400 VALIDATION_ERROR with the reason TOO_LARGE in details at once, also writing nothing.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”The body of updateOrganisationTemplate.
object
The whole list: a step with id is kept and changed, one without is added, one left out is removed
A step of OrganisationTemplateChanges; with id it is kept and changed.
object
Responses
Section titled “Responses”The template
shapeTemplate(): one of the organisation’s templates with its steps.
object
A step of OrganisationTemplate.
object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "description": "example", "applies_to_types": [ "example" ], "is_default": true, "fail_reason_list_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "created_by": "example", "created_at": "example", "modified_date": "example", "steps": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sort_order": 1, "name": "example", "description": "example", "required": true, "sequential": true, "check_group_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "fail_reason_list_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}Invalid body or parameters
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}Missing, malformed, expired or revoked token
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}INSUFFICIENT_SCOPE; INSUFFICIENT_ROLE when the principal is not an admin of its organisation; PUBLIC_API_DISABLED
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}Not one of the organisation’s own; a project’s answers 404 here
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}The template changed meanwhile, or a removed step has results
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}RATE_LIMITED; wait for Retry-After seconds
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}