Upload Image

Introduction

The Upload Image API is a core service within the Artifi platform that enables users to upload custom images for use in product personalization and other media-driven workflows. It plays a critical role in scenarios where end users need to incorporate their own visual assets - such as photos, logos, or artwork - into customizable products like t-shirts, mugs, and promotional products.

This API accepts image files via multipart form data and performs a series of validations and processing steps to ensure compatibility with the platform’s configuration. Uploaded files are validated against predefined rules, including supported file formats, file size limits, and image dimensions. Once validated, the system processes the image by generating optimized versions such as standard and thumbnail sizes for efficient rendering across different use cases.

Use Cases

• Product Personalization

Allows customers to upload their own images (photos, logos, artwork) while customizing products such as t-shirts, mugs, phone cases, and other promotional items. The uploaded image can be directly applied to the design canvas.

• Logo Upload for Branding

Supports businesses and organizations in uploading logos for use in branded merchandise, marketing materials, and custom product designs.

• Artwork Submission for Custom Printing

Facilitates designers and customers in uploading high-resolution artwork files (including vector formats) for printing on physical products, ensuring quality output.

• Marketing and Campaign Assets

Allows internal teams or users to upload images for use in marketing campaigns, banners, and promotional creatives within the platform.

• Content Moderation and Compliance

Uses optional brand detection capabilities to identify logos or restricted content in uploaded images, helping enforce platform policies and compliance requirements.

• Thumbnail and Preview Generation

Automatically generates optimized versions of uploaded images (such as thumbnails) for quick previews in product design tools and galleries.

• Multi-Format Image Handling

Supports uploading of both raster and vector image formats, enabling flexibility for different use cases such as high-quality printing (vector) and quick previews (raster).

• Reusable Image Library

Stores uploaded images so users can reuse them across multiple designs or sessions without needing to upload the same asset repeatedly.

• Integration with Design Workflows

Seamlessly integrates with the product design editor, allowing uploaded images to be instantly available for positioning, scaling, and customization within the design interface.

API Details

curl --location --request POST \

  --header 'websiteId: 101' \

  --header 'webApiClientKeyyour_client_key' \

Parameters

Header Validation

Header Name 

Type 

Required 

Description 

websiteId 

int 

Yes 

Unique identifier of the website. 

webApiClientKey 

string 

Yes 

API client key used for authentication. 

Query Parameters

Name 

Type 

Required 

Description 

UserId 

string 

Yes 

This is a unique field to identify any product. In this field, users can send either 

Product base SKU/ProductCode or Variant SKU. This field should be matched with the product available in Admin. 

If Artifi receives the base product code/SKU and the product has variants, then we are sending back the 

default SKU details of that product. 

 

DPI 

int 

No 

Minimum DPI (dots per inch) requirement. If provided, the uploaded image's DPI is validated against this value. Upload is rejected if the image DPI is below this threshold. Must be greater than 0 if provided. 

IsBrandDetectionEnable 

bool 

No 

When true, the uploaded image is analyzed by Cognitive Services to detect known brand logos. Results are included in the response data. 

Success Responses

{ 
"Response": "Success", 
"Message": "", 
"Data": { 
"Id": 340927, 
"ImageName": "ArtifiLogo.png", 
"UniqueName": "...", 
"Width": 355, 
"Height": 142, 
"DPI": 96, 
"Extension": ".png", 
"MimeType": "image/png", 
"PhotoCode": "340706", 
"OriginalURL":"OriginalURL", 
"StandardURL": "StandardURL", 
"ThumbnailURL": "ThumbnailURL 
}, 
"ErrorCode": "" 
}

Error Code List (Click Here)

Q&A

Q1. What does the Upload Image API do? 
The Upload Image API allows users to upload custom image files to the system for use in product personalization, branding, and other media-related workflows

Q2. What type of files can be uploaded using this API? 
The API supports multiple image formats, including both raster (e.g., PNG, JPG) and vector formats, as long as they meet the platform’s validation rules.

Q3. How is the image uploaded to the API? 
Images are uploaded using a multipart/form-data request with the file passed in the postedFile parameter.

Q4. What validations are performed on the uploaded image? 
The API validates file format, file size, dimensions, and optionally DPI (dots per inch) to ensure compatibility with the platform.

Q5. What happens if the uploaded image does not meet the DPI requirement? 
If a DPI value is provided and the uploaded image has a lower DPI, the upload request will be rejected.

Q6. What is the purpose of the isBrandDetectionEnable parameter? 
When enabled, this parameter triggers brand/logo detection using cognitive services, allowing identification of known logos in the uploaded image.

Q7. What does the API return on a successful upload? 
The API returns metadata about the uploaded image, including dimensions, DPI, file type, unique identifiers, and URLs for original, standard, and thumbnail versions.

Q8. Are multiple image versions generated after upload? 
Yes, the system automatically generates optimized versions such as standard and thumbnail images for efficient rendering.

Q9. Is authentication required to use this API? 
Yes, the request must include websiteId and webApiClientKey headers for validation and authentication.

Q10. Can uploaded images be reused later? 
Yes, uploaded images are stored and can be reused across multiple designs or sessions without needing to upload them again.

Q11. What is the role of the UserId parameter? 
The UserId uniquely identifies the context of the upload and can represent a product base SKU, product code, or variant SKU mapped in the system.

Q12. What happens if a base product code with variants is provided in UserId? 
If a base product code is provided and variants exist, the system returns details of the default variant SKU.

Q13. What type of response format does the API return? 
The API returns a structured JSON response containing status, message, data object, and error code.

Q14. Where can I find details about error codes?

Error code details are documented separately and should be referenced through the provided Error Code documentation link.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.