Export a project component to the library
Exports a project component to the workspace library, making it available for reuse across all projects. The exported component includes all nested data (items, questions, todos, test cases, conditions) with ID references automatically updated. The component is placed at the end of the library with an optional custom name. Requires both Projects.manageComponents and ProjectComponentsLibrary.edit permissions.
POST
/projects/{projectId}/components/{id}/exportAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredPath parameters
projectIdstringrequiredProject UUID
idstringrequiredComponent UUID to export
Query parameters
fieldsToReturnstringComma-separated list of top-level response fields to return. Overrides the endpoint compact default unless responseShape=full is used.
responseShapestringAdvanced 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:
compactfullHeader parameters
LT-Response-ShapestringAdvanced override. Set to full only when you need the complete endpoint response, including nested fields that are not selectable with fieldsToReturn.
Allowed:
fullRequest body
requiredapplication/jsonnamestringCustom name for the library component. If not provided, uses original component name.
Responses
201Component exported to library successfully
idstringrequiredUUID of the created library component
400Invalid projectId or component id format
401Unauthorized - Invalid or missing authentication token
403Insufficient permissions to manage components or edit library, or no access to project
404Component not found, deleted, or does not belong to the specified project
Request
curl -X POST "https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/components/e57dc37b-7693-4d06-b49c-17084b773aff/export" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Authentication Module Template"
}'const response = await fetch("https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/components/e57dc37b-7693-4d06-b49c-17084b773aff/export", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Authentication Module Template"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/projects/a47dc37b-7693-4d06-b49c-17084b773aff/components/e57dc37b-7693-4d06-b49c-17084b773aff/export",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"name": "Authentication Module Template"
},
)Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}Invalid projectId or component id format
Unauthorized - Invalid or missing authentication token
Insufficient permissions to manage components or edit library, or no access to project
Component not found, deleted, or does not belong to the specified project