Browse the docs Open

Templates

The menu you render from.

Templates are reusable designs with addressable layers. List and read them, or manage them programmatically. All template endpoints are scoped to your company.

GET /v1/templates

List templates

Returns a cursor-paginated list of your templates.

Auth: Bearer token Ability: api_requests Gate: logApiRequest Free

Parameters

Name In Type Required Description
cursor query string No Cursor token from a previous response's meta.next_cursor.

Example request

curl

curl https://snapsbrew.com/api/v1/templates \
  -H 'Authorization: Bearer <your-token>'

Example responses

200 A page of templates.
{
    "data": [
        {
            "uuid": "141e8454-8aa1-420a-bd0b-18a85ba949a2",
            "title": "Template 1",
            "width": 1200,
            "height": 630,
            "layers": [
                {
                    "layer": "review_title",
                    "type": "text",
                    "available_modifications": {
                        "text": "The worst Time-Travel movie ever made"
                    }
                }
            ],
            "created_at": "2026-05-01T12:00:00Z"
        }
    ],
    "meta": {
        "previous_cursor": null,
        "next_cursor": "eyJpZCI6MTB9"
    }
}

GET /v1/templates/{templateUuid}

Get a template

Returns a single template and its parsed layers.

Auth: Bearer token Ability: api_requests Gate: logApiRequest Free

Parameters

Name In Type Required Description
templateUuid path string Yes UUID of the template.

Example request

curl

curl https://snapsbrew.com/api/v1/templates/<uuid> \
  -H 'Authorization: Bearer <your-token>'

Example responses

200 The template.
{
    "uuid": "141e8454-8aa1-420a-bd0b-18a85ba949a2",
    "title": "Template 1",
    "width": 1200,
    "height": 630,
    "layers": [
        {
            "layer": "review_poster",
            "type": "image",
            "available_modifications": {
                "image_url": "https://snapsbrew.com/crazy-doc-brown-jailed"
            }
        },
        {
            "layer": "review_title",
            "type": "text",
            "available_modifications": {
                "text": "The worst Time-Travel movie ever made"
            }
        }
    ],
    "created_at": "2026-05-01T12:00:00Z"
}
404 Template not found in your company.
{
    "message": "Not found."
}

POST /v1/templates

Create a template

Creates a template and generates its preview image. Requires the create-template policy.

Auth: Bearer token Ability: api_requests Gate: policy:create,Template Free

Request body

Content-Type: application/json

Field Type Required Validation Description
title string No no server validation Template name.
width integer No no server validation Canvas width in pixels.
height integer No no server validation Canvas height in pixels.
layers array No no server validation Layer definitions; stored JSON-encoded.

This endpoint does not validate input. Send well-formed values — bad data is persisted as-is.

Example request

curl

curl -X POST https://snapsbrew.com/api/v1/templates \
  -H 'Authorization: Bearer <your-token>' \
  -H 'Content-Type: application/json' \
  -d '{"title":"Launch card","width":1200,"height":630,"layers":[]}'

Example responses

200 Template created.
{
    "data": {
        "uuid": "...",
        "title": "New template"
    },
    "message": "Template created successfully"
}

PATCH /v1/templates/{templateId}

Update a template

Updates a template and regenerates its preview image. The path segment is the numeric template ID, not the UUID.

Auth: Bearer token Ability: api_requests Free

Parameters

Name In Type Required Description
templateId path integer Yes Numeric template ID, scoped to your company.

Request body

Content-Type: application/json

Field Type Required Validation Description
title string No no server validation Template name.
width integer No no server validation Canvas width in pixels.
height integer No no server validation Canvas height in pixels.
layers array No no server validation Layer definitions; stored JSON-encoded.

Example request

curl

curl -X PATCH https://snapsbrew.com/api/v1/templates/42 \
  -H 'Authorization: Bearer <your-token>' \
  -H 'Content-Type: application/json' \
  -d '{"title":"Updated title"}'

Example responses

200 Template updated.
{
    "message": "template updated sucessfully"
}
404 Template not found in your company.
{
    "message": "Not found."
}

DELETE /v1/templates/{templateId}

Delete a template

Deletes a template. The path segment is the numeric template ID. Requires the delete-template policy.

Auth: Bearer token Ability: api_requests Gate: policy:delete,Template Free

Parameters

Name In Type Required Description
templateId path integer Yes Numeric template ID, scoped to your company.

Example request

curl

curl -X DELETE https://snapsbrew.com/api/v1/templates/42 \
  -H 'Authorization: Bearer <your-token>'

Example responses

200 Template deleted.
{
    "message": "template deleted sucessfully"
}
404 Template not found in your company.
{
    "message": "Not found."
}