Plantillas
Diseños listos para personalizar. Las plantillas no se modifican: para cambiar una, crea un proyecto a partir de ella (POST /projects con template).
| Endpoint | Descripción |
|---|---|
GET /templates | Listar plantillas |
GET /templates/{slug} | Obtener una plantilla |
Listar plantillas
GET
/templatesDevuelve las plantillas publicadas, de la más reciente a la más antigua.
Parámetros de consulta
| Nombre | Tipo | Descripción |
|---|---|---|
q | texto | Busca en el título. |
format | texto | Formato: square, portrait, landscape o story. |
category | texto | Slug de una categoría. |
style | texto | Slug de un estilo. |
page | entero | Página, desde 1. |
page_size | entero | Resultados por página (24 por defecto, máximo 100). |
Ejemplo
curl "https://creavibe.app/api/v1/templates?page_size=2" \
-H "Authorization: Bearer cv_TU_TOKEN"const respuesta = await fetch('https://creavibe.app/api/v1/templates?page_size=2', {
method: 'GET',
headers: {
Authorization: 'Bearer cv_TU_TOKEN',
},
});
const datos = await respuesta.json();import requests
respuesta = requests.get(
"https://creavibe.app/api/v1/templates?page_size=2",
headers={"Authorization": "Bearer cv_TU_TOKEN"},
)
datos = respuesta.json()Respuesta · 200
{
"count": 3,
"next": "https://creavibe.app/api/v1/templates?page_size=2&page=2",
"previous": null,
"results": [
{
"slug": "pop-art",
"title": "Pop Art",
"width": 1080,
"height": 1080,
"page_count": 1,
"format": "square",
"image_url": "https://creavibe.app/media/fichas/plantilla_Yt28o29.jpg"
},
{
"slug": "alarma-en-la-aldea",
"title": "Alarma en la aldea",
"width": 1080,
"height": 1080,
"page_count": 1,
"format": "square",
"image_url": "https://creavibe.app/media/fichas/plantilla_0jRtnBS.jpg"
}
]
}Obtener una plantilla
GET
/templates/{slug}Devuelve una plantilla con su diseño completo (design.pages). Cada página guarda sus objetos de Fabric.js en objects; en el ejemplo aparecen resumidos.
Parámetros de la ruta
| Nombre | Tipo | Descripción |
|---|---|---|
slugobligatorio | texto | Slug de la plantilla. |
Ejemplo
curl "https://creavibe.app/api/v1/templates/demo-sangre" \
-H "Authorization: Bearer cv_TU_TOKEN"const respuesta = await fetch('https://creavibe.app/api/v1/templates/demo-sangre', {
method: 'GET',
headers: {
Authorization: 'Bearer cv_TU_TOKEN',
},
});
const datos = await respuesta.json();import requests
respuesta = requests.get(
"https://creavibe.app/api/v1/templates/demo-sangre",
headers={"Authorization": "Bearer cv_TU_TOKEN"},
)
datos = respuesta.json()Respuesta · 200
{
"slug": "demo-sangre",
"title": "Demo sangre",
"width": 1080,
"height": 1080,
"page_count": 1,
"format": "square",
"image_url": "https://creavibe.app/media/fichas/plantilla.jpg",
"published": true,
"editable": false,
"design": {
"version": 1,
"pages": [
{
"name": "Proyecto1",
"width": 1080,
"height": 1080,
"background": "#FFFFFF",
"x": 80,
"y": 80,
"objects": [
{
"rx": 0,
"ry": 0,
"type": "Rect",
"version": "7.2.0",
"originX": "left",
"originY": "top",
"left": 80,
"top": 80,
"width": 1080,
"height": 1080,
"fill": "#FFFFFF",
"stroke": null,
"strokeWidth": 1,
"strokeDashArray": null,
"strokeLineCap": "butt",
"strokeDashOffset": 0,
"strokeLineJoin": "miter",
"strokeUniform": false,
"strokeMiterLimit": 4,
"scaleX": 1,
"scaleY": 1,
"angle": 0,
"flipX": false,
"flipY": false,
"opacity": 1,
"shadow": null,
"visible": true,
"backgroundColor": "",
"fillRule": "nonzero",
"paintFirst": "fill",
"globalCompositeOperation": "source-over",
"skewX": 0,
"skewY": 0,
"data": {
"type": "artboard",
"id": "ab-1"
}
},
{
"fontSize": 175,
"fontWeight": "bold",
"fontFamily": "Bowlby One",
"fontStyle": "normal",
"lineHeight": 0.75,
"text": "ANIMALES\nCON\nCARNE",
"charSpacing": -70,
"textAlign": "left",
"styles": [],
"pathStartOffset": 0,
"pathSide": "left",
"pathAlign": "baseline",
"underline": false,
"overline": false,
"linethrough": false,
"textBackgroundColor": "",
"direction": "ltr",
"textDecorationThickness": 66.667,
"minWidth": 20,
"splitByGrapheme": false,
"type": "Textbox",
"version": "7.2.0",
"originX": "center",
"originY": "center",
"left": 590.9644,
"top": 347.0568,
"width": 968.1643,
"height": 494.375,
"fill": "#000000",
"stroke": null,
"strokeWidth": 1,
"strokeDashArray": null,
"strokeLineCap": "butt",
"strokeDashOffset": 0,
"strokeLineJoin": "miter",
"strokeUniform": true,
"strokeMiterLimit": 4,
"scaleX": 1,
"scaleY": 1,
"angle": 0,
"flipX": false,
"flipY": false,
"opacity": 1,
"shadow": null,
"visible": true,
"backgroundColor": "",
"fillRule": "nonzero",
"paintFirst": "stroke",
"globalCompositeOperation": "source-over",
"skewX": 0,
"skewY": 0,
"clipPath": {
"rx": 0,
"ry": 0,
"inverted": false,
"absolutePositioned": true,
"type": "Rect",
"version": "7.2.0",
"originX": "left",
"originY": "top",
"left": 80,
"top": 80,
"width": 1080,
"height": 1080,
"fill": "rgb(0,0,0)",
"stroke": null,
"strokeWidth": 1,
"strokeDashArray": null,
"strokeLineCap": "butt",
"strokeDashOffset": 0,
"strokeLineJoin": "miter",
"strokeUniform": false,
"strokeMiterLimit": 4,
"scaleX": 1,
"scaleY": 1,
"angle": 0,
"flipX": false,
"flipY": false,
"opacity": 1,
"shadow": null,
"visible": true,
"backgroundColor": "",
"fillRule": "nonzero",
"paintFirst": "fill",
"globalCompositeOperation": "source-over",
"skewX": 0,
"skewY": 0,
"data": {
"abId": "ab-1"
}
},
"data": {
"type": "text",
"artboardId": "ab-1",
"autoWidth": false
}
}
]
}
]
}
}