{"openapi":"3.0.2","info":{"title":"BIM Ingest API","description":"Creates, uploads, lists, downloads, and deletes BIM ingest records.","version":"0.1.0"},"servers":[{"url":"https://ingest.evercam.io/bim","description":"BIM Ingest API (ingest-bim)"}],"paths":{"/{project_id}/upload":{"put":{"tags":["BIM"],"summary":"Upload BIM files","description":"Stores BIM files on an existing upload and notifies the uploader.","operationId":"upload_bim__project_id__upload_put","parameters":[{"required":true,"schema":{"title":"Project Id","type":"string"},"name":"project_id","in":"path"},{"description":"Existing BIM upload record ID.","required":true,"schema":{"title":"Id","type":"string","description":"Existing BIM upload record ID."},"name":"id","in":"query"},{"description":"Project display name used in the notification and sanitized for the dated archive filename.","required":true,"schema":{"title":"Name","type":"string","description":"Project display name used in the notification and sanitized for the dated archive filename."},"name":"name","in":"query"}],"requestBody":{"description":"TUS references to NWD, NWC, SP, RVT, or IFC files to add to the BIM archive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}},"required":true},"responses":{"200":{"description":"Legacy two-item JSON array containing `Response` and `Uploaded successfully`.","content":{"application/json":{"schema":{"title":"Response Upload Bim  Project Id  Upload Put","maxItems":2,"minItems":2,"uniqueItems":true,"type":"array","items":{"enum":["Response","Uploaded successfully"],"type":"string"}}}}},"401":{"description":"Invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"403":{"description":"Project access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"404":{"description":"BIM upload not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"500":{"description":"BIM upload failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]},"post":{"tags":["BIM"],"summary":"Create a BIM upload","description":"Creates or reuses an empty BIM upload record for the caller.","operationId":"create_bim__project_id__upload_post","parameters":[{"required":true,"schema":{"title":"Project Id","type":"string"},"name":"project_id","in":"path"}],"responses":{"200":{"description":"Reusable or newly created empty BIM upload record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BIMUploadResponse"}}}},"401":{"description":"Invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"403":{"description":"Project access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/uploads/":{"get":{"tags":["BIM Uploads"],"summary":"List BIM uploads","description":"Returns a filtered, sorted page of BIM upload records.","operationId":"get_bim_uploads_uploads__get","parameters":[{"description":"One-based page number.","required":false,"schema":{"title":"Page","type":"integer","description":"One-based page number.","default":1},"name":"page","in":"query"},{"description":"Maximum BIM uploads returned per page.","required":false,"schema":{"title":"Limit","type":"integer","description":"Maximum BIM uploads returned per page.","default":10},"name":"limit","in":"query"},{"description":"Project external ID. Non-admin access matches exactly; admin searches use a substring match.","required":false,"schema":{"title":"Project Id","type":"string","description":"Project external ID. Non-admin access matches exactly; admin searches use a substring match."},"name":"project_id","in":"query"},{"description":"Substring match on uploader email.","required":false,"schema":{"title":"Uploaded By","type":"string","description":"Substring match on uploader email."},"name":"uploaded_by","in":"query"},{"description":"Exact numeric BIM upload ID.","required":false,"schema":{"title":"Id","type":"string","description":"Exact numeric BIM upload ID."},"name":"id","in":"query"},{"description":"Comma-separated sorting fields. Format: field|asc or field|desc. Allowed fields: id, project_id, updated_at, uploaded_by.","required":false,"schema":{"title":"Sort","type":"string","description":"Comma-separated sorting fields. Format: field|asc or field|desc. Allowed fields: id, project_id, updated_at, uploaded_by."},"example":"updated_at|desc","name":"sort","in":"query"}],"responses":{"200":{"description":"Filtered page of BIM upload records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BIMUploadsResponse"}}}},"401":{"description":"Invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"403":{"description":"Project access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/uploads/archive/{id}":{"get":{"tags":["BIM Uploads"],"summary":"Get a BIM archive link","description":"Returns a signed download link for the stored BIM archive.","operationId":"get_archive_archive_uploads_archive__id__get","parameters":[{"required":true,"schema":{"title":"Id","type":"integer"},"name":"id","in":"path"}],"responses":{"200":{"description":"Temporary archive URL returned as a JSON string","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedLinkResponse"}}}},"400":{"description":"Archive unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"401":{"description":"Invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"403":{"description":"Project access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}},"/uploads/{id}":{"delete":{"tags":["BIM Uploads"],"summary":"Delete a BIM upload","description":"Deletes a BIM upload and its stored artifacts.","operationId":"delete_bim_upload_uploads__id__delete","parameters":[{"required":true,"schema":{"title":"Id","type":"integer"},"name":"id","in":"path"}],"responses":{"200":{"description":"Empty JSON object after deletion","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyObjectResponse"}}}},"401":{"description":"Invalid bearer token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"403":{"description":"Project access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"404":{"description":"BIM upload not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"503":{"description":"Authentication service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPErrorResponse"}}}}},"security":[{"HTTPBearer":[]},{"APIKeyHeader":[]}]}}},"components":{"schemas":{"BIMUploadResponse":{"title":"BIMUploadResponse","required":["id","project_id","archive","inserted_at","updated_at"],"type":"object","properties":{"id":{"title":"Id","type":"integer"},"project_id":{"title":"Project Id","type":"string"},"files":{"title":"Files","type":"array","items":{"type":"string"},"description":"Stored BIM object paths; empty or null before files are uploaded."},"archive":{"title":"Archive","type":"string","description":"Stored ZIP archive path; empty before files are uploaded."},"uploaded_by":{"title":"Uploaded By","type":"string"},"inserted_at":{"title":"Inserted At","type":"string","format":"date-time"},"updated_at":{"title":"Updated At","type":"string","format":"date-time"}},"description":"Stored BIM upload and its archive path."},"BIMUploadsResponse":{"title":"BIMUploadsResponse","required":["items","page","limit","total"],"type":"object","properties":{"items":{"title":"Items","type":"array","items":{"$ref":"#/components/schemas/BIMUploadResponse"}},"page":{"title":"Page","type":"integer"},"limit":{"title":"Limit","type":"integer"},"total":{"title":"Total","type":"integer"}},"description":"Page of stored BIM uploads."},"EmptyObjectResponse":{"title":"EmptyObjectResponse","type":"object","properties":{},"additionalProperties":false,"description":"An empty JSON object returned after a completed operation."},"HTTPErrorResponse":{"title":"HTTPErrorResponse","type":"object","properties":{"detail":{"title":"Detail","type":"string","description":"Human-readable error detail, or null when no detail is supplied.","nullable":true}},"description":"Error response returned by an API operation."},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"SignedLinkResponse":{"title":"SignedLinkResponse","type":"string","description":"A temporary signed URL returned as a JSON string."},"Upload":{"title":"Upload","required":["url","title","file_extension"],"type":"object","properties":{"url":{"title":"Url","type":"string","description":"TUS resource URL for the uploaded file."},"title":{"title":"Title","type":"string","description":"Source filename without its extension."},"file_extension":{"title":"File Extension","type":"string","description":"Source filename extension without a leading dot."}},"description":"Reference to one file already uploaded through TUS."},"UploadRequest":{"title":"UploadRequest","required":["upload"],"type":"object","properties":{"upload":{"title":"Upload","type":"array","items":{"$ref":"#/components/schemas/Upload"}}},"description":"TUS file references submitted for an ingest record."},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"},"APIKeyHeader":{"type":"apiKey","in":"header","name":"x-access-key"}}},"tags":[{"name":"BIM","description":"BIM record creation and file submission."},{"name":"BIM Uploads","description":"BIM upload history and archives."}]}