Monetate Data API
Schema

Create a New Schema

POST
https://api.monetate.net/api/data/v1/{retailerShortname}/production/schema/

To send data to Monetate, you must first create a new Schema.

Schema types

The API currently accepts the following types of data:

  • Event: Any data that contains a timestamp for the purposes of understanding when the specific events or interactions occurred in a time series.
    • type: event
    • Required fields: identifier, event_time
  • Entity: Any non-time series data
    • type: attribute
    • Required fields: identifier
  • Product: Product catalog data
    • type: product

Fields

A Schema consists of a set of fields defining its structure. You can include up to 40 fields in each Schema.

Field Data Types

The API supports the following field data-types:

  • STRING: Non-empty text without leading or trailing whitespace.
  • NUMBER: An integer or decimal number.
  • DATETIME: A timestamp conforming to the ISO-8601 standard.
  • BOOLEAN: A true or false value.

Field Attributes

The API allows attributes to be set on certain fields:

  • data_type: String attribute. The type of data allowed in this field (see 'Field Data Types').
  • required: Boolean attribute. Defaults to false. Allows certain attributes to be 'required' when submitting records.
  • identifier: Boolean attribute. Field used to identify a customer. Exactly one field may be the identifier.
  • unique_key: Boolean attribute. Unique identifier for the record which can be used to update the record in the future. Only one field may be the unique_key.
  • event_time: Boolean attribute. For events, the time that the event occurred.

Only identifier and unique key are considered 'required' fields when specified. All other fields are optional and are marked as null if absent.

Authentication
Authorization
Body Parameters
body
Example
{"name":"purchase_event","named_identifier":"valid_named_identifier","type":"event","fields":{"purchase_id":{"data_type":"STRING","unique_key":true},"customer_id":{"data_type":"STRING","identifier":true},"purchase_time":{"data_type":"DATETIME","event_time":true},"product_id":{"data_type":"STRING"},"product_category":{"data_type":"STRING"},"product_price":{"data_type":"NUMBER"}}}
Description
Representation of a Schema object. A schema must have a name, and at least one field. Schemata for your account must have unique names. If you are trying to re-create a Schema that already exists, please delete the old one first. Within a Schema, fields must have unique names. Exactly one field must be designated as the `identifier`. This field will be used to link to a Person ID for testing and targeting. Optionally, one field may be designated as a `unique_key`. If a Schema defines a unique key, then only one record can exist in your data for a given value of the unique key. Successive data updates with the same unique key value will replace earlier data updates. If no unique key is defined, then all data updates will be considered new data and will never replace earlier data.
name
*
type
fields
*
named_identifier
Responses
201
Schema created. Content is the definition of the created Schema.
meta
*
data
*
400
Validation error. One or more values being sent was not in the correct format, or a required value was missing.
meta
*
data
*
401
Unauthorized. The request did not include a token, or the token provided was invalid. Please ensure that your token is correct and that the Authorization header is properly formatted.
meta
*
data
*
403
Forbidden. The request included a token that has been revoked. Please contact your account administrator to generate a new token.
meta
*
data
*
500
Unknown error. Please try again or contact your account manager for more information.
meta
*
data
*