In order to create a new Schema, the following headers are required:
Lucent-Channel: {channel-id}
Lucent-User: {sys-user-key}
Authentication: Bearer {sys-user-secret}
Accept-Language: en-US
The API expects the following data:
Field | Type | Description |
---|---|---|
key (unique) | string (min:3, max:120, alphadash) | An alphadash string. This is set on creation and cannot be changed later |
name | string (min:3, max:120) | The name of the Schema |
type | string ("standard", "subschema", "combo") | The type of the Schema (More info here). This is set on creation and cannot be changed later |
group (optional) | string (default:"") | The group the Schema belongs to |
subtype (optional) | string (default:null, "singleton", "hierarchical", "resource", "table") | The subtype of the Schema (More info here). This is set on creation and cannot be changed later |
uri (optional) | string (default:null) | The preview URI for the Schema |
revisionsEnabled (optional) | bool (default:false) | Whether the Schema will have revisions enabled |
Below you can find a demo request and a demo response.
Demo Request
POST /api/schemas
Lucent-Channel: {channel-id}
Lucent-User: {sys-user-key}
Authentication: Bearer {sys-user-secret}
Accept-Language: en-US
{
"data": {
"key": "taxons",
"name": "Taxons",
"type": "standard",
"subtype": "hierarchical",
"uri": "https://testsite.com",
"group": "Base Group",
"revisionsEnabled": true
}
}
Demo Response
201 Created
{
"data": {
"key": "taxons",
"name": "Taxons",
"type": "standard",
"group": "Base Group",
"subtype": "hierarchical",
"uri": "https://testsite.com",
"fields": [
{
"id": "title",
"name": "Title",
"type": "text",
"status": "active",
"ui": "textarea",
"help": "",
"options": {
"visible": true,
"permanent": true
},
"validation": {
"required": true
}
}
],
"revisionsEnabled": true
},
"errors": null,
"meta": null,
"links": null,
"included": null
}