Zum Inhalt springen
Leadtime
Deutsch
Esc
navigateopen⌘Jpreview

Import components from library into project

Imports one or more reusable component templates from the workspace component library into the specified project.

Component Library vs Project Components: The component system operates in two contexts:

  • Library Components: Workspace-wide reusable templates (projectId is null). These are blueprints with no live data - questions are defined but not answered, todos are not checked, test cases are not evaluated. Library components serve as templates that can be reused across multiple projects.
  • Project Components: Live instances in projects (projectId is set). These contain actual project data - questions can be answered, todos can be checked off, test cases can be evaluated, and items can be connected to tasks in the task management system.

What Gets Imported: When you import a library component, the complete component structure is duplicated into the project, including:

  • All items (Epics, Work Packages, Todo Lists, Test Suites) with their complete hierarchy and nesting
  • All questions with their options and configurations (answers are initialized as empty/unanswered)
  • All todos with their descriptions (completion status is initialized as not done)
  • All test cases with steps and expected results (evaluations are initialized as not tested)
  • All conditions with their logic (automatically updated to reference the new item/question/todo/test case IDs in the project)

Automatic Processing: After import, the system automatically:

  • Recalculates all conditions to ensure they reference the correct items in the project
  • Recalculates timeframes based on work packages and their configurations
  • Adds the imported components to the end of the project component list
  • Marks the project configuration as changed

Use Case: This endpoint is perfect for standardizing project setup. Create reusable templates in the library once, then import them into new projects to get a consistent starting structure that can be customized per project.

POST/projects/{projectId}/components/import-from-library
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
projectIdstringrequired
Query parameters
fieldsToReturnstring
Comma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestring
Advanced override. Omit for the endpoint compact default. Use full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:compactfull
Header parameters
LT-Response-Shapestring
Advanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:full
Request body
requiredapplication/json
componentIdsstring[]required
Array of library component IDs to import
Responses
201Components imported successfully
idsstring[]required
Array of imported component IDs
400Invalid request: empty componentIds array or invalid UUID format
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions to import components or access to project denied
404Project not found or component not found in library
Request
curl -X POST "https://leadtime.app/api/public/projects/string/components/import-from-library" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "componentIds": [
    "e57dc37b-7693-4d06-b49c-17084b773aff",
    "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  ]
}'
Response
{
  "ids": [
    "f1a2b3c4-d5e6-7890-abcd-ef1234567890"
  ]
}