Application
Defines a web application served by the server.
This object can be configured from the WebUI under Settings › Web Applications
Fields
Section titled “Fields”enabled
Section titled “enabled”Type:
Boolean· default:trueWhether the application is enabled and should be served by the server
description
Section titled “description”Type:
String· requiredA short description of the web application
resourceUrl
Section titled “resourceUrl”Type:
String· requiredOverride the URL to download application updates from.
urlPrefix
Section titled “urlPrefix”Type:
Set<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
Section titled “autoUpdateFrequency”Type:
Duration· default:7776000000Frequency to check for application updates
unpackDirectory
Section titled “unpackDirectory”Type:
String?The local path to unpack the application bundle to. If left empty, the application will be unpacked to /tmp.
oauthClientId
Section titled “oauthClientId”Type:
String?The OAuth client identifier that this application uses to start the authorization flow. Only required when the domain is served by an external identity provider, in which case it must match a client registered with that provider.
JMAP API
Section titled “JMAP API”The Application object is available via the urn:stalwart:jmap capability.
x:Application/get
Section titled “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
Section titled “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
Section titled “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": { "description": "Example", "resourceUrl": "Example", "urlPrefix": {} } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “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
Section titled “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
Section titled “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" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get Application id1Create
Section titled “Create”stalwart-cli create Application \ --field description=Example \ --field resourceUrl=Example \ --field 'urlPrefix={}'stalwart-cli query ApplicationUpdate
Section titled “Update”stalwart-cli update Application id1 --field description='updated value'Delete
Section titled “Delete”stalwart-cli delete Application --ids id1