uploads.md

Uploads

API for uploading billing files for savings analysis

Upload a billing file for savings analysis

Accepts a multipart PDF or CSV billing file, stores it in Archera's invoice upload bucket, and returns an upload ID. Use this upload ID when invoking the Savings Analysis MCP tool. The upload status workflow is: PENDING before storage begins, PROCESSING while the file is being transferred, COMPLETE once it is available for analysis, and ERROR if storage fails.

{"openapi":"3.1.0","info":{"title":"Archera.ai API","version":"v1.0.0"},"tags":[{"name":"Uploads","description":"API for uploading billing files for savings analysis"}],"paths":{"/v1/org/{org_id}/uploads":{"post":{"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicUpload"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"405":{"description":"Method not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"422":{"$ref":"#/components/responses/UNPROCESSABLE_CONTENT"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"default":{"$ref":"#/components/responses/DEFAULT_ERROR"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/CreatePublicUpload"}}}},"tags":["Uploads"],"summary":"Upload a billing file for savings analysis","description":"Accepts a multipart PDF or CSV billing file, stores it in Archera's invoice upload bucket, and returns an upload ID. Use this upload ID when invoking the Savings Analysis MCP tool. The upload status workflow is: PENDING before storage begins, PROCESSING while the file is being transferred, COMPLETE once it is available for analysis, and ERROR if storage fails."}}},"components":{"schemas":{"PublicUpload":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"created_at":{"type":"string","format":"date-time","readOnly":true},"org_id":{"type":"string","readOnly":true,"maxLength":50},"file_name":{"type":"string","readOnly":true,"maxLength":255},"content_type":{"type":"string","readOnly":true,"maxLength":255},"size_bytes":{"type":"integer","readOnly":true},"description":{"type":["string","null"],"readOnly":true,"maxLength":255},"upload_status":{"readOnly":true,"type":"string","enum":["PENDING","PROCESSING","COMPLETE","ERROR"]},"source":{"readOnly":true,"enum":["agent_upload","attachment","partner_api"]},"detected_type":{"type":["string","null"],"readOnly":true,"maxLength":64},"available_actions":{"type":"array","readOnly":true,"items":{"type":"string"}}},"required":["content_type","created_at","description","detected_type","file_name","id","org_id","size_bytes","source","upload_status"],"additionalProperties":false},"ApiErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"detail":{},"code":{"type":["string","null"]},"url":{"type":["string","null"]},"timestamp":{"type":"string"},"type":{"type":"string"}},"required":["message","timestamp","type"]},"Error":{"type":"object","properties":{"code":{"type":"integer","description":"Error code"},"status":{"type":"string","description":"Error name"},"message":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Errors","additionalProperties":{}}},"additionalProperties":false},"CreatePublicUpload":{"type":"object","properties":{"description":{"type":["string","null"],"maxLength":255,"description":"Optional partner-supplied context for the uploaded billing file"},"file":{"writeOnly":true,"description":"Billing PDF or CSV file to upload for savings analysis","type":"string","format":"binary"}},"required":["file"],"additionalProperties":false}}},"responses":{"UNPROCESSABLE_CONTENT":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"DEFAULT_ERROR":{"description":"Default error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}

Get uploaded billing file status

Returns metadata and upload status for a partner API upload. Clients can poll this endpoint until upload_status is COMPLETE, then pass the upload ID to the Savings Analysis MCP tool.

{"openapi":"3.1.0","info":{"title":"Archera.ai API","version":"v1.0.0"},"tags":[{"name":"Uploads","description":"API for uploading billing files for savings analysis"}],"paths":{"/v1/org/{org_id}/uploads/{upload_id}":{"get":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicUpload"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"405":{"description":"Method not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"default":{"$ref":"#/components/responses/DEFAULT_ERROR"}},"tags":["Uploads"],"summary":"Get uploaded billing file status","description":"Returns metadata and upload status for a partner API upload. Clients can poll this endpoint until upload_status is COMPLETE, then pass the upload ID to the Savings Analysis MCP tool."}}},"components":{"schemas":{"PublicUpload":{"type":"object","properties":{"id":{"type":"string","format":"uuid","readOnly":true},"created_at":{"type":"string","format":"date-time","readOnly":true},"org_id":{"type":"string","readOnly":true,"maxLength":50},"file_name":{"type":"string","readOnly":true,"maxLength":255},"content_type":{"type":"string","readOnly":true,"maxLength":255},"size_bytes":{"type":"integer","readOnly":true},"description":{"type":["string","null"],"readOnly":true,"maxLength":255},"upload_status":{"readOnly":true,"type":"string","enum":["PENDING","PROCESSING","COMPLETE","ERROR"]},"source":{"readOnly":true,"enum":["agent_upload","attachment","partner_api"]},"detected_type":{"type":["string","null"],"readOnly":true,"maxLength":64},"available_actions":{"type":"array","readOnly":true,"items":{"type":"string"}}},"required":["content_type","created_at","description","detected_type","file_name","id","org_id","size_bytes","source","upload_status"],"additionalProperties":false},"ApiErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"detail":{},"code":{"type":["string","null"]},"url":{"type":["string","null"]},"timestamp":{"type":"string"},"type":{"type":"string"}},"required":["message","timestamp","type"]},"Error":{"type":"object","properties":{"code":{"type":"integer","description":"Error code"},"status":{"type":"string","description":"Error name"},"message":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Errors","additionalProperties":{}}},"additionalProperties":false}}},"responses":{"DEFAULT_ERROR":{"description":"Default error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}