Authentication
Session token (Authorization: Bearer <token>) with the parsers:write permission. Tenant roles with it: company_admin, company_tech, operational_supervisor, corporate_client.
Create a model or a version
model_code: version 1 for a new model, otherwise the highest version of the model plus one. Versions never change once created; to change the fields of a model you create its next version, here or with Update a parser.
The new version becomes the active version of its model when you send activate: true, or when the model has no active version yet. It then replaces the version that was active. Otherwise it is created inactive and you can activate it later.
Body
Vertical code, 2 to 50 characters, lowercase letters and
_ only. The vertical must be enabled for your organisation.Code of the model, 1 to 4 lowercase letters or digits. A code belongs to one vertical of your tenant: it cannot be used in another vertical.
2 to 50 field definitions. It must include the integrity core: fields named
event_id and timestamp, enabled, required and sent by SMS.true makes this version the active version of the model. false creates it inactive, and skips the event type check below.Field definition
Stable identifier of the field, 1 to 64 characters, unique in the schema. Versions are compared field by field using
id.Field name: a lowercase letter, then up to 39 lowercase letters, digits or
_. Unique in the schema.Short code of the field in compact frames: a lowercase letter, then up to 3 lowercase letters or digits. Unique in the schema.
string, number, boolean, gps, text, timestamp, enum, phone, email, address or hardware_id.Maximum size of the value in bytes, from 1 to 160. For an
enum field wede sets it to the length of its longest option code.Whether the field is in use. A disabled field is not shown to the team, is not sent by SMS, is not required and cannot be the type field.
Marks the field as personal data. It is a label only: you decide whether the field is enabled and whether it travels by SMS.
Marks the type field: the
enum field whose options set the event type. One per schema at most.Only for
enum fields, which need 1 to 64 options. Each option has code (1 to 4 uppercase letters or digits, unique in the field), label (1 to 60 characters) and, optionally, action_code (1 to 50 letters, digits or _): the code of the event type in your catalog that the option creates. Without action_code, the type code is the option code in lowercase.Once stored as
true, the field cannot be removed or disabled in later versions. You can set it in version 1 of a model; in later versions only wede can change the flag, also on a field you add. See field protection.Checks
- Size. Every enabled field sent by SMS, filled to its
max_bytes, must fit in 32 SMS segments. The response carriessms_size, as in List parsers. - Event types. Unless you send
activate: false, every option of the type field must point to an active event type of the vertical in your catalog. - Field protection. A version after the first must respect the field protection of the active version of the model.
Example
Response 201
The new version, as in List parsers, with defaults applied to each field and its sms_size.
Errors
Create from a factory model
201 with the new version, or 200 with the version you already had.
