Skip to content

Session Stores

/session/update

Upsert and/or delete data stored in a specified session store.

bash
curl https://test-m1.minusonedb.com/session/update -d 'store=stash&ops=[{"upsert":[
{
    "ip": "65.29.29.190",
    "session": {
      "id": "0295aed9-5872-4586-8086-57d3d8c40fb8",
      "start": 1612497996184
    },
    "user": {
      "id": "f7661f25-7c49-4f3b-9185-ec6566892878"
    },
    "event": {
      "id": "6dd089ce-5a96-4fac-a405-43c1ab3eb6b3",
      "time": 1612497996000,
      "type": "heartbeat",
      "data": {
        "a": "timers",
        "b": "string",
        "foo": "epe",
        "bar": "string"
      }
    }
}]},
{"delete" : ["78ba3dac-3e45-4e17-940e-e66584882ce4"]}]' \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 session/update -store stash -ops '[{"upsert": [{"ip": "65.29.29.190","session": {"id": "0295aed9-5872-4586-8086-57d3d8c40fb8","start": 1612497996184}}]},{"delete": ["78ba3dac-3e45-4e17-940e-e66584882ce4"]}]'
  • rights: sessionUpdate
  • verbs: POST
ParameterTypeRequired
storeStringYes
opsJSON (op[])Yes

Each op may have two properties: upsert (map[], must have session id parameter set) and delete (Array, session ids to be deleted).

No response when successful.

/session/query

Retrieve matching records from a session store.

The syntax and semantics of /session/query are the same as /query where possible. Because session stores accept items that have a deeply nested structure, dotted notation is used to signify nesting. In the example below, the archived item contained an m1 key that was a map containing an ip key. To query against that property in /session/query, use m1.ip as the property name.

bash
curl https://test-m1.minusonedb.com/session/query \
-d 'store=stash&q=_m1.ip:64.150.5.135' \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 session/query -store stash -q "_m1.ip:64.150.5.135"
  • rights: sessionQuery
  • verbs: POST
ParameterTypeRequired
storeStringYes
qStringYes
sortStringNo
startlongNo
rowslongNo
  • returns: JSON map containing a count of items matching the query and the requested number of matching items

Note: This is a streaming endpoint.

200 OKReturns matching session records

/session/list

Return a list of all configured session stores with metadata.

bash
curl https://test-m1.minusonedb.com/session/list \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 session/list
  • rights: get, admin
  • verbs: GET
  • parameters: none
200 OKReturns list of session stores

/session/key

Set the key to be used for identity tests.

bash
curl https://test-m1.minusonedb.com/session/key \
-d "store=stash&key=session.id" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 session/key -store stash -key "session.id"
  • rights: admin
  • verbs: POST
ParameterTypeRequired
storeStringYes
keyStringYes

No response when successful.

/session/add

Add configuration for a newly deployed session store. Called after a new store is deployed via MinusOneDB ops services. Use the m1 client to provision hardware and update your environment with one command.

bash
curl https://test-m1.minusonedb.com/session/add \
-d "store=stash&key=session.id&shards=1&replicas=1" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 session/add -store stash -key "session.id" -shards 1 -replicas 1
  • rights: admin
  • verbs: POST
ParameterTypeRequired
storeStringYes
keyStringNo
shardslongYes
replicaslongYes

The key defaults to session.id.

No response when successful.

/session/rename

Change the name of a session store.

bash
curl https://test-m1.minusonedb.com/session/rename \
-d "store=stash&name=newSessionStoreName" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 session/rename -store stash -name newSessionStoreName
  • rights: admin
  • verbs: POST
ParameterTypeRequired
storeStringYes
nameStringYes

No response when successful.

/session/drop

Removes configuration for a session store. Typically called after the store is destroyed via MinusOneDB ops services. Use the m1 client to decommission server resources and update your environment with one command.

bash
curl https://test-m1.minusonedb.com/session/drop \
-d "store=stash" \
-H "m1-auth-token: $myToken"
bash
m1 test-m1 session/drop -store stash
  • rights: admin
  • verbs: POST
ParameterTypeRequired
storeStringYes

No response when successful.

© 2021-2026 MinusOne, Inc.