Reserve an invoice-document upload through the API Worker
POST
/uploads
const url = 'https://api.invogi.com/v1/uploads';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"mediaType":"application/pdf","byteSize":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.invogi.com/v1/uploads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "mediaType": "application/pdf", "byteSize": 1 }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”X-Invogi-Organization
string format: uuid
For a Clerk session, selects a workspace in which the user has an active membership. If omitted, the remembered accessible workspace is used. API keys remain bound to their own workspace and cannot select another tenant.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
mediaType
required
string
byteSize
required
integer
Responses
Section titled “Responses”Upload target created
Media typeapplication/json
object
upload_id
required
string format: uuid
upload_url
required
string format: uri-reference
upload_method
required
string
expires_at
required
Enforced expiry timestamp; content PUTs after this time are rejected
string format: date-time
Example
{ "upload_method": "PUT"}Invalid request
Media typeapplication/json
Missing or invalid API key
Media typeapplication/json