API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console

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: 422 Validation Error.
  • System and protected fields (_id, tenantId, version, createdAt, deletedAt, schema, …) are also rejected with 422. POST /v1/projects drops them silently. A GET response therefore cannot be sent back unchanged as projectFields.
  • sourceTemplateId and sourceTemplateVersion are set by the server from templateId; in the body they result in 422.
  • References (partyId, managerId, teamUserIds, orgUnitId, salesOrderId, contractId, defaultBoardId, customerAccess.allowedPartyIds, partyAddressId, parentProjectId) must belong to the caller’s own tenant, otherwise 422 (PROJECT_REFERENCE_NOT_IN_TENANT, PARTY_ADDRESS_*, PROJECT_PARENT_*).
  • endDate before startDate (calendar day): 422 PROJECT_END_BEFORE_START, the same response as POST /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.txt
const result = await cm.projects.post();

Response codes

HTTP Meaning
200 Default Response

Search