Skip to content

Template Assets

This guide provides detailed information on how to interact with our API to manage and utilize background assets for your templates.


Uploading Background Assets

This endpoint allows you to upload background images or videos that can be used later when creating templates for your video generation projects.

Remember to set the Content-Type header to multipart/form-data when making this request.

Example Request

Here's an example of how to upload an image using curl:

curl --request POST \
     --url 'https://api.immersive-fox.com/v1/template/background_asset_upload/' \
     --header 'X-Api-Key: <your-api-key>' \
     --header 'Content-Type: multipart/form-data' \
     --form 'type=image' \
     --form 'image=@/path/to/your/image.jpg' \
     --form 'thumbnail=@/path/to/your/thumbnail.jpg'
{
    "id": 123,
    "image": "https://url/to/your/image.jpg",
    "thumbnail": "https://url/to/your/thumbnail.jpg"
}

To upload a video, you would use type=video and video=@/path/to/your/video.mp4 instead.

Notes

  • The type field must be either "image" or "video", depending on the type of asset you're uploading.
  • When uploading an image, you must also provide a thumbnail image in the thumbnail field.
  • The uploaded assets can be referenced when creating templates for video generation.

Listing Background Assets

This endpoint allows you to list background images and videos that have been uploaded as assets. You can filter the results by specifying the type of asset you are interested in.

Make sure to include the type query parameter in your request, which can be either "image", "video". You can also specify "color" to list the default colors that can be used as a backgronud.

Example Request

Here's an example of how to list background assets using curl:

curl --request GET \
     --url 'https://api.immersive-fox.com/v1/template/background_assets/?type=image' \
     --header 'X-Api-Key: <your-api-key>'
[
    {
        "id": 123,
        "image": "https://url/to/your/image.jpg",
        "thumbnail": "https://url/to/your/thumbnail.jpg"
    },
    {
        "id": 124,
        "image": "https://url/to/another/image.jpg",
        "thumbnail": "https://url/to/another/thumbnail.jpg"
    }
]