Skip to main content
The GetQR API is in beta and is available to selected workspaces. Details may change before the general release.
PDF, image and video QR codes point at a file, and a custom logo is a file too. Uploading takes two steps: register the file to get a URL, then send the bytes to that URL.

Upload a file

1

Register the file

Call Register a file upload with the file’s target, contentType and size. The target decides the accepted content types and the size limit. You get a fileId and an uploadUrl.
2

Send the file

Send the file with a PUT request to uploadUrl. Its Content-Type and Content-Length must exactly match the contentType and size you registered: anything else is rejected. The URL is pre-signed, so don’t add your API key. It expires after 10 minutes.
3

Use the file ID

Pass fileId when you create a QR code:
  • As fileId for a pdf, image or video QR code. Upload with the matching target.
  • As fileId for the profile image of a vcard, social, multilink or event QR code. Upload with the logo target.
  • As logoOptions.fileId, with logoOptions.type set to uploaded, for a custom logo. Upload with the logo target. See Customization.

Limits

  • Bare MIME type. Send a single lowercase type and subtype, such as image/png. Parameters such as ;charset= and lists are rejected.
  • No SVG. XML-based types such as image/svg+xml aren’t accepted. Upload a raster image such as image/png or image/jpeg.

Headers

string
required
Bearer followed by your API key. See Authentication.
string
required
application/json.

Register a file upload

POST /api/v1/files Registers a file and returns a pre-signed URL to upload it to. This call doesn’t upload the file itself.
string
required
What the file is for: pdf, image, video or logo. Sets the accepted content types and the size limit. See Limits.
string
required
MIME type of the file, for example application/pdf, without parameters. The upload request must send exactly this Content-Type.
integer
required
Exact size of the file in bytes, a positive whole number. Checked against the limit for the target. The upload request must send exactly this Content-Length.
string
Original file name, up to 255 characters. Kept for display in the dashboard. A path with / or \ is rejected.
string
ID to pass as fileId or logoOptions.fileId.
string
Pre-signed URL to PUT the file to.
integer
Seconds until uploadUrl expires: 600.
string
HTTP method for the upload: PUT.

Common issues

The content type doesn’t match the target. For example, pdf accepts only application/pdf. See Limits.
Send the content type in lowercase and without parameters: image/png, not Image/PNG or image/png; charset=utf-8.
The declared size is over the limit for the target. Compress the file before you register it.
The URL expires 10 minutes after you register the file, and the request must send exactly the registered Content-Type and Content-Length. Register the file again to get a new URL.
You registered the file but the PUT to uploadUrl didn’t complete. Upload the file, then create the QR code.
The file was registered with a different target, for example an image file used for a pdf QR code. Register a new upload with the matching target.
The fileId doesn’t exist. Take it from the response of Register a file upload.

What’s next

QR codes

QR types

Customization

Errors