Skip to content
Leadtime
English
Esc
navigateopen⌘Jpreview

Attach a file to an object

Upload via POST /workspace/upload first, then pass fileId here.

POST/objects/{id}/files
Authorization
AuthorizationOAuth2 access token · headerrequired
Scopes:api:write
or
AuthorizationBearer token (JWT) · headerrequired
Path parameters
idstringrequired
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
categoryIdobject | null
Workspace object file category id
descriptionobject | null
fileIdstringrequired
File id from POST /workspace/upload
Responses
200
categoryobject | nullrequired
Show properties
idstringrequired
namestringrequired
createdAtstringrequired
descriptionobject | nullrequired
fileobjectrequired
idstringrequired
ObjectFile join row id (use for DELETE)
uploadedBystringrequired
401Unauthorized - Invalid or missing authentication token
403Forbidden - Insufficient API scopes or permissions
Request
curl -X POST "https://leadtime.app/api/public/objects/string/files" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "categoryId": {},
  "description": {},
  "fileId": "string"
}'
Response
{
  "category": {
    "id": "string",
    "name": "string"
  },
  "createdAt": "string",
  "description": {},
  "file": {},
  "id": "string",
  "uploadedBy": "string"
}