Why Create a Creative Template?
When you want to create multiple creatives for your network, a creative template is a quick and easy way for you to create a standard format and style for all of your creatives while maintaining a consistent "look and feel"
This creates a new creative template for your network. The body of the request is a JSON object with the below fields. Do not specify an Id
when creating a template. An Id
will be assigned and returned with the response.
WarningAll string keys and values are case sensitive. For example
Name
is accepted butname
is not, and the valueString
is accepted butstring
is not.
API Syntax
When using the Create Creative Template API endpoint, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:
POST https://api.kevel.co/v2/creative-templates
Where:
POST
- the type of API request being made.https://api.kevel.co
- the URL for the request.v2
- the API version.creative-templates
- the API endpoint being called.
Object Fields
The table below lists the various fields you can include in your POST
request when creating a new creative template.
The Fields
of a creative template set which fields a UI user should enter for a creative. Each Field has its own object:
Key | Type |
---|---|
| Required. The name of the field. Must be 255 characters or less. Example: "Caption" |
| Required. The macro name of the field to be used in the |
| Required. The data type of the field. See the table below. Example: "String" |
| If true, the field will be validated as required when the creative is saved. A required field cannot also be |
| A description of the field for the UI. Example: "This is the caption for the ad." |
| If true, sets whether the field is hidden in the UI. Defaults to |
| Required only if "a" (if string) easy way for yo (if array) |
| If true, the field can be queried via the AdQuery feature. |
| The size limit, in bytes, of a file uploaded for this field. Cannot exceed 2 MB (2097152 bytes), and will default to 2 MB if omitted. |
| When provided, inputs into |
| When provided, inputs into |
| Enables phrase or "fuzzy" matching on |
CautionYou cannot provide a
Default
if a Field is notHidden
.If a creative API request sets a value for a
Hidden
field that uses aDefault
, the creative will be saved with that overridden value. Otherwise, the value of the field will be theDefault
.
NoteThere is a maximum of 100 fields per creative template.
Restrictions When Adding Custom Validation
AllowedValues
andRegex
rules can be defined on fields in new Creative Templates and on new fields for existing templates. After a field with validation rules has been saved to a Creative Template the only change that can be made is to add additional allowed values. These restrictions are in place to prevent pre-existing Creatives from entering an invalid state due to the field rules changing.
Field Types
The table below lists the different types of fields that may be used as part of the POST
API call when creating a new creative template.
If your template creative requires uploading multiple images, you will need a file Field for uploading the image and a string Field for the image's path. The sum of all files uploaded to a single Creative cannot exceed 10 MB—for example, 5 file fields each with a 2 MB image. See the example Fields below:
{
"Field": {
"Name": "Image1 Full URL",
"Required": false,
"Variable": "ctImage1",
"Type": "String",
"Hidden": true,
"Default": "{{contentUrl}}/{{ctImage1}}"
}
},
{
"Field": {
"Name": "Image2 Full URL",
"Required": false,
"Variable": "ctImage2",
"Type": "String",
"Hidden": true,
"Default": "{{contentUrl}}/{{ctImage2}}"
}
},
{
"Field": {
"Name": "Image1",
"Required": true,
"Variable": "ctBaseImage1",
"Type": "File"
}
},
{
"Field": {
"Name": "Image2",
"Required": true,
"Variable": "ctBaseImage2",
"Type": "File"
}
}
Contents Object
A creative template can have 0 or more Contents
that determine how the data set in the Fields should be outputted into the creative.
Each Contents field has a Type
that corresponds to the data type ados.js
, which should be used to render the creative, and the Body
of the Content will be written to contents of the creative.
NoteThere is a maximum of 10KB (or 10000 characters) of Contents data per template.
Key | Type |
---|---|
| Required. The data type ados.js should use to render the creative. Ex: "HTML" |
| The data that should be written to the body of the creative. Max 10000 characters. Can use macros. Ex: " Check out my cool caption: {{ctCaption}} " |
Content Types
CautionSince Decision API responses do not render creatives on a page, the value of a
Type
will instead be rendered as thetype
in response, and theBody
asbody
.