Create an upload session for a draft document
Reserves a one-time upload target for a document you are about to attach to the open draft. Requires the business_info:write permission.
Authorization
AuthorizationstringrequiredPath parameters
businessInfoIdstringrequiredThe business legal entity, as a Snowflake id in decimal string form.
Body
application/json
fileNamestringrequiredThe file's name, kept as the document's description. 1 to 250 characters.
fileSizeintegerrequiredSize of the file in bytes. Must be at least 1, and business info documents are capped at 20 MB.
contentTypestringrequiredThe file's MIME type. Business info documents accept application/pdf and any image/* type. 1 to 200 characters.
Response
200 · The reserved upload target.
sessionIdstringrequiredThe upload session, as a Snowflake id in decimal string form. Send it back as uploadSessionId when attaching the document.
endpointstringrequiredThe pre-signed storage URL to upload the file to.
methodstringrequiredThe HTTP method to use against endpoint, for example POST or PUT.
fieldsobjectrequiredForm fields the storage provider requires with the upload, as name and value pairs. Send all of them.
expiresstring · date-timerequiredWhen the session stops accepting an upload, in the company's timezone.
400 · `fileName`, `fileSize` or `contentType` is missing or out of range.
401 · The request carried no valid access token.
403 · The caller is not a property manager, or is missing the `business_info:write` permission.
422 · This legal entity has no open draft, the draft is not editable, or the file's type or size is not allowed.
Upload the file yourself to the returned endpoint, using the returned method and sending every entry of fields as a form field alongside the file. Then call Attach a document to the draft with sessionId as its uploadSessionId.