Users
User and profile management
Get Auth Sessions Current
The current user. token is echoed only to bearer-authenticated clients.
Response Body
curl -X GET "https://example.com/auth/sessions/current"fetch("https://example.com/auth/sessions/current")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/auth/sessions/current"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/auth/sessions/current"
response = requests.request("GET", url)
print(response.text)Upload avatar
Accepts a JPEG, PNG or WebP up to 2MB (judged by its contents, not its name), center-crops it to a 256px square WebP and sets it as the caller’s picture. Each upload gets a new URL, so it can be cached indefinitely.
Request Body
application/jsonRequiredfileRequiredfile"File"Format: "binary"Response Body
TypeScript Definitions
Use the response body type in TypeScript.
pictureRequiredstringAbsolute URL of the new avatar
TypeScript Definitions
Use the response body type in TypeScript.
messageRequiredstringcurl -X POST "https://example.com/users/me/avatar" \
-H "Content-Type: application/json" \
-d '{
"file": "File"
}'const body = JSON.stringify({
"file": "File"
})
fetch("https://example.com/users/me/avatar", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/avatar"
body := strings.NewReader(`{
"file": "File"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/avatar"
body = {
"file": "File"
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text){
"picture": "string"
}{
"message": "string"
}curl -X DELETE "https://example.com/users/me/avatar"fetch("https://example.com/users/me/avatar")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/avatar"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/avatar"
response = requests.request("DELETE", url)
print(response.text)Get (or lazily create) the per-device wrap secret used by the client to derive the localStorage-seed wrap key. Idempotent.
Path Parameters
deviceIdRequiredstring8Maximum length: 64Pattern: "^[a-zA-Z0-9-]+$"Response Body
curl -X GET "https://example.com/users/me/devices/stringst/wrap-secret"fetch("https://example.com/users/me/devices/stringst/wrap-secret")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/devices/stringst/wrap-secret"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/devices/stringst/wrap-secret"
response = requests.request("GET", url)
print(response.text)Rotate every device wrap secret for the current user. Any cached seed envelope on any device becomes un-unwrappable.
Response Body
curl -X POST "https://example.com/users/me/device-wrap-secrets/rotate"fetch("https://example.com/users/me/device-wrap-secrets/rotate")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/device-wrap-secrets/rotate"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/device-wrap-secrets/rotate"
response = requests.request("POST", url)
print(response.text)curl -X GET "https://example.com/users/?page=0&limit=0"fetch("https://example.com/users/?page=0&limit=0")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/?page=0&limit=0"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/?page=0&limit=0"
response = requests.request("GET", url)
print(response.text)Create a new user
Request Body
application/jsonRequiredfirstNamestringlastNamestringemailRequiredstring"email"picturestringrolesarray<string>Response Body
curl -X POST "https://example.com/users/" \
-H "Content-Type: application/json" \
-d '{
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"picture": "string",
"roles": [
"string"
]
}'const body = JSON.stringify({
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"picture": "string",
"roles": [
"string"
]
})
fetch("https://example.com/users/", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/"
body := strings.NewReader(`{
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"picture": "string",
"roles": [
"string"
]
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/"
body = {
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"picture": "string",
"roles": [
"string"
]
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)curl -X GET "https://example.com/users/roles"fetch("https://example.com/users/roles")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/roles"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/roles"
response = requests.request("GET", url)
print(response.text)Post Users Roles
Request Body
application/jsonRequiredidstringnameRequiredstringdescriptionstringpermissionsarray<string>Response Body
curl -X POST "https://example.com/users/roles" \
-H "Content-Type: application/json" \
-d '{
"id": "string",
"name": "string",
"description": "string",
"permissions": [
"string"
]
}'const body = JSON.stringify({
"id": "string",
"name": "string",
"description": "string",
"permissions": [
"string"
]
})
fetch("https://example.com/users/roles", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/roles"
body := strings.NewReader(`{
"id": "string",
"name": "string",
"description": "string",
"permissions": [
"string"
]
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/roles"
body = {
"id": "string",
"name": "string",
"description": "string",
"permissions": [
"string"
]
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)curl -X GET "https://example.com/users/roles/string"fetch("https://example.com/users/roles/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/roles/string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/roles/string"
response = requests.request("GET", url)
print(response.text)Patch Users Roles By Id
Request Body
application/jsonRequirednamestringdescriptionstringPath Parameters
idRequiredstringResponse Body
curl -X PATCH "https://example.com/users/roles/string" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string"
}'const body = JSON.stringify({
"name": "string",
"description": "string"
})
fetch("https://example.com/users/roles/string", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/roles/string"
body := strings.NewReader(`{
"name": "string",
"description": "string"
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/roles/string"
body = {
"name": "string",
"description": "string"
}
response = requests.request("PATCH", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)curl -X DELETE "https://example.com/users/roles/string"fetch("https://example.com/users/roles/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/roles/string"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/roles/string"
response = requests.request("DELETE", url)
print(response.text)Put Users Roles By Id Permissions
Request Body
application/jsonRequiredpermissionsRequiredarray<string>Path Parameters
idRequiredstringResponse Body
curl -X PUT "https://example.com/users/roles/string/permissions" \
-H "Content-Type: application/json" \
-d '{
"permissions": [
"string"
]
}'const body = JSON.stringify({
"permissions": [
"string"
]
})
fetch("https://example.com/users/roles/string/permissions", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/roles/string/permissions"
body := strings.NewReader(`{
"permissions": [
"string"
]
}`)
req, _ := http.NewRequest("PUT", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/roles/string/permissions"
body = {
"permissions": [
"string"
]
}
response = requests.request("PUT", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)curl -X GET "https://example.com/users/permissions"fetch("https://example.com/users/permissions")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/permissions"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/permissions"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/users/permissions/string"fetch("https://example.com/users/permissions/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/permissions/string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/permissions/string"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/users/string"fetch("https://example.com/users/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/string"
response = requests.request("GET", url)
print(response.text)Patch Users By Id
Request Body
application/jsonRequiredfirstNamestringlastNamestringemailstring"email"rolesarray<string>Path Parameters
idRequiredstringResponse Body
curl -X PATCH "https://example.com/users/string" \
-H "Content-Type: application/json" \
-d '{
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"roles": [
"string"
]
}'const body = JSON.stringify({
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"roles": [
"string"
]
})
fetch("https://example.com/users/string", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/string"
body := strings.NewReader(`{
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"roles": [
"string"
]
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/string"
body = {
"firstName": "string",
"lastName": "string",
"email": "user@example.com",
"roles": [
"string"
]
}
response = requests.request("PATCH", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)curl -X DELETE "https://example.com/users/string"fetch("https://example.com/users/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/string"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/string"
response = requests.request("DELETE", url)
print(response.text)curl -X GET "https://example.com/users/string/billing"fetch("https://example.com/users/string/billing")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/string/billing"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/string/billing"
response = requests.request("GET", url)
print(response.text)curl -X POST "https://example.com/users/string/impersonate"fetch("https://example.com/users/string/impersonate")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/string/impersonate"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/string/impersonate"
response = requests.request("POST", url)
print(response.text)Post Users Me Identity Reset Step up
Start the re-authentication an identity reset requires. Returns passkey assertion options when the user has a passkey, otherwise emails a one-time code. Pass method: "email" to force the code. Shares a limit of 10 a user every 15 minutes with the reset itself.
Request Body
application/jsonRequiredmethodstringResponse Body
curl -X POST "https://example.com/users/me/identity/reset/step-up" \
-H "Content-Type: application/json" \
-d '{
"method": "email"
}'const body = JSON.stringify({
"method": "email"
})
fetch("https://example.com/users/me/identity/reset/step-up", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/identity/reset/step-up"
body := strings.NewReader(`{
"method": "email"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/identity/reset/step-up"
body = {
"method": "email"
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Post Users Me Identity Reset
Last-resort: wipe all of this user's encrypted data and clear the federation identity so they can re-run identity setup. Requires a fresh step-up from /me/identity/reset/step-up: the passkey assertion as passkey, or the emailed code as code. Session + passkeys survive; everything encrypted under the old seed is gone. Irreversible.
Request Body
application/jsonRequiredconfirmRequiredstringcodestring16passkeyunknownResponse Body
curl -X POST "https://example.com/users/me/identity/reset" \
-H "Content-Type: application/json" \
-d '{
"confirm": "erase-all-my-data",
"code": "string",
"passkey": null
}'const body = JSON.stringify({
"confirm": "erase-all-my-data",
"code": "string",
"passkey": null
})
fetch("https://example.com/users/me/identity/reset", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/identity/reset"
body := strings.NewReader(`{
"confirm": "erase-all-my-data",
"code": "string",
"passkey": null
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/identity/reset"
body = {
"confirm": "erase-all-my-data",
"code": "string",
"passkey": null
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Get Users Me Revocations Pending
List peer handles queued for revocation after an identity reset.
Response Body
curl -X GET "https://example.com/users/me/revocations/pending"fetch("https://example.com/users/me/revocations/pending")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/revocations/pending"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/revocations/pending"
response = requests.request("GET", url)
print(response.text)Post Users Me Revocations Flush
Deliver client-signed RELATIONSHIP_REVOKE envelopes to their peers. Rows that deliver are dropped; failures stay queued for retry.
Request Body
application/jsonRequireditemsRequiredarray<object>Response Body
curl -X POST "https://example.com/users/me/revocations/flush" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"peerHandle": "string",
"signature": "string",
"nonce": "string",
"timestamp": "string",
"messageVersion": 0
}
]
}'const body = JSON.stringify({
"items": [
{
"peerHandle": "string",
"signature": "string",
"nonce": "string",
"timestamp": "string",
"messageVersion": 0
}
]
})
fetch("https://example.com/users/me/revocations/flush", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/revocations/flush"
body := strings.NewReader(`{
"items": [
{
"peerHandle": "string",
"signature": "string",
"nonce": "string",
"timestamp": "string",
"messageVersion": 0
}
]
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/revocations/flush"
body = {
"items": [
{
"peerHandle": "string",
"signature": "string",
"nonce": "string",
"timestamp": "string",
"messageVersion": 0
}
]
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Delete Users Me Revocations Pending By Peer Handle
Drop a queued revocation without delivering it.
Path Parameters
peerHandleRequiredstringResponse Body
curl -X DELETE "https://example.com/users/me/revocations/pending/string"fetch("https://example.com/users/me/revocations/pending/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/revocations/pending/string"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/revocations/pending/string"
response = requests.request("DELETE", url)
print(response.text)Get Users Me Identity
Get current user federation identity (handle, keys, and the master-key version those keys belong to)
Response Body
curl -X GET "https://example.com/users/me/identity"fetch("https://example.com/users/me/identity")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/identity"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/identity"
response = requests.request("GET", url)
print(response.text)Patch Users Me Alias
Update current user alias (username for federation)
Request Body
application/jsonRequiredaliasRequiredstringResponse Body
curl -X PATCH "https://example.com/users/me/alias" \
-H "Content-Type: application/json" \
-d '{
"alias": "string"
}'const body = JSON.stringify({
"alias": "string"
})
fetch("https://example.com/users/me/alias", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/alias"
body := strings.NewReader(`{
"alias": "string"
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/alias"
body = {
"alias": "string"
}
response = requests.request("PATCH", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)curl -X GET "https://example.com/users/alias/check?alias=string"fetch("https://example.com/users/alias/check?alias=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/alias/check?alias=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/alias/check?alias=string"
response = requests.request("GET", url)
print(response.text)Put Users Me Keys
Register federation public keys. Succeeds when the account has none yet or already holds exactly these; 409 when different keys are registered (those change only via rotation commit or identity reset).
Request Body
application/jsonRequiredsigningKeyRequiredstringencryptionKeyRequiredstringResponse Body
curl -X PUT "https://example.com/users/me/keys" \
-H "Content-Type: application/json" \
-d '{
"signingKey": "string",
"encryptionKey": "string"
}'const body = JSON.stringify({
"signingKey": "string",
"encryptionKey": "string"
})
fetch("https://example.com/users/me/keys", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/keys"
body := strings.NewReader(`{
"signingKey": "string",
"encryptionKey": "string"
}`)
req, _ := http.NewRequest("PUT", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/keys"
body = {
"signingKey": "string",
"encryptionKey": "string"
}
response = requests.request("PUT", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Patch Users Me Profile
Update current user display profile (first/last name)
Request Body
application/jsonRequiredfirstNamestring | null | nulllastNamestring | null | nullpicturestring | null | nullResponse Body
curl -X PATCH "https://example.com/users/me/profile" \
-H "Content-Type: application/json" \
-d '{
"firstName": "string",
"lastName": "string",
"picture": "string"
}'const body = JSON.stringify({
"firstName": "string",
"lastName": "string",
"picture": "string"
})
fetch("https://example.com/users/me/profile", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/profile"
body := strings.NewReader(`{
"firstName": "string",
"lastName": "string",
"picture": "string"
}`)
req, _ := http.NewRequest("PATCH", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/profile"
body = {
"firstName": "string",
"lastName": "string",
"picture": "string"
}
response = requests.request("PATCH", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)curl -X GET "https://example.com/users/me/km-version"fetch("https://example.com/users/me/km-version")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/km-version"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/km-version"
response = requests.request("GET", url)
print(response.text)Post Users Me Km version Commit
Atomic rotation commit. Applies new public keys and every record re-encrypted under the new seed (blobs, collections and points, routes, canvases, share envelopes both ways, friend pins, passkey slots) in one transaction gated by a CAS on kmVersion. Slots not re-sealed are deleted. 409 when another device rotated first; 422 when a seed-derived record is missing, a private collection is shared with another server, or neither a slot nor a confirmed recovery key would unlock the new keys. Nothing is written on error.
Request Body
application/jsonRequiredexpectedCurrentRequirednumbersigningKeyRequiredstringencryptionKeyRequiredstringblobsarray<object>collectionsarray<object>routesarray<object>canvasesarray<object>sharesarray<object>incomingSharesarray<object>friendPinsarray<object>slotsarray<object>recoveryKeyConfirmedbooleanResponse Body
curl -X POST "https://example.com/users/me/km-version/commit" \
-H "Content-Type: application/json" \
-d '{
"expectedCurrent": 0,
"signingKey": "string",
"encryptionKey": "string",
"blobs": [
{
"blobType": "string",
"encryptedBlob": "string"
}
],
"collections": [
{
"id": "string",
"metadataEncrypted": "string",
"points": [
{
"id": "string",
"encryptedData": "string"
}
]
}
],
"routes": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"canvases": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"shares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"incomingShares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"friendPins": [
{
"friendHandle": "string",
"encryptedPin": "string",
"nonce": "string"
}
],
"slots": [
{
"credentialId": "string",
"wrappedKm": "string",
"wrapAlgo": "string",
"slotSignature": "string"
}
],
"recoveryKeyConfirmed": true
}'const body = JSON.stringify({
"expectedCurrent": 0,
"signingKey": "string",
"encryptionKey": "string",
"blobs": [
{
"blobType": "string",
"encryptedBlob": "string"
}
],
"collections": [
{
"id": "string",
"metadataEncrypted": "string",
"points": [
{
"id": "string",
"encryptedData": "string"
}
]
}
],
"routes": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"canvases": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"shares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"incomingShares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"friendPins": [
{
"friendHandle": "string",
"encryptedPin": "string",
"nonce": "string"
}
],
"slots": [
{
"credentialId": "string",
"wrappedKm": "string",
"wrapAlgo": "string",
"slotSignature": "string"
}
],
"recoveryKeyConfirmed": true
})
fetch("https://example.com/users/me/km-version/commit", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/km-version/commit"
body := strings.NewReader(`{
"expectedCurrent": 0,
"signingKey": "string",
"encryptionKey": "string",
"blobs": [
{
"blobType": "string",
"encryptedBlob": "string"
}
],
"collections": [
{
"id": "string",
"metadataEncrypted": "string",
"points": [
{
"id": "string",
"encryptedData": "string"
}
]
}
],
"routes": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"canvases": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"shares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"incomingShares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"friendPins": [
{
"friendHandle": "string",
"encryptedPin": "string",
"nonce": "string"
}
],
"slots": [
{
"credentialId": "string",
"wrappedKm": "string",
"wrapAlgo": "string",
"slotSignature": "string"
}
],
"recoveryKeyConfirmed": true
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/km-version/commit"
body = {
"expectedCurrent": 0,
"signingKey": "string",
"encryptionKey": "string",
"blobs": [
{
"blobType": "string",
"encryptedBlob": "string"
}
],
"collections": [
{
"id": "string",
"metadataEncrypted": "string",
"points": [
{
"id": "string",
"encryptedData": "string"
}
]
}
],
"routes": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"canvases": [
{
"id": "string",
"metadataEncrypted": "string",
"bodyEncrypted": "string"
}
],
"shares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"incomingShares": [
{
"id": "string",
"encryptedData": "string",
"nonce": "string"
}
],
"friendPins": [
{
"friendHandle": "string",
"encryptedPin": "string",
"nonce": "string"
}
],
"slots": [
{
"credentialId": "string",
"wrappedKm": "string",
"wrapAlgo": "string",
"slotSignature": "string"
}
],
"recoveryKeyConfirmed": true
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Get Users Me Preferences
Get current user preferences: language, unit system, navigation, Ask and app. Each navigation section (excludedModes, sortPreference, routing, speech, guidance) and app section (theme, map, general, layerAppearances, security) is absent until first saved.
Response Body
TypeScript Definitions
Use the response body type in TypeScript.
languageRequiredstringunitSystemRequiredstringnavigationRequiredobjectaskRequiredobjectappRequiredobjectcurl -X GET "https://example.com/users/me/preferences"fetch("https://example.com/users/me/preferences")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/preferences"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/preferences"
response = requests.request("GET", url)
print(response.text){
"language": "string",
"unitSystem": "string",
"navigation": {
"excludedModes": [
"transit"
],
"sortPreference": "shortest",
"routing": {
"general": {},
"mode": {}
},
"speech": {},
"guidance": {}
},
"ask": {
"enabled": true,
"suggest": true,
"shareLocation": true,
"webSearch": true,
"saveHistory": true,
"keepDays": 1
},
"app": {
"theme": {},
"map": {},
"general": {},
"layerAppearances": {},
"security": {}
}
}Put Users Me Preferences
Update current user preferences. Each navigation or app section sent replaces the stored one; sections left out are kept. Ask settings sent are merged into the stored ones. A change is pushed to the user's other signed-in clients as a preferences:updated event.
Request Body
application/jsonRequiredlanguagestringunitSystemstringnavigationobjectaskobjectappobjectoriginstringThe sending client's id, echoed in the preferences:updated event so it can skip its own change.
64Response Body
TypeScript Definitions
Use the response body type in TypeScript.
languageRequiredstringunitSystemRequiredstringnavigationRequiredobjectaskRequiredobjectappRequiredobjectcurl -X PUT "https://example.com/users/me/preferences" \
-H "Content-Type: application/json" \
-d '{
"language": "en-US",
"unitSystem": "metric",
"navigation": {
"excludedModes": [
"transit"
],
"sortPreference": "shortest",
"routing": {
"general": {},
"mode": {}
},
"speech": {},
"guidance": {}
},
"ask": {
"enabled": true,
"suggest": true,
"shareLocation": true,
"webSearch": true,
"saveHistory": true,
"keepDays": 1
},
"app": {
"theme": {},
"map": {},
"general": {},
"layerAppearances": {},
"security": {}
},
"origin": "string"
}'const body = JSON.stringify({
"language": "en-US",
"unitSystem": "metric",
"navigation": {
"excludedModes": [
"transit"
],
"sortPreference": "shortest",
"routing": {
"general": {},
"mode": {}
},
"speech": {},
"guidance": {}
},
"ask": {
"enabled": true,
"suggest": true,
"shareLocation": true,
"webSearch": true,
"saveHistory": true,
"keepDays": 1
},
"app": {
"theme": {},
"map": {},
"general": {},
"layerAppearances": {},
"security": {}
},
"origin": "string"
})
fetch("https://example.com/users/me/preferences", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/users/me/preferences"
body := strings.NewReader(`{
"language": "en-US",
"unitSystem": "metric",
"navigation": {
"excludedModes": [
"transit"
],
"sortPreference": "shortest",
"routing": {
"general": {},
"mode": {}
},
"speech": {},
"guidance": {}
},
"ask": {
"enabled": true,
"suggest": true,
"shareLocation": true,
"webSearch": true,
"saveHistory": true,
"keepDays": 1
},
"app": {
"theme": {},
"map": {},
"general": {},
"layerAppearances": {},
"security": {}
},
"origin": "string"
}`)
req, _ := http.NewRequest("PUT", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/preferences"
body = {
"language": "en-US",
"unitSystem": "metric",
"navigation": {
"excludedModes": [
"transit"
],
"sortPreference": "shortest",
"routing": {
"general": {},
"mode": {}
},
"speech": {},
"guidance": {}
},
"ask": {
"enabled": true,
"suggest": true,
"shareLocation": true,
"webSearch": true,
"saveHistory": true,
"keepDays": 1
},
"app": {
"theme": {},
"map": {},
"general": {},
"layerAppearances": {},
"security": {}
},
"origin": "string"
}
response = requests.request("PUT", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text){
"language": "string",
"unitSystem": "string",
"navigation": {
"excludedModes": [
"transit"
],
"sortPreference": "shortest",
"routing": {
"general": {},
"mode": {}
},
"speech": {},
"guidance": {}
},
"ask": {
"enabled": true,
"suggest": true,
"shareLocation": true,
"webSearch": true,
"saveHistory": true,
"keepDays": 1
},
"app": {
"theme": {},
"map": {},
"general": {},
"layerAppearances": {},
"security": {}
}
}curl -X POST "https://example.com/users/me/onboarding/complete"fetch("https://example.com/users/me/onboarding/complete")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/users/me/onboarding/complete"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/users/me/onboarding/complete"
response = requests.request("POST", url)
print(response.text)