Upload an image
Upload an image to your account.
Sample Request
Here’s a sample request to upload an image:
POST /v1/uploadContent-Type: multipart/form-data// Create form dataconst fileInput = document.getElementById('fileInput');const formData = new FormData();formData.append('file', fileInput.files[0]);
// Optional: add tags to organize your uploadsformData.append('tags', 'product');formData.append('tags', 'featured');
// Optional: add an external ID to link with your own systemformData.append('externalId', 'your-external-reference-id');
fetch('https://api.templated.io/v1/upload', { method: 'POST', body: formData, headers: { 'Authorization' : `Bearer ${API_KEY}` }})Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The image file to upload (JPG, PNG, or WebP). Maximum size: 2MB |
tags | String[] | No | Optional tags to organize your uploads. Can be provided multiple times |
externalId | String | No | Optional external reference ID to link the upload with records in your own system |