Create an Image

Create an Image

Creating an image is done by sending a POST request to the following URL:

https://krumzi.com/api/dynamic/image

The image creation process is synchronous. This means that the image will be created and you will receive a response with the image URL in the response body, without having to wait for a webhook request.

Creating an image usually takes less than 10 seconds.

Request Headers

The following header is required:

  • X-API-KEY: Your API key

Request Body

The request body should contain the following attributes:

AttributeTypeRequiredDescription
template_idstringYesThe ID of the dynamic template that you want to use to create the image.
modificationsobjectYesAn object containing the modifications to be made to the image. Each key in the object represents the placeholder_key of each element that you defined as a placeholder in your dynamic template. The value of each key is an object with a content key, which is the content that you want to replace the placeholder with.

Modifications Object Values

AttributeTypeRequiredDescription
contentstringYesThe content that you want to replace the placeholder with. If the placeholder is an image or video, the content should be the URL that points to the new image or video.
hidebooleanNoIf true, the placeholder will be hidden.

Example Request

SAMPLE REQUEST
const data = {
  template_id : "550e8400-e29b-41d4-a716-446655440000",
  modifications: {
    first_placeholder: {
      content: "Example content 1",
      hide: false
    },
    second_placeholder: {
      content: "Example content 2",
      hide: true
    }
  }
}
 
fetch('https://krumzi.com/api/dynamic/image', {
  method: 'POST',
  body: JSON.stringify(data),
  headers: {
    'Content-Type' : 'application/json',
    'API-KEY' : `${API_KEY}`
  }
})

Response Body

SAMPLE RESPONSE
{
  url: "https://assets.krumzi.com/images/1234567890.png"
}

Important Notes

  1. This endpoint is not available for free plan users. You must have a paid plan to use this feature.
  2. Each image creation consumes 1 automation credit from your account.
  3. There is a rate limit of 10 requests per 10 seconds for this endpoint.
  4. Ensure you have sufficient automation credits before making a request.

Error Responses

  • 401 Unauthorized: If the API key is missing or invalid
  • 402 Payment Required: If you don't have enough automation credits
  • 403 Forbidden: If you're on a free plan
  • 429 Too Many Requests: If you exceed the rate limit
  • 500 Internal Server Error: If there's an issue creating the image