Application
Defines a web application served by the server.
This object can be configured from the WebUI under Settings › Web Applications
Fields
enabled
Type:
Boolean· default:trueWhether the application is enabled and should be served by the server
description
Type:
String· requiredA short description of the web application
resourceUrl
Type:
String· requiredOverride the URL to download application updates from.
urlPrefix
Type:
String[]· min items: 1The URL prefixes to serve the application on. For example, if set to "/admin", the application will be accessible at http://server/admin.
autoUpdateFrequency
Type:
Duration· default:"90d"Frequency to check for application updates
unpackDirectory
Type:
String?The local path to unpack the application bundle to. If left empty, the application will be unpacked to /tmp.
JMAP API
The Application object is available via the urn:stalwart:jmap capability.
x:Application/get
This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysApplicationGet permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Application/get",
{
"ids": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:Application/set
This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
Supports create, update, and destroy operations in a single call.
Create
This operation requires the sysApplicationCreate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Application/set",
{
"create": {
"new1": {
"autoUpdateFrequency": "90d",
"description": "Example",
"enabled": true,
"resourceUrl": "Example",
"unpackDirectory": "Example",
"urlPrefix": []
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Update
This operation requires the sysApplicationUpdate permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Application/set",
{
"update": {
"id1": {
"description": "updated value"
}
}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
Destroy
This operation requires the sysApplicationDestroy permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Application/set",
{
"destroy": [
"id1"
]
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
x:Application/query
This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysApplicationQuery permission.
curl -X POST https://mail.example.com/api \
-H 'Authorization: Bearer $TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"methodCalls": [
[
"x:Application/query",
{
"filter": {}
},
"c1"
]
],
"using": [
"urn:ietf:params:jmap:core",
"urn:stalwart:jmap"
]
}'
CLI
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
Fetch
stalwart-cli get application id1
Create
stalwart-cli create application \
--field enabled=true \
--field description=Example \
--field resourceUrl=Example \
--field 'urlPrefix=[]' \
--field autoUpdateFrequency=90d \
--field unpackDirectory=Example
Query
stalwart-cli query application
Update
stalwart-cli update application id1 --field description='Updated'
Delete
stalwart-cli delete application --ids id1