API Reference

Easy-to-follow guide for endpoints, parameters, and usage

Getting Started

Step 1: Create an Imagecogni Account

Sign Up: Register for free with your email ID.

Email Verification: You'll receive a confirmation email. Use the link to activate your account and set a secure password.

Step 2: Authentication

IP Whitelisting: Upon registration, your IP is whitelisted. Free plans allow up to 3 IPs; additional IPs require a paid subscription (see Pricing).

Manage IPs: Account owners can activate or deactivate IPs within plan limits. Upgrade your account or deactivate an existing IP to add a new one.

Step 3: Obtain API Keys

Access API Keys: API keys for authentication are available in your dashboard under the API Library section.

 

Setup & Configuration

Step 1: Navigate to Setup & Configuration

Go to Media Operations to create configurations required for media processing.

Step 2: Plan Features

Features available depend on your subscription plan. Visit My Plan for details on your plan's features and limitations.

Step 3: Select Features

Feature Selection: Choose the desired features and specify output file properties.

For example, to resize an image, you can select any of the following options and enter the respective output values:

  • Resize by resolution (height, width)

  • Resize by percentage of the input file

  • Resize using templates (e.g., Facebook, Instagram)

Apply up to 20 different sizes in one action. Repeat resize in sequence if needed.

Step 4: Processing Order

Select the order of optimization or transformation when applying multiple features. 

Hint: For efficient processing with minimal credit point consumption, order the sequence based on the number of required outputs for each feature. Start with the feature that has the fewest outputs and proceed accordingly.

Step 5: Postback URL

Provide a URL to download the processed file. Different configurations can have different URLs.

Step 6: Save Configuration

Name and save the configuration for API integrations and future use. Configuration limits depend on your subscription plan.

 

Transform API

 

Parameter

Description

URL

https://api.imagecogni.com/api/v1/transform

Method

POST

Content Type

multipart/form-data

Header

Authorization: A valid API Key from your imagecogni account in the authorization header

 

Request Body

configId string

ID of the configuration created in your imagecogni account, available in Setup and Configuration

sources List<multipart>

List of source files for processing, limit up to 40 MB

 

Response Body

Status

Parameter and Description

Success

  • jobId string : A unique ID to identify your processed file. Example 'jobId' : "ICJB1829"
  • status string : Status "success" means the image optimisation process is successfully initiated

Failed

  • status string : Status "failed" means the image optimisation process is failed due to some reason.
  • message string : Reason for the failure

Note: In order to ensure effective tracking and management of your jobs, it is essential to save the jobId for future reference. When your callback API is triggered, you will receive both the jobId and the configId in the request. Storing these identifiers will allow you to easily reference specific jobs and their associated configurations later on.

 

Postback URL

This URL should be a valid endpoint to which the result of the optimised images are posted to you.  Also, it should accept the below parameters

Parameter

Description

outputZipFile multipart

A ZIP file that includes the output generated from the submitted configuration.

jobId string

 

The Job ID obtained from the upload and convert API.

configId string

The configuration ID that was included in the request parameters.

Output Files

After your image files have been processed, you can download the results from the postback URL that you specified during the configuration setup. Once the download is complete, you'll find a ZIP file that contains two distinct folders:

  1. Configuration Folder: Inside this folder, you will find a JSON file that corresponds to the configuration you saved. This file details the parameters and configuration settings used during the optimization process.

  2. Output Folder: This folder contains the optimized files in the expected output format, size, etc. You can navigate through the named folders to find the processed images.

For clarity, refer to the provided screenshot that visually demonstrates the structure of the ZIP file and its contents. This organization of folders will help you efficiently locate and utilize the files you need for your projects.