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”enable
Section titled “enable”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.
autoUpdateInterval
Section titled “autoUpdateInterval”Type:
Duration· default:7776000000How long a downloaded application bundle is kept in the blob store. Once it expires, the bundle is downloaded again the next time the application is loaded
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?Client identifier used when the domain is served by an external identity provider that does not support OAuth Client ID Metadata Documents. It must match a client registered with that provider. When the provider supports them, the application’s metadata document URL is used instead.
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/jmap/ \ -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 the following operations in a single call: create, update, destroy.
Create
Section titled “Create”This operation requires the sysApplicationCreate permission.
curl -X POST https://mail.example.com/jmap/ \ -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/jmap/ \ -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/jmap/ \ -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/jmap/ \ -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