MemoryLookupKeyValue
MemoryLookupKeyValue
Section titled “MemoryLookupKeyValue”Defines an in-memory lookup key-value pair.
This object can be configured from the WebUI under Settings › Lookups › In-Memory Key-Values
Fields
Section titled “Fields”namespace
Section titled “namespace”Type:
String· requiredThe namespace of the key
Type:
String· required · max length: 255The key name
Type:
String· requiredThe key value
isGlobPattern
Section titled “isGlobPattern”Type:
Boolean· default:falseWhether the key is a glob pattern
JMAP API
Section titled “JMAP API”The MemoryLookupKeyValue object is available via the urn:stalwart:jmap capability.
x:MemoryLookupKeyValue/get
Section titled “x:MemoryLookupKeyValue/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
This method requires the sysMemoryLookupKeyValueGet permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MemoryLookupKeyValue/get", { "ids": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MemoryLookupKeyValue/set
Section titled “x:MemoryLookupKeyValue/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 sysMemoryLookupKeyValueCreate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MemoryLookupKeyValue/set", { "create": { "new1": { "key": "Example", "namespace": "Example", "value": "Example" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Update
Section titled “Update”This operation requires the sysMemoryLookupKeyValueUpdate permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MemoryLookupKeyValue/set", { "update": { "id1": { "namespace": "updated value" } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'Destroy
Section titled “Destroy”This operation requires the sysMemoryLookupKeyValueDestroy permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MemoryLookupKeyValue/set", { "destroy": [ "id1" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:MemoryLookupKeyValue/query
Section titled “x:MemoryLookupKeyValue/query”This is a standard Foo/query method as defined in RFC 8620, Section 5.5.
This method requires the sysMemoryLookupKeyValueQuery permission.
curl -X POST https://mail.example.com/api \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:MemoryLookupKeyValue/query", { "filter": { "namespace": "example" } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'The x:MemoryLookupKeyValue/query filter argument accepts the following conditions (combinable with AnyOf / AllOf / Not per RFC 8620):
| Condition | Kind |
|---|---|
namespace | text |
stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get MemoryLookupKeyValue id1Create
Section titled “Create”stalwart-cli create MemoryLookupKeyValue \ --field namespace=Example \ --field key=Example \ --field value=Examplestalwart-cli query MemoryLookupKeyValuestalwart-cli query MemoryLookupKeyValue --where namespace=exampleUpdate
Section titled “Update”stalwart-cli update MemoryLookupKeyValue id1 --field namespace='updated value'Delete
Section titled “Delete”stalwart-cli delete MemoryLookupKeyValue --ids id1