Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ description: "This article outlines details about the Schedule API-triggered Can

> Use this endpoint to schedule Canvas messages via API-triggered delivery, allowing you to decide what action should trigger the message to be sent.

You can pass in `canvas_entry_properties` that will be templated into the messages sent by the first steps of the Canvas.
You can pass in `context` that will be templated into the messages sent by the first steps of the Canvas.

{% multi_lang_include alerts/important_alerts.md alert='context variable' %}

Note that to send messages with this endpoint, you must have a [Canvas ID]({{site.baseurl}}/api/identifier_types/#canvas-api-identifier), created when you build a Canvas.

Expand Down Expand Up @@ -49,7 +51,7 @@ Authorization: Bearer YOUR-REST-API-KEY
// If 'recipients' and 'audience' are not provided and broadcast is not set to 'false',
// the message will send to entire segment targeted by the Canvas
"broadcast": (optional, boolean) see broadcast -- defaults to false on 8/31/17, must be set to true if "recipients" object is omitted,
"canvas_entry_properties": (optional, object) personalization key-value pairs for the first step for all users in this send; see trigger properties,
"context": (optional, object) personalization key-value pairs for the first step for all users in this send; see trigger properties,
"schedule": {
"time": (required, datetime as ISO 8601 string) time to send the message,
"in_local_time": (optional, bool),
Expand All @@ -66,7 +68,7 @@ Authorization: Bearer YOUR-REST-API-KEY
| `recipients` | Optional | Array of recipients objects | See [recipients object]({{site.baseurl}}/api/objects_filters/recipient_object/). |
| `audience` | Optional | Connected audience object | See [connected audience]({{site.baseurl}}/api/objects_filters/connected_audience/). |
|`broadcast`| Optional | Boolean | You must set `broadcast` to true when sending a message to an entire segment that a campaign or Canvas targets. This parameter defaults to false (as of August 31, 2017). <br><br> If `broadcast` is set to true, a `recipients` list cannot be included. However, use caution when setting `broadcast: true`, as unintentionally setting this flag may cause you to send your message to a larger than expected audience. |
| `canvas_entry_properties` | Optional | Object | Personalization key-value pairs for all users in this send. See [Canvas entry properties object]({{site.baseurl}}/api/objects_filters/canvas_entry_properties_object). |
| `context` | Optional | Object | Personalization key-value pairs for all users in this send. See [Canvas context object]({{site.baseurl}}/api/objects_filters/context_object). |
| `schedule` | Required | Schedule object | See [schedule object]({{site.baseurl}}/api/objects_filters/schedule_object/). |
{: .reset-td-br-1 .reset-td-br-2 .reset-td-br-3 .reset-td-br-4 role="presentation" }

Expand All @@ -81,7 +83,7 @@ curl --location --request POST 'https://rest.iad-01.braze.com/canvas/trigger/sch
{
"user_alias": "example_alias",
"external_user_id": "external_user_identifier",
"canvas_entry_properties": {}
"context": {}
}
],
"audience": {
Expand Down Expand Up @@ -132,7 +134,7 @@ curl --location --request POST 'https://rest.iad-01.braze.com/canvas/trigger/sch
]
},
"broadcast": false,
"canvas_entry_properties": {},
"context": {},
"schedule": {
"time": "",
"in_local_time": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ Authorization: Bearer YOUR-REST-API-KEY
```json
{
"canvas_id": (required, string) see Canvas identifier,
"canvas_entry_properties": (optional, object) personalization key-value pairs that apply to all users in this request,
"context": (optional, object) personalization key-value pairs that apply to all users in this request,
"broadcast": (optional, boolean) see Broadcast -- defaults to false on 8/31/17, must be set to true if `recipients` is omitted,
"audience": (optional, connected audience object) see connected audience,
// Including 'audience' will only send to users in the audience
"recipients": (optional, array; if not provided and broadcast is not set to 'false', message will send to the entire segment targeted by the Canvas)
"recipients": (optional, array; if not provided and broadcast is not set to 'false', message sends to the entire segment targeted by the Canvas)
[{
// Either "external_user_id" or "user_alias" or "email" is required. Requests must specify only one.
"user_alias": (optional, user alias object) user alias of user to receive message,
"external_user_id": (optional, string) external identifier of user to receive message,
"email": (optional, string) email address of user to receive message,
"prioritization": (optional, array) prioritization array; required when using email,
"canvas_entry_properties": (optional, object) personalization key-value pairs that apply to this user (these key-value pairs override any keys that conflict with the parent `canvas_entry_properties`)
"context": (optional, object) personalization key-value pairs that apply to this user (these key-value pairs override any keys that conflict with the parent `context`)
"send_to_existing_only": (optional, boolean) defaults to true, can't be used with user aliases
"attributes": (optional, object) fields in the attributes object create or update an attribute of that name with the given value on the specified user profile before the message is sent and existing values are overwritten
}],
Expand All @@ -64,10 +64,10 @@ Authorization: Bearer YOUR-REST-API-KEY
| Parameter | Required | Data Type | Description |
| --------- | ---------| --------- | ----------- |
|`canvas_id`| Required | String | See [Canvas identifier]({{site.baseurl}}/api/identifier_types/). |
|`canvas_entry_properties`| Optional | Object | This includes [Canvas entry properties]({{site.baseurl}}/api/objects_filters/canvas_entry_properties_object/). Personalization key-value pairs apply to all users in this request. The Canvas entry properties object has a maximum size limit of 50 KB. <br><br>**Note:** If you're participating in the [Canvas Context early access]({{site.baseurl}}/user_guide/engagement_tools/canvas/canvas_components/context/), this parameter is `context` and includes Canvas entry properties. |
|`context`| Optional | Object | This includes [Canvas entry properties]({{site.baseurl}}/api/objects_filters/context_object/). Personalization key-value pairs apply to all users in this request. The context object has a maximum size limit of 50 KB. |
|`broadcast`| Optional | Boolean | You must set `broadcast` to true when sending a message to an entire segment that a campaign or Canvas targets. This parameter defaults to false (as of August 31, 2017). <br><br> If `broadcast` is set to true, a `recipients` list cannot be included. However, use caution when setting `broadcast: true`, as unintentionally setting this flag may cause you to send your message to a larger-than-expected audience. |
|`audience`| Optional| Connected audience object | See [Connected audience]({{site.baseurl}}/api/objects_filters/connected_audience/). |
|`recipients`| Optional | Array | See [Recipients object]({{site.baseurl}}/api/objects_filters/recipient_object/). <br><br>If not provided and `broadcast` is set to `true`, the message is sent to the entire segment that the Canvas targets.<br><br> The `recipients` array may contain up to 50 objects, with each object containing a single `external_user_id` string and a `canvas_entry_properties` object. This call requires an `external_user_id`, `user_alias`, or `email`. Requests must specify only one. <br><br>If `email` is the identifier, you must include [`prioritization`]({{site.baseurl}}/api/endpoints/user_data/post_user_identify#identifying-users-by-email) in the recipients object. |
|`recipients`| Optional | Array | See [Recipients object]({{site.baseurl}}/api/objects_filters/recipient_object/). <br><br>If not provided and `broadcast` is set to `true`, the message is sent to the entire segment that the Canvas targets.<br><br> The `recipients` array may contain up to 50 objects, with each object containing a single `external_user_id` string and a `context` object. This call requires an `external_user_id`, `user_alias`, or `email`. Requests must specify only one. <br><br>If `email` is the identifier, you must include [`prioritization`]({{site.baseurl}}/api/endpoints/user_data/post_user_identify#identifying-users-by-email) in the recipients object. |
{: .reset-td-br-1 .reset-td-br-2 .reset-td-br-3 .reset-td-br-4 role="presentation" }

{% alert important %}
Expand All @@ -87,7 +87,7 @@ curl --location --request POST 'https://rest.iad-01.braze.com/canvas/trigger/sen
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
"canvas_id": "canvas_identifier",
"canvas_entry_properties": {"product_name" : "shoes", "product_price" : 79.99},
"context": {"product_name" : "shoes", "product_price" : 79.99},
"broadcast": false,
"audience": {
"AND": [
Expand Down
2 changes: 1 addition & 1 deletion _docs/_api/objects_filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ description: "This landing page lists the Braze API objects and filters used in

## Objects and filters

- [Canvas entry properties object]({{site.baseurl}}/api/objects_filters/canvas_entry_properties_object)
- [Canvas context object]({{site.baseurl}}/api/objects_filters/context_object)
- [Connected audience filter & object]({{site.baseurl}}/api/objects_filters/connected_audience/)
- [Event object]({{site.baseurl}}/api/objects_filters/event_object/)
- [Purchase object]({{site.baseurl}}/api/objects_filters/purchase_object/)
Expand Down
30 changes: 0 additions & 30 deletions _docs/_api/objects_filters/canvas_entry_properties_object.md

This file was deleted.

31 changes: 31 additions & 0 deletions _docs/_api/objects_filters/context_object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
nav_title: "Canvas context object"
article_title: API Canvas Context Object
page_order: 2
page_type: reference
alias: /api/objects_filters/canvas_entry_properties_object/
tool:
- Canvas
description: "This article explains the Braze Canvas context object."

---

# Canvas context object

> When using one of the endpoints for triggering or scheduling a Canvas through the API, you may provide a map of keys and values to customize messages sent by the first steps of your Canvas, in the `context` namespace.

{% alert note %}
The context object has a maximum size limit of 50 KB.
{% endalert %}

## Object body

This object body contains an example request.

```json
"context": {"product_name" : "shoes", "product_price" : 79.99}
```

{% raw %}
For example, a request with `"context": {"product_name" : "shoes", "product_price" : 79.99}` could add the word "shoes" to a message by adding ```{{context.${product_name}}}``` to the request.
{% endraw %}
2 changes: 1 addition & 1 deletion _docs/_api/objects_filters/recipient_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The recipients object allows you to combine the [user alias object]({{site.baseu
"email": (optional, string) email address of user to receive message,
"prioritization": (optional, array) see Prioritization; required when using email,
"trigger_properties": (optional, object) personalization key-value pairs for this user when sending a campaign or message; see Trigger Properties,
"canvas_entry_properties": (optional, object) personalization key-value pairs for this user when triggering a Canvas; see Canvas Entry Properties,
"context": (optional, object) personalization key-value pairs for this user when triggering a Canvas; see Canvas context object
"send_to_existing_only": (optional, boolean) defaults to true; cannot be used with user aliases,
"attributes": (optional, object) fields in the attributes object create or update an attribute of that name with the given value on the specified user profile before the message is sent and existing values are overwritten
}]
Expand Down
4 changes: 2 additions & 2 deletions _docs/_hidden/archived_layouts/api_glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"canvas_id": (required, string) see Canvas Identifier,
"canvas_entry_properties": (optional, object) personalization key-value pairs that will apply to all users in this request,
"context": (optional, object) personalization key-value pairs that will apply to all users in this request,
"broadcast": (optional, boolean) see Broadcast -- defaults to false on 8/31/17, must be set to true if "recipients" is omitted,
"audience": (optional, Connected Audience Object) see Connected Audience,
// Including 'audience' will only send to users in the audience
Expand All @@ -195,7 +195,7 @@ Authorization: Bearer YOUR-REST-API-KEY
// Either "external_user_id" or "user_alias" is required. Requests must specify only one.
"user_alias": (optional, User Alias Object) User Alias of user to receive message,
"external_user_id": (optional, string) External ID of user to receive message,
"canvas_entry_properties": (optional, object) personalization key-value pairs that will apply to this user (these key-value pairs will override any keys that conflict with the parent canvas_entry_properties)
"context": (optional, object) personalization key-value pairs that will apply to this user (these key-value pairs will override any keys that conflict with the parent context)
},
...
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ When setting up your webhook, use the following settings and provide your Braze
"recipients": [
{
"external_user_id": "external_user_identifier",
"canvas_entry_properties":{
"context":{
"string_property": "Your example string",
"example_integer_property": 1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ Now, your customers can be notified when an item is back in stock.

### Using Liquid

To template in details about the catalog item that's back in stock, you can use the `canvas_entry_properties` Liquid tag to access the `item_id`.
To template in details about the catalog item that's back in stock, you can use the `context` Liquid tag to access the `item_id`.

Using {%raw%}``{{canvas_entry_properties.${catalog_update}.item_id}}``{%endraw%} will return the ID of the item that came back in stock. {%raw%}``{{canvas_entry_properties.${catalog_update}.previous_value}}``{%endraw%} will return the inventory value of the item prior to the update, and {%raw%}``{{canvas_entry_properties.${catalog_update}.new_value}}``{%endraw%} will return the new inventory value after the update.
Using {%raw%}``{{context.${catalog_update}.item_id}}``{%endraw%} will return the ID of the item that came back in stock. {%raw%}``{{context.${catalog_update}.previous_value}}``{%endraw%} will return the inventory value of the item prior to the update, and {%raw%}``{{context.${catalog_update}.new_value}}``{%endraw%} will return the new inventory value after the update.

Use this Liquid tag {%raw%}``{% catalog_items <name_of_your_catalog> {{canvas_entry_properties.${catalog_update}.item_id}} %}``{%endraw%} at the top of your message, then use {%raw%}``{{ items[0].<field_name> }}``{%endraw%} to access data about that item throughout the message.
Use this Liquid tag {%raw%}``{% catalog_items <name_of_your_catalog> {{context.${catalog_update}.item_id}} %}``{%endraw%} at the top of your message, then use {%raw%}``{{ items[0].<field_name> }}``{%endraw%} to access data about that item throughout the message.

{% multi_lang_include alerts/important_alerts.md alert='context variable' %}

## Considerations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ Now, your customers will be notified when an item's price drops.

### Using Liquid

To template in details about the catalog item that has dropped in price, you can use the `canvas_entry_properties` Liquid tag to access the `item_id`.
To template in details about the catalog item that has dropped in price, you can use the `context` Liquid tag to access the `item_id`.

Using {%raw%}``{{canvas_entry_properties.${catalog_update}.item_id}}``{%endraw%} will return the ID of the item that dropped in price. {%raw%}``{{canvas_entry_properties.${catalog_update}.previous_value}}``{%endraw%} will return the price value of the item before the update, and {%raw%}``{{canvas_entry_properties.${catalog_update}.new_value}}``{%endraw%} will return the new price value after the update.
Using {%raw%}``{{context.${catalog_update}.item_id}}``{%endraw%} will return the ID of the item that dropped in price. {%raw%}``{{context.${catalog_update}.previous_value}}``{%endraw%} will return the price value of the item before the update, and {%raw%}``{{context.${catalog_update}.new_value}}``{%endraw%} will return the new price value after the update.

Use this Liquid tag {%raw%}``{% catalog_items <name_of_your_catalog> {{canvas_entry_properties.${catalog_update}.item_id}} %}}``{%endraw%} at the top of your message, then use {%raw%}`{{items[0].<field_name>}}`{%endraw%} to access data about that item throughout the message.
Use this Liquid tag {%raw%}``{% catalog_items <name_of_your_catalog> {{context.${catalog_update}.item_id}} %}}``{%endraw%} at the top of your message, then use {%raw%}`{{items[0].<field_name>}}`{%endraw%} to access data about that item throughout the message.

{% multi_lang_include alerts/important_alerts.md alert='context variable' %}

## Considerations

Expand Down
Loading