Upload file to workspace
Uploads a file to the workspace and returns file metadata including a unique file ID and public URL. This endpoint is used for uploading various file types such as logos, avatars, documents, or custom icons. The uploaded file is associated with the workspace and can be referenced in other API endpoints using the returned file ID. The file is stored securely and a public URL is generated for accessing it. Common use cases include uploading workspace logos (for light and dark themes), user avatars, or custom icon images. The optional type parameter can be used to categorize the file (e.g., “logo”, “avatar”, “document”) for organizational purposes.
POST
/workspace/uploadAuthorization
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
requiredmultipart/form-datafilestringrequiredFile to upload
typestringFile type/category (e.g., "logo", "avatar", "document")
Responses
200
filenamestringrequiredOriginal filename of the uploaded file as provided by the client. This is preserved for reference but may differ from the stored filename.
idstringrequiredUnique file identifier. Use this ID to reference the file in other API endpoints that accept file references (e.g., when setting workspace logos, user avatars, or custom icons).
mimetypestringrequiredMIME type of the uploaded file (e.g., "image/png", "image/jpeg", "image/svg+xml"). Indicates the file format and how it should be processed or displayed.
sizenumberrequiredFile size in bytes. Use this to validate file size limits or display file size information to users.
urlstringrequiredWorkspace-authenticated download URL. Public API clients must send the same Bearer token used for the upload request.
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/workspace/upload" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: multipart/form-data" \
-d '{
"file": "string",
"type": "logo"
}'const response = await fetch("https://leadtime.app/api/public/workspace/upload", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "multipart/form-data"
},
body: JSON.stringify({
"file": "string",
"type": "logo"
})
});import requests
response = requests.post(
"https://leadtime.app/api/public/workspace/upload",
headers={
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "multipart/form-data"
},
json={
"file": "string",
"type": "logo"
},
)Response
{
"filename": "logo.png",
"id": "file_123",
"mimetype": "image/png",
"size": 1024,
"url": "https://app.example.com/api/public/workspace/files/file_123"
}Unauthorized - Invalid or missing authentication token
Forbidden - Insufficient API scopes or permissions