Create project upload
Creates a new project upload record, linking an uploaded file to a project.
How to upload files:
- First, upload the file using POST /workspace/upload to obtain a fileId
- Then use that fileId in this endpoint to create the project upload record
Required fields:
- projectId: The project to attach the upload to (must exist and user must have access)
- fileId: The file ID from the workspace upload endpoint (must exist in workspace)
Optional fields:
- description: Free text field for classifying the content (e.g., “Signed contract 10/28/2025”, “Kickoff protocol”)
- categoryId: Thematic classification for organizing uploads (e.g., Contract, Offer, Documentation)
Validation:
- Project must exist and belong to the workspace
- User must have access to the project
- File must exist and belong to the workspace
- Category must exist and belong to the workspace (if provided)
What is returned: Complete upload details including file metadata, timestamps, and user information.
Note: This endpoint requires the Projects.manageUploads permission.
POST
/projects/uploadsAuthorization
AuthorizationOAuth2 access token · headerrequiredScopes:
api:writeor
AuthorizationBearer token (JWT) · headerrequiredQuery 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/jsoncategoryIdobject | nullOptional UUID of a category for organizing uploads thematically (e.g., Contract, Offer, Documentation, Dossier). Categories help with filtering, sorting, and finding files. The category must exist in the workspace. Set to null to create an upload without a category. Categories can be created dynamically during upload if they do not exist yet.
descriptionstringOptional free text description for classifying and identifying the upload content. Use clear, descriptive text like "Signed contract 10/28/2025", "Kickoff protocol", or "Technical specification v2". This helps users quickly understand what the file contains without opening it.
fileIdstringrequiredThe UUID of the file obtained from the POST /workspace/upload endpoint. You must upload the file first using that endpoint to receive a fileId, then use that ID here. The file must exist in the workspace and belong to the same workspace.
projectIdstringrequiredThe UUID of the project to attach this upload to. The project must exist in the workspace and the user must have access to it. This determines which project the file will be associated with.
Responses
200
categoryIdobject | nullrequiredUUID of the category assigned to this upload for thematic organization. Can be null if no category is assigned.
createdAtstringrequiredISO 8601 formatted timestamp indicating when the upload record was created. Format: YYYY-MM-DDTHH:mm:ss.sssZ
descriptionobject | nullrequiredFree text description for classifying the upload content. Can be null if no description was provided.
fileIdstringrequiredUUID of the underlying file in workspace storage. This references the file uploaded via POST /workspace/upload.
fileNamestringrequiredOriginal filename of the uploaded file, as stored in the File relation. This is the name the file had when uploaded.
fileSizenumberrequiredSize of the file in bytes. Use this to display file sizes in a human-readable format (e.g., KB, MB).
idstringrequiredUnique identifier for the project upload record (UUID format)
mimeTypestringrequiredMIME type of the file indicating its format (e.g., application/pdf, image/png, text/plain). Retrieved from the File relation.
projectIdstringrequiredUUID of the project this upload belongs to. Determines which project the file is associated with.
updatedAtstringrequiredISO 8601 formatted timestamp indicating when the upload record was last updated. Format: YYYY-MM-DDTHH:mm:ss.sssZ. This changes whenever any field of the upload is modified.
userIdstringrequiredUUID of the user who created this upload. This identifies who uploaded or last updated the file.
400Validation errors
errorsobjectmessagestringstatusCodenumber401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/projects/uploads" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"categoryId": "123e4567-e89b-12d3-a456-426614174222",
"description": "Project documentation for Q1 2024",
"fileId": "123e4567-e89b-12d3-a456-426614174111",
"projectId": "123e4567-e89b-12d3-a456-426614174000"
}'const response = await fetch("https://leadtime.app/api/public/projects/uploads", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"categoryId": "123e4567-e89b-12d3-a456-426614174222",
"description": "Project documentation for Q1 2024",
"fileId": "123e4567-e89b-12d3-a456-426614174111",
"projectId": "123e4567-e89b-12d3-a456-426614174000"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/projects/uploads",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
},
json={
"categoryId": "123e4567-e89b-12d3-a456-426614174222",
"description": "Project documentation for Q1 2024",
"fileId": "123e4567-e89b-12d3-a456-426614174111",
"projectId": "123e4567-e89b-12d3-a456-426614174000"
},
)Response
{
"categoryId": "123e4567-e89b-12d3-a456-426614174222",
"createdAt": "2024-01-01T12:00:00.000Z",
"description": "Project documentation for Q1 2024",
"fileId": "123e4567-e89b-12d3-a456-426614174111",
"fileName": "documentation.pdf",
"fileSize": 1048576,
"id": "123e4567-e89b-12d3-a456-426614174333",
"mimeType": "application/pdf",
"projectId": "123e4567-e89b-12d3-a456-426614174000",
"updatedAt": "2024-01-02T14:30:00.000Z",
"userId": "123e4567-e89b-12d3-a456-426614174444"
}{
"errors": {
"fileId": [
"File ID is required"
],
"projectId": [
"Project ID is required"
]
},
"message": "Bad Request",
"statusCode": 400
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions