Parchment Docs

Users

User and profile management

Get Auth Sessions Current

The current user. token is echoed only to bearer-authenticated clients.

GET
/auth/sessions/current

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)
Empty

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.

POST
/users/me/avatar

Request Body

application/jsonRequired
fileRequiredfile
Default: "File"Format: "binary"

Response Body

TypeScript Definitions

Use the response body type in TypeScript.

pictureRequiredstring

Absolute URL of the new avatar

TypeScript Definitions

Use the response body type in TypeScript.

messageRequiredstring
curl -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"
}

Delete avatar

DELETE
/users/me/avatar

Response Body

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)
Empty

Get (or lazily create) the per-device wrap secret used by the client to derive the localStorage-seed wrap key. Idempotent.

GET
/users/me/devices/{deviceId}/wrap-secret

Path Parameters

deviceIdRequiredstring
Minimum length: 8Maximum 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)
Empty
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)
Empty

Get Users

GET
/users

Query Parameters

pagestring | number
limitstring | number

Response Body

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)
Empty

Create a new user

POST
/users

Request Body

application/jsonRequired
firstNamestring
lastNamestring
emailRequiredstring
Format: "email"
picturestring
rolesarray<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)
Empty

Get Users Roles

GET
/users/roles

Response Body

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)
Empty

Post Users Roles

POST
/users/roles

Request Body

application/jsonRequired
idstring
nameRequiredstring
descriptionstring
permissionsarray<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)
Empty

Get Users Roles By Id

GET
/users/roles/{id}

Path Parameters

idRequiredstring

Response Body

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)
Empty

Patch Users Roles By Id

PATCH
/users/roles/{id}

Request Body

application/jsonRequired
namestring
descriptionstring

Path Parameters

idRequiredstring

Response 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)
Empty

Delete Users Roles By Id

DELETE
/users/roles/{id}

Path Parameters

idRequiredstring

Response Body

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)
Empty

Put Users Roles By Id Permissions

PUT
/users/roles/{id}/permissions

Request Body

application/jsonRequired
permissionsRequiredarray<string>

Path Parameters

idRequiredstring

Response 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)
Empty

Get all permissions

GET
/users/permissions

Response Body

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)
Empty

Get Users Permissions By Id

GET
/users/permissions/{id}

Path Parameters

idRequiredstring

Response Body

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)
Empty

Get Users By Id

GET
/users/{id}

Path Parameters

idRequiredstring

Response Body

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)
Empty

Patch Users By Id

PATCH
/users/{id}

Request Body

application/jsonRequired
firstNamestring
lastNamestring
emailstring
Format: "email"
rolesarray<string>

Path Parameters

idRequiredstring

Response 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)
Empty

Delete Users By Id

DELETE
/users/{id}

Path Parameters

idRequiredstring

Response Body

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)
Empty

Get Users By Id Billing

GET
/users/{id}/billing

Path Parameters

idRequiredstring

Response Body

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)
Empty

Post Users By Id Impersonate

POST
/users/{id}/impersonate

Path Parameters

idRequiredstring

Response Body

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)
Empty

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.

POST
/users/me/identity/reset/step-up

Request Body

application/jsonRequired
methodstring

Response 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)
Empty

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.

POST
/users/me/identity/reset

Request Body

application/jsonRequired
confirmRequiredstring
codestring
Maximum length: 16
passkeyunknown

Response 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)
Empty

Get Users Me Revocations Pending

List peer handles queued for revocation after an identity reset.

GET
/users/me/revocations/pending

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)
Empty

Post Users Me Revocations Flush

Deliver client-signed RELATIONSHIP_REVOKE envelopes to their peers. Rows that deliver are dropped; failures stay queued for retry.

POST
/users/me/revocations/flush

Request Body

application/jsonRequired
itemsRequiredarray<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)
Empty

Delete Users Me Revocations Pending By Peer Handle

Drop a queued revocation without delivering it.

DELETE
/users/me/revocations/pending/{peerHandle}

Path Parameters

peerHandleRequiredstring

Response 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)
Empty

Get Users Me Identity

Get current user federation identity (handle, keys, and the master-key version those keys belong to)

GET
/users/me/identity

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)
Empty

Patch Users Me Alias

Update current user alias (username for federation)

PATCH
/users/me/alias

Request Body

application/jsonRequired
aliasRequiredstring

Response 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)
Empty

Get Users Alias Check

Check if an alias is available

GET
/users/alias/check

Query Parameters

aliasRequiredstring

Response Body

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)
Empty

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).

PUT
/users/me/keys

Request Body

application/jsonRequired
signingKeyRequiredstring
encryptionKeyRequiredstring

Response 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)
Empty

Patch Users Me Profile

Update current user display profile (first/last name)

PATCH
/users/me/profile

Request Body

application/jsonRequired
firstNamestring | null | null
lastNamestring | null | null
picturestring | null | null

Response 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)
Empty

Get Users Me Km version

Get current master-key version (Part C.7)

GET
/users/me/km-version

Response Body

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)
Empty

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.

POST
/users/me/km-version/commit

Request Body

application/jsonRequired
expectedCurrentRequirednumber
signingKeyRequiredstring
encryptionKeyRequiredstring
blobsarray<object>
collectionsarray<object>
routesarray<object>
canvasesarray<object>
sharesarray<object>
incomingSharesarray<object>
friendPinsarray<object>
slotsarray<object>
recoveryKeyConfirmedboolean

Response 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)
Empty

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.

GET
/users/me/preferences

Response Body

TypeScript Definitions

Use the response body type in TypeScript.

languageRequiredstring
unitSystemRequiredstring
navigationRequiredobject
askRequiredobject
appRequiredobject
curl -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.

PUT
/users/me/preferences

Request Body

application/jsonRequired
languagestring
unitSystemstring
navigationobject
askobject
appobject
originstring

The sending client's id, echoed in the preferences:updated event so it can skip its own change.

Maximum length: 64

Response Body

TypeScript Definitions

Use the response body type in TypeScript.

languageRequiredstring
unitSystemRequiredstring
navigationRequiredobject
askRequiredobject
appRequiredobject
curl -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": {}
  }
}

Post Users Me Onboarding Complete

Mark onboarding as complete for the current user

POST
/users/me/onboarding/complete

Response Body

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)
Empty