Publish the tracking plan
Replaces the organization’s known events with the ones your code declares, so the dashboard can offer them. Sent by @stetcms/vite and stet sync.
PUT
/events/schemaRequest body
requiredapplication/jsoneventsobject[]requiredShow propertiesHide properties
Array of
objectnamestringrequiredmin length 1
propsstring[]requiredResponses
200OK
syncedintegerrequiredmin -9007199254740991 · max 9007199254740991
401401
One of:
object
definedanyrequiredcodeanyrequiredstatusanyrequiredmessagestringrequireddefault: "Authentication required. Pass an organization API key in the `x-api-key` header."
dataanyobject
definedanyrequiredcodestringrequiredstatusnumberrequiredmessagestringrequireddataany429429
One of:
object
definedanyrequiredcodeanyrequiredstatusanyrequiredmessagestringrequireddefault: "Too many requests. Try again shortly."
dataanyobject
definedanyrequiredcodestringrequiredstatusnumberrequiredmessagestringrequireddataanyRequest
curl -X PUT "https://stetcms.com/api/v1/events/schema" \
-H "Content-Type: application/json" \
-d '{
"events": [
{
"name": "string",
"props": [
"string"
]
}
]
}'const response = await fetch("https://stetcms.com/api/v1/events/schema", {
method: "PUT",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"events": [
{
"name": "string",
"props": [
"string"
]
}
]
})
});Response
{
"synced": 0
}{
"defined": true,
"code": "UNAUTHORIZED",
"status": 401,
"message": "Authentication required. Pass an organization API key in the `x-api-key` header.",
"data": "string"
}{
"defined": true,
"code": "RATE_LIMITED",
"status": 429,
"message": "Too many requests. Try again shortly.",
"data": "string"
}