Skip to main content
POST
Create Template

Overview

Upload a Pictory project file (.pictai) downloaded from the Pictory web app to create a reusable video template. Templates allow you to standardize video creation by defining a base structure with customizable variables that can be populated with different content for each video instance.
You need a valid API key to use this endpoint. Get your API key from the API Access page in your Pictory dashboard.

API Endpoint

Request Parameters

Headers

string
required
API key for authentication (starts with pictai_)
string
required
Must be set to application/octet-stream for file uploads

Body Parameters

file
required
The Pictory project file to upload. Must be a .pictai file exported from the Pictory web application.File Requirements:
  • Format: .pictai (Pictory project file)
  • Source: Downloaded from Pictory web app
  • Content: Complete project configuration including scenes, audio, and variables

Response

string
Unique identifier for the created template
string
Name of the template
string
Language code of the template (e.g., en for English)
boolean
default:true
Whether the template is published and available for use
boolean
default:false
Whether the template has been marked as deprecated
object
Audio configuration for the template
array of objects
Array of scene objects that make up the template
object
Template variables that can be customized when creating videos from this templateCommon variables:
  • customer_name - Customer or recipient name
  • payment_date - Payment or transaction date
  • loan_account_number - Account or reference number
  • customer_support_number - Support contact number
  • support_email_id - Support email address
Variable names depend on your template design. These are placeholders that will be replaced with actual values when generating videos from the template.

Response Examples

Code Examples

Usage Notes

File Source: The .pictai file must be exported from the Pictory web application. You can download project files from your Pictory dashboard.
File Size Limits: Ensure your template file is within the allowed size limit. Large files with many high-resolution assets may exceed upload limits.
Template Variables: Design your templates with variables (e.g., {{customer_name}}, {{payment_date}}) to make them reusable across different video instances.

How to Export a .pictai File

To create a template, you first need to export a project file from the Pictory web app:
  1. Create or Open a Project in the Pictory web application
  2. Design Your Template with the desired scenes, text, visuals, and audio
  3. Add Variables using double curly braces (e.g., {{variable_name}}) in text fields
  4. Export the Project as a .pictai file from the project menu
  5. Upload via API using this endpoint

Template Variables

Variables are placeholders in your template that can be replaced with actual values when creating videos. Use the following format:

Variable Syntax

Common Use Cases for Variables

  • Personalization: Customer names, account numbers
  • Dynamic Dates: Payment dates, deadlines, event dates
  • Contact Information: Phone numbers, email addresses, support contacts
  • Custom Content: Product names, prices, locations, offers

Example Template Text

Common Use Cases

1. Upload Template from File

Upload a template file and handle the response:

2. Batch Upload Multiple Templates

Upload multiple template files at once:

3. Upload and Extract Template Info

Upload a template and extract key information:

4. Upload with Validation

Validate the file before uploading:

5. Upload with Progress Tracking

Upload large templates with progress indication:

Best Practices

File Management

  1. Organize Templates: Keep template files organized by category or purpose
  2. Version Control: Maintain version history of template files
  3. Naming Convention: Use descriptive names for template files
  4. Backup: Keep backups of all template files
  5. Documentation: Document the purpose and variables of each template

Template Design

  1. Use Meaningful Variables: Choose clear, descriptive variable names
  2. Consistent Naming: Use a consistent naming convention for variables (e.g., snake_case)
  3. Default Values: Provide sensible default values in the template
  4. Test Thoroughly: Test templates with various variable values before uploading
  5. Optimize Assets: Keep file sizes reasonable by optimizing images and videos

Error Handling

  1. Validate Files: Check file format and size before uploading
  2. Handle Failures: Implement retry logic for network failures
  3. Log Uploads: Keep records of uploaded templates
  4. Monitor Limits: Track upload quotas and limits
  5. Verify Results: Confirm template creation by checking the response