Federation
Federation and external identity
Post Federation Inbox
Receive a v2 federation message from another server. The request must carry a valid server signature, the from handle must live on the sending server, and the transport nonce must equal the message nonce so each user-signed message is accepted once.
Request Body
application/jsonRequiredprotocol_versionRequirednumber2message_typeRequiredstringmessage_versionRequirednumbernonceRequiredstring64fromRequiredstring320toRequiredstring320timestampRequiredstring40signatureRequiredstring256payloadRequiredobjectResponse Body
curl -X POST "https://example.com/federation/inbox" \
-H "Content-Type: application/json" \
-d '{
"protocol_version": 2,
"message_type": "string",
"message_version": 0,
"nonce": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
}'const body = JSON.stringify({
"protocol_version": 2,
"message_type": "string",
"message_version": 0,
"nonce": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
})
fetch("https://example.com/federation/inbox", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/federation/inbox"
body := strings.NewReader(`{
"protocol_version": 2,
"message_type": "string",
"message_version": 0,
"nonce": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
}`)
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/federation/inbox"
body = {
"protocol_version": 2,
"message_type": "string",
"message_version": 0,
"nonce": "string",
"from": "string",
"to": "string",
"timestamp": "string",
"signature": "string",
"payload": {}
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
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)