Generating objects

Record generation is the process that changes your fixed content templates into personalized, dynamic content. When you use the API or JinJava tags, it fills in all dynamic parts, gets data from other sources, and uses Synerise’s objects to create content that fits the situation.

While generating, dynamic fields can use other basic fields (like text, numbers, true/false, or choices) from the same record, plus extra information you give in the request. If the generation is for a certain user profile, Brickworks will automatically save this as an action done by that user.

Important: When an object is generated, profile data and external source responses are cached and used in subsequent requests.

Events generated

Brickworks automatically generate events whenever records are generated in the context of a customer profile. This creates a comprehensive audit trail and feeds valuable data back into Synerise platform for analytics, personalization optimization, and customer journey tracking. The following events are generated:

Distribution channels

You can distribute objects with record results in the following channels:

  • Website (inject content into website source, web push notifications)
  • Mobile (SMS, push notifications, in-app messages, mobile applications)
  • Display advertising (digital signage)
  • Email marketing

Context

You can pass additional context parameters when generating records through API and Jinjava tags. This context-driven approach enables your records to adapt dynamically based on the requesting application, user session, or any external factors you define.

When you make a generation request, Brickworks processes your record using the provided context to:

This means the same record can render completely differently depending on the context you provide.

Context types

  • global context - A JSON object containing key-value parameters that can be referenced by any dynamic field in your record. You can use it to:

    • pass product identifiers for catalog lookups
    • provide user session data for personalization from external systems
    • supply external system identifiers

    Defining context:

    • while previewing records
    • while generating an object with record result:

       


      { "context": { "itemId": "c8a42eb1-2582-403e-8497-976f28b479ee", "season": "winter" "language": "en-US"
      } }

  • field-specific context - key corresponds to a field’s API name, and the value contains field-type-specific parameters that are automatically passed to that field during generation. You can use it to:

    • override Synerise object configuration per request
    • provide field-specific external data parameters
    • control the processing behavior for specific fields
    {
      "fieldContext": {
        "oneToManyRelation": {
          "page": 2,
          "limit": 5      
        }
      }
    }
    {
      "fieldContext": {      
        "similarProducts": {
           "itemId": "c8a42eb1-2582-403e-8497-976f28b479ee",    
           "additionalFilter": "brand == TEST"
        },                 
      }
    }

    in which similarProducts is the value of the API name field parameter.

Methods of displaying records

API

Authentication:
When generating content from a record, you can authenticate as a:

  • workspace or Synerise user: in this case, you need to declare a profile for context.
  • profile: in this case, the profile is the context.

Example:
In the following example, content is generated for the following record:

Example record with a Jinjava code field
Example record with a Jinjava code field

To generate content, make the following request:

curl --location 'https://api.synerise.com/brickworks/v1/schemas/docsSchema/records/docsRecord/generate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciINVALIDDUm_1Vivk' \
--data '{
    "context": {
        "dayOfWeek": "Monday"
    }
}'

where:

  • docsSchema is the API name of the schema.
  • docsRecord is the slug of the record.
  • Bearer ... is a profile JWT.
    This identifies the profile whose data is used for the {% customer firstname %} insert.
    It would also provide data for other elements with a profile context (for example, a recommendation), if the record included them.
  • context.dayOfWeek provides the value for the {{ context.dayOfWeek }} insert in the record.

The response is:

{
    "__slug": "docsRecord",
    "__recordVersion": 1,
    "__publishedAt": "2025-12-11T16:58:55.101836Z",
    "__updatedAt": "2025-12-11T16:58:55.092951Z",
    "__createdAt": "2025-12-05T12:49:04.870298Z",
    "exampleJinjava": "Hello Tom!\nIt's Monday.",
    "__schemaId": "c8e842bc-1580-4272-a98d-f3dc79542bb1",
    "__id": "e7635a46-d460-43b5-a878-6a2f9dd16295",
    "__schemaVersion": 1
}

where exampleJinjava is the API name of the field in the record, and the value is the processed content.

The parameters which start with __ are the metadata of the record. Their descriptions are available in the API reference.

Mobile SDK

Integrate Brickworks content into your mobile applications using the Synerise mobile SDKs.

  • Android
  • iOS

Jinjava tags

Use Brickworks content in templates across the Synerise platform with dedicated JinJava tags.

JinJava tags work consistently across all Synerise modules that support JinJava rendering, creating a unified content experience throughout your platform:

  • Communication channels – Email campaigns, SMS messaging, mobile push notifications, and web push notifications with dynamic, personalized content
  • Automation workflows – Sophisticated automation sequences with content that adapts based on customer actions and behavioral triggers
  • Screen views and Documents – Interactive displays, personalized mobile applications content
  • In-App Messaging– Contextual experiences that respond to customer behavior in real-time

Fetch records

  • The following tag fetches a raw record as defined in the database:
    {% brickworks schemaId=SCHEMA_ID/APP_ID recordId=OBJECT_ID/SLUG %}
  • The following tag fetches a raw record as defined in the database, but saves the result to a variable for reuse in your template:
    {% brickworksvar schemaId=SCHEMA_ID/APP_ID recordId=OBJECT_ID/SLUG %}
      {{ brickworks_result }}
    {% endbrickworksvar %}

Generate records

The brickworksgenerate tag generates a an object from a record with all references resolved and Jinja templates rendered:

{% set myFieldContext = {"oneToManyRelation": {"page":2, "limit": 50}} %}
{% set myContext={
    "example1":"value1",
    "example2":"value2"
    } 
%}

{% brickworksgenerate schemaId=SCHEMA_ID/APP_ID recordId=RECORD_ID/SLUG context=myContext fieldContext=myFieldContext %}

where:

  • The values for the context and fieldContext arguments must be variables created with set (as shown above).
  • myFieldContext provides paging data for a relation field named oneToManyRelation. You can skip this argument if you don’t need it.
  • myContext provides values for two inserts used in the record (regardless of field names): {{ context.example1 }} and {{ context.example2 }}. You can skip this argument if you don’t need it.

Alternatively, you can use brickworksgeneratevar to create a {{ brickworks_result }} variable for reuse in a template:

{% brickworksgeneratevar schemaId=SCHEMA_ID/APP_ID recordId=RECORD_ID/SLUG context=myContext fieldContext=myFieldContext %}
  {{ brickworks_result }}            {# prints out the entire record #}
  {{ brickworks_result.someString }} {# prints out the value of the someString field #}
{% endbrickworksgeneratevar %}
😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker