Skip to content

Upload an image

Upload an image to your account.

Sample Request

Here’s a sample request to upload an image:

ENDPOINT
POST /v1/upload
Content-Type: multipart/form-data
// Create form data
const fileInput = document.getElementById('fileInput');
const formData = new FormData();
formData.append('file', fileInput.files[0]);
// Optional: add tags to organize your uploads
formData.append('tags', 'product');
formData.append('tags', 'featured');
// Optional: add an external ID to link with your own system
formData.append('externalId', 'your-external-reference-id');
fetch('https://api.templated.io/v1/upload', {
method: 'POST',
body: formData,
headers: {
'Authorization' : `Bearer ${API_KEY}`
}
})

Parameters

ParameterTypeRequiredDescription
fileFileYesThe image file to upload (JPG, PNG, or WebP). Maximum size: 2MB
tagsString[]NoOptional tags to organize your uploads. Can be provided multiple times
externalIdStringNoOptional external reference ID to link the upload with records in your own system