Skip to content

Reserve an invoice-document upload through the API Worker

POST
/uploads
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 }'
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.

Media typeapplication/json
object
mediaType
required
string
Allowed values: application/pdf application/xml text/xml image/png image/jpeg image/tiff
byteSize
required
integer
>= 1

Upload target created

Media typeapplication/json
object
upload_id
required
string format: uuid
upload_url
required
string format: uri-reference
upload_method
required
string
Allowed values: PUT
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
object
error
required
object
code
required
string
Allowed values: NOT_FOUND UNAUTHORIZED FORBIDDEN INVALID_REQUEST CONFLICT RATE_LIMITED USAGE_LIMIT_EXCEEDED PROCESSING_FAILED
message
required
string
request_id
required
string
details

Optional stable, content-free context, e.g. {reason, resets_at, preparation_id}.

object
key
additional properties
One of:
string

Example

{
"error": {
"code": "NOT_FOUND"
}
}

Missing or invalid API key

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: NOT_FOUND UNAUTHORIZED FORBIDDEN INVALID_REQUEST CONFLICT RATE_LIMITED USAGE_LIMIT_EXCEEDED PROCESSING_FAILED
message
required
string
request_id
required
string
details

Optional stable, content-free context, e.g. {reason, resets_at, preparation_id}.

object
key
additional properties
One of:
string

Example

{
"error": {
"code": "NOT_FOUND"
}
}