Create a Video
Creating an image is done by sending a POST request to the following URL:
https://krumzi.com/api/dynamic/videoDue to the time it takes to render a video as opposed to an image, the video creation process is asynchronous. This means that the video will be created into the background and you will not receive the generated video immediately. Once the video is ready, you will receive a webhook request with the video URL and it will be visible in the dashboard.
Request Headers
The following header is required:
X-API-KEY: Your API key
Request Body
The request body should contain the following attributes:
| Attribute | Type | Required | Description |
|---|---|---|---|
| template_id | string | Yes | The ID of the dynamic template that you want to use to create the video. |
| resolution | 720P or FULL_HD | Yes | The resolution in which the video will be rendered. |
| modifications | object | Yes | An object containing the modifications to be made to the video. 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
| Attribute | Type | Required | Description |
|---|---|---|---|
| content | string | Yes | The 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. |
| hide | boolean | No | If true, the placeholder will be hidden. |
Example Request
SAMPLE REQUEST
const data = {
template_id : "550e8400-e29b-41d4-a716-446655440000",
resolution: '720P',
modifications: {
first_placeholder: {
content: "Example content 1",
hide: false
},
second_placeholder: {
content: "Example content 2",
hide: true
}
}
}
fetch('https://krumzi.com/api/dynamic/video', {
method: 'POST',
body: JSON.stringify(data),
headers: {
'Content-Type' : 'application/json',
'API-KEY' : `${API_KEY}`
}
})Response Body
SAMPLE RESPONSE
{
id: "3qei76kgl",
status: "pending",
credits_used: 10
}Important Notes
- This endpoint is not available for free plan users. You must have a paid plan to use this feature.
- Each video second creation consumes 1 automation credit from your account. If the video is 10 seconds, it will consume 10 automation credits.
- There is a rate limit of 10 requests per 10 seconds for this endpoint.
- 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