# Parameters

## The Event object

The Event object represents the event being tracked for a given Custom User ID. You can enrich events to pass any relevant data, which will be later used to trigger personalized messages.

<table><thead><tr><th width="136">Id</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td><strong>string</strong> - <em>Required</em><br>Event name<br><em>E.g.</em><code>{"name":"ue.added_to_cart"}</code></td></tr><tr><td><code>time</code></td><td><strong>Date</strong> - <em>Optional</em><br>The time date and time an event occurred. It has to respect YYYY-MM-ddTHH:mm:ss format.<br>You can track events that happened in the last 24 hours, and no events in the future.<br>If this parameter is not included in your request, Batch will use the time the event arrives at the server.<br><em>E.g.</em><code>{"time":"2012-08-12T22:30:05"}</code></td></tr><tr><td><code>label</code></td><td><strong>String</strong> - <em>Optional</em><br>The event label (up to 200 characters).<br><em>E.g.</em><code>{"label":"shoes"}</code></td></tr><tr><td><code>attributes</code></td><td><strong>Object</strong> - <em>Optional</em><br>An object containing all attributes you would like to attach to the event (up to 15 attributes).<br><em>E.g.</em><code>{"attributes":{"sub_category":"boots"}}</code></td></tr><tr><td><code>tags</code></td><td><strong>Array</strong> - <em>Optional</em><br>An array containing all tags to attach to the event (up to 10 tags, maximum 64 chars per tag).<br><em>E.g.</em><code>{"tags":["private-sales","summer-discount"]}</code></td></tr></tbody></table>

If limits are not respected, an error will be returned.

## The Attributes object

You can attach up to 15 attributes to an event sent with the Trigger Events API.

#### Naming

Attribute names are strings. They should be made of letters, numbers or underscores (\[a-z0-9\_]) and can't be longer than 30 characters (e.g. "sub\_category").

#### Values

Values can be any of the following type:

* **string**: up to 64 characters, e.g.`{"sub_category": "shoes"}`
* **integer**: up to 64 characters, e.g.`{"level": 23}`
* **boolean**: e.g.`{"is_premium": true}`
* **float**: e.g.`{"level_progress": 45.09}`

**Additional types**

**Date**

We support dates, unfortunately JSON does not, thus we need extra information to know an attribute is actually a date. We do this via wrapping the key name in the `date()` function.

```json
{
  "date(promo_starts)": 1451642400,
  "date(promo_ends)": "2021-01-01T04:00:00.000"
}
```

If you're using `date()` on a string, be sure to use the format **YYYY-MM-ddTHH:mm:ss**. Be aware that we will interpret the date as UTC in both cases.

**URL**

URL type is also supported. You will need to wrap the key name in the `url()` function.

```json
{
  "url(product_image)": "https://batchstore/product/4729/image.png",
  "url(product_deeplink)": "myapp://path/to/content"
}
```

You need to provide a valid URL, in the limit of 2048 characters:

* A scheme is compulsory (`myapp://`, `https://`...)
* `://` is compulsory after the scheme

If the URL provided isn't valid, the API call will fail.
