URL : /xhr/schema
Method : GET
Authentication required : YES
Query parameters (optional)
- sort.orderby: "name" | "weight"
- sort.direction: "asc" | "desc"
- sort.limit: number
- sort.offset: number
- sort.page: number
Example
GET /xhr/schema
Response Code : 200
[
{
"id": 1,
"identifier": "antispam",
"name": "Enable antispam",
"description": "Enable antispam for this domain.",
"properties": {
"type": "toggle",
"default_value": true,
"option_values": []
},
"access_type": "domain",
"weight": 2,
"group_id": 1
},
{
"id": 2,
"identifier": "spamlevel",
"name": "Spam level",
"description": "",
"properties": {
"type": "select",
"default_value": "medium",
"option_values": [
"high",
"medium",
"low"
]
},
"access_type": "all",
"weight": 2,
"group_id": 1
}
]
Response Code :
401 Unauthorized
500 Internal Server Error
description...
URL : /xhr/schema/_id/:id
Method : GET
Authentication required : YES
Query parameters
- id: number (Schema ID)
Example
GET /xhr/schema/_id/1
Response Code : 200
{
"id": 1,
"identifier": "antispam",
"name": "Enable antispam",
"description": "Enable antispam for this domain.",
"properties": {
"type": "toggle",
"default_value": true,
"option_values": []
},
"access_type": "domain",
"weight": 2,
"group_id": 1
}
Response Code :
401 Unauthorized
404 Not Found
500 Internal Server Error
URL : /xhr/schema
Method : POST
Authentication required : YES
Body parameters
- identifier: string (Unique settings identifier, which the MTA will use to fetch domain and user settings with)
- name: string (Display name)
- description: string (Description for the schema setting)
- properties: object
- type: "input" | "textarea" | "select" | "multiselect" | "toggle" | "list" | "checkbox"
- default_value: string | number | boolean | array
- option_values: array
- placeholder: string (Display placeholder)
- ttl: boolean (For list type)
- comment: string (For list type)
- feature: boolean
- validate: object
- enabled: boolean
- type: "regex"
- regex: object
- pattern: string
- switches: string
- access_type: "all" | "domain" | "user" (Applied to all or domains / users)
- weight: number (Sort order)
- group_id: number (Group ID)
Example
POST /xhr/schema
{
"identifier": "antivirus",
"name": "Enable antivirus",
"description": "Enable or disable antivirus checks",
"properties": {
"type": "toggle",
"default_value": true
},
"access_type": "all",
"weight": 5
}
Response Code : 200
{
"id": number
}
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/schema/_id/:id
Method : PATCH
Authentication required : YES
Query parameters
- id: number (Schema ID)
Body parameters
- identifier: string (Unique settings identifier, which the MTA will use to fetch domain and user settings with)
- name: string (Display name)
- description: string (Description for the schema setting)
- properties: object
- type: "input" | "textarea" | "select" | "multiselect" | "toggle" | "list" | "checkbox"
- default_value: string | number | boolean | array
- option_values: array
- placeholder: string (Display placeholder)
- ttl: boolean (For list type)
- comment: string (For list type)
- feature: boolean
- validate: object
- enabled: boolean
- type: "regex"
- regex: object
- pattern: string
- switches: string
- access_type: "all" | "domain" | "user" (Applied to all or domains / users)
- weight: number (Sort order)
- group_id: number (Group ID)
Example
PATCH /xhr/schema/_id/1
{
"weight": 5
}
Response Code : 204
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/schema/_id/:id
Method : DELETE
Authentication required : YES
Query parameters
- id: number (Schema ID)
Example
DELETE /xhr/schema/_id/1
Response Code : 204
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/schemagroup
Method : GET
Authentication required : YES
Query parameters (optional)
- sort.orderby: "name" | "weight"
- sort.direction: "asc" | "desc"
- sort.limit: number
- sort.offset: number
- sort.page: number
Example
GET /xhr/schemagroup
Response Code : 200
[
{
"id": 1,
"name": "Inbound protection",
"description": "Enable/disable features for antivirus and antispam",
"weight": 0
},
{
"id": 2,
"name": "Outbound features",
"description": "",
"weight": 2
}
]
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/schemagroup/_id/:id
Method : GET
Authentication required : YES
Query parameters
- id: number (Schema group ID)
Example
GET /xhr/schemagroup/_id/1
Response Code : 200
{
"id": 1,
"name": "Inbound protection",
"description": "Enable/disable features for antivirus and antispam.",
"weight": 0
}
Response Code :
401 Unauthorized
404 Not Found
500 Internal Server Error
description...
URL : /xhr/schemagroup
Method : POST
Authentication required : YES
Body parameters
- name: string (Display name)
- description: string (Display description)
- weight: number (Sort order)
Example
POST /xhr/schemagroup
{
"name": "Inbound features",
"description": "",
"weight": 1
}
Response Code : 200
{
"id": number
}
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/schemagroup/_id/:id
Method : PATCH
Authentication required : YES
Body parameters
- name: string (Display name)
- description: string (Display description)
- weight: number (Sort order)
Example
PATCH /xhr/schemagroup/_id/1
{
"description": "List of features related to inbound protection"
}
Response Code : 204
Response Code :
401 Unauthorized
500 Internal Server Error
URL : /xhr/schemagroup/_id/:id
Method : DELETE
Authentication required : YES
Query parameters
- id: number (Schema group ID)
Example
DELETE /xhr/schemagroup/_id/1
Response Code : 204
Response Code :
401 Unauthorized
500 Internal Server Error