POST /v1/projects/from-template
POST/v1/projects/from-template
Creates a project and immediately applies a task template to it.
Body: \{ templateId, inputs?, projectFields \}.
Permissions: task_template_view and project_create. If either is
missing, the route answers 403. task_template_instantiate alone is
not enough.
projectFields is validated like the body of POST /v1/projects:
- Unknown fields and invalid values:
422Validation Error. - System and protected fields (
_id,tenantId,version,createdAt,deletedAt,schema, …) are also rejected with422.POST /v1/projectsdrops them silently. A GET response therefore cannot be sent back unchanged asprojectFields. sourceTemplateIdandsourceTemplateVersionare set by the server fromtemplateId; in the body they result in422.- References (
partyId,managerId,teamUserIds,orgUnitId,salesOrderId,contractId,defaultBoardId,customerAccess.allowedPartyIds,partyAddressId,parentProjectId) must belong to the caller’s own tenant, otherwise422(PROJECT_REFERENCE_NOT_IN_TENANT,PARTY_ADDRESS_*,PROJECT_PARENT_*). endDatebeforestartDate(calendar day):422PROJECT_END_BEFORE_START, the same response asPOST /v1/projects. The same day and an open end are valid.
The template is checked before anything is created: an unknown, deleted
or foreign-tenant template returns 404, a draft template 409.
Nothing is written when a request is rejected.
Data model
This operation works on the entity Project (project). All 50 fields — type, validation, required status, relationships — are listed in the schema reference.
Example
curl -X POST https://api.codemeta-os.de/v1/projects/from-template \
-H "X-Tenant-Id: $TENANT" \
-b cookies.txtconst result = await cm.projects.post();Response codes
| HTTP | Meaning |
|---|---|
200 |
Default Response |