Monetate Data API
Schema
Create a New Schema
POST
https://api.monetate.net/api/data/v1/{retailerShortname}/production/schema/
Authentication
Authorization
apiKey
Body Parameters
body
Schema
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
string
*
type
string<agil_one | attribute | behavioral_trigger | custom_list | customer_data_privacy | email_metadata | event | inventory | product | product_recommendation | purchase>
fields
map<string, Field>
*
named_identifier
string
Responses
201
Schema created. Content is the definition of the created Schema.
SchemaResponse
meta
ResponseMeta
*
data
Schema
*
400
Validation error.
One or more values being sent was not in the correct format, or a required value was missing.
Response
meta
ResponseMeta
*
data
ResponseAnyData
*
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.
Response
meta
ResponseMeta
*
data
ResponseAnyData
*
403
Forbidden.
The request included a token that has been revoked. Please contact your account administrator to generate a new token.
Response
meta
ResponseMeta
*
data
ResponseAnyData
*
500
Unknown error.
Please try again or contact your account manager for more information.
Response
meta
ResponseMeta
*
data
ResponseAnyData
*