curl "https://dev-backend-ai.truefans.in/api/external/v1/templates/{template_id}/schema/" \
-H "Authorization: Bearer $TRUEFAN_API_KEY"
{
"template_id": "7a4facd6-136f-4d8a-8db6-0eb3b3e7086f",
"name": "Customer shoutout",
"variables": [
{ "name": "customer_name", "example_value": "Anmol" },
{ "name": "score", "example_value": "95" }
],
"bulk_generate": {
"method": "POST",
"path": "/api/external/v1/templates/7a4facd6-136f-4d8a-8db6-0eb3b3e7086f/bulk-generate/",
"body": {
"rows": [{ "customer_name": "Anmol", "score": "95" }],
"batch_name": "string (optional)"
}
}
}
{
"template_id": "b81c04ff-2a7e-4c19-9f0d-5c2a1e3d7b44",
"name": "Diwali greeting card",
"type": "IMAGE_TEMPLATE",
"variables": [
{ "name": "customer_name", "example_value": "Anmol" },
{ "name": "city", "example_value": "Mumbai" }
],
"credits_per_row": "0.00362",
"bulk_generate": {
"method": "POST",
"path": "/api/external/v1/image-templates/b81c04ff-2a7e-4c19-9f0d-5c2a1e3d7b44/bulk-generate/",
"body": {
"rows": [{ "customer_name": "Anmol", "city": "Mumbai" }],
"batch_name": "string (optional)"
}
}
}
{
"error": "type must be one of TEMPLATE or IMAGE_TEMPLATE",
"allowed": ["IMAGE_TEMPLATE", "TEMPLATE"]
}
{ "error": "API key required" }
{ "error": "Template not found" }
{ "error": "Image template not found" }
Templates
Get template schema
Get the exact variables a template needs, computed live
GET
/
api
/
external
/
v1
/
templates
/
{template_id}
/
schema
/
curl "https://dev-backend-ai.truefans.in/api/external/v1/templates/{template_id}/schema/" \
-H "Authorization: Bearer $TRUEFAN_API_KEY"
{
"template_id": "7a4facd6-136f-4d8a-8db6-0eb3b3e7086f",
"name": "Customer shoutout",
"variables": [
{ "name": "customer_name", "example_value": "Anmol" },
{ "name": "score", "example_value": "95" }
],
"bulk_generate": {
"method": "POST",
"path": "/api/external/v1/templates/7a4facd6-136f-4d8a-8db6-0eb3b3e7086f/bulk-generate/",
"body": {
"rows": [{ "customer_name": "Anmol", "score": "95" }],
"batch_name": "string (optional)"
}
}
}
{
"template_id": "b81c04ff-2a7e-4c19-9f0d-5c2a1e3d7b44",
"name": "Diwali greeting card",
"type": "IMAGE_TEMPLATE",
"variables": [
{ "name": "customer_name", "example_value": "Anmol" },
{ "name": "city", "example_value": "Mumbai" }
],
"credits_per_row": "0.00362",
"bulk_generate": {
"method": "POST",
"path": "/api/external/v1/image-templates/b81c04ff-2a7e-4c19-9f0d-5c2a1e3d7b44/bulk-generate/",
"body": {
"rows": [{ "customer_name": "Anmol", "city": "Mumbai" }],
"batch_name": "string (optional)"
}
}
}
{
"error": "type must be one of TEMPLATE or IMAGE_TEMPLATE",
"allowed": ["IMAGE_TEMPLATE", "TEMPLATE"]
}
{ "error": "API key required" }
{ "error": "Template not found" }
{ "error": "Image template not found" }
Every template has a different set of variables, so there’s no fixed request shape to look up statically — this endpoint computes it live from the template itself, every time it’s called, so it can never drift from what the template will actually do at generate time.
Serves both kinds of template: video variables come from the template’s scenes, image variables from its layers. Without
type you get video, exactly as before; pass type=IMAGE_TEMPLATE for an image template.
Call this before building a Generate videos or Generate images request.
string
required
string
default:"TEMPLATE"
TEMPLATE or IMAGE_TEMPLATE — must match the kind of template template_id actually is, or the lookup returns 404. Same param as List templates.string
required
Bearer {api_key}curl "https://dev-backend-ai.truefans.in/api/external/v1/templates/{template_id}/schema/" \
-H "Authorization: Bearer $TRUEFAN_API_KEY"
{
"template_id": "7a4facd6-136f-4d8a-8db6-0eb3b3e7086f",
"name": "Customer shoutout",
"variables": [
{ "name": "customer_name", "example_value": "Anmol" },
{ "name": "score", "example_value": "95" }
],
"bulk_generate": {
"method": "POST",
"path": "/api/external/v1/templates/7a4facd6-136f-4d8a-8db6-0eb3b3e7086f/bulk-generate/",
"body": {
"rows": [{ "customer_name": "Anmol", "score": "95" }],
"batch_name": "string (optional)"
}
}
}
{
"template_id": "b81c04ff-2a7e-4c19-9f0d-5c2a1e3d7b44",
"name": "Diwali greeting card",
"type": "IMAGE_TEMPLATE",
"variables": [
{ "name": "customer_name", "example_value": "Anmol" },
{ "name": "city", "example_value": "Mumbai" }
],
"credits_per_row": "0.00362",
"bulk_generate": {
"method": "POST",
"path": "/api/external/v1/image-templates/b81c04ff-2a7e-4c19-9f0d-5c2a1e3d7b44/bulk-generate/",
"body": {
"rows": [{ "customer_name": "Anmol", "city": "Mumbai" }],
"batch_name": "string (optional)"
}
}
}
{
"error": "type must be one of TEMPLATE or IMAGE_TEMPLATE",
"allowed": ["IMAGE_TEMPLATE", "TEMPLATE"]
}
{ "error": "API key required" }
{ "error": "Template not found" }
{ "error": "Image template not found" }
Response fields
array
Every variable this template uses, each with
name and an example_value pulled from the template itself.string
Echoes back the kind of template this is —
TEMPLATE or IMAGE_TEMPLATE.string
Image templates only — what one row costs:
0.00181 × variables.length. Multiply by your row count for the batch total. Absent for video templates, which carry a fixed estimated_credits on the template itself instead.object
A ready-to-use example, including one example row and the correct path for this template’s kind —
/templates/{id}/bulk-generate/ for video, /image-templates/{id}/bulk-generate/ for images. Use a single-item rows list to generate just one.A template with no variables at all returns an empty
variables array, and bulk_generate.body reflects that (a single empty row) — you can still generate from it, every result just comes out identical.credits_per_row is priced off the image template as it stands right now, whereas a batch is priced off the snapshot taken when it is submitted — editing the template in between changes the charge. Treat it as an estimate and estimated_credits in the Generate images response as the real figure.