Account Association API
JSON-RPC 2.0 interface for managing node identity, tokens, and account association.
- ACCOUNT_API_KEY: Found in
mimoe-api-key.envin your working directory. mimOE auto-generates this file on first startup. See MCM API: API Key File for details. - Developer account (for
associateAccount): Sign up and log in to get your Client ID and Developer ID Token.
Endpoint
POST /jsonrpc/v1
All requests use Content-Type: application/json and follow the JSON-RPC 2.0 format.
Request format
{
"jsonrpc": "2.0",
"method": "methodName",
"params": [],
"id": 1
}
Success response
{
"jsonrpc": "2.0",
"id": 1,
"result": { }
}
Error response
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32600,
"message": "Invalid Request"
}
}
Authentication
This API uses two authentication mechanisms, depending on the method:
- ACCOUNT_API_KEY: Found in the API key file (
mimoe-api-key.env). Pass the key in theAuthorizationheader as a bearer token. See MCM API: API Key File for details.
Authorization: Bearer <ACCOUNT_API_KEY>
- Edge access token: A JWT obtained through the account association flow. When required, pass the token as the first element in
params. Some methods require specific token scopes.
Overview
| Method | Auth | Description |
|---|---|---|
getMe | None | Returns node metadata |
getEdgeIdToken | ACCOUNT_API_KEY (bearer) | Returns a JWT identity token for the node |
associateAccount | ACCOUNT_API_KEY (bearer) + Edge token (edge:account:associate) | Links a developer account to the node |
getMe
Returns metadata about the local mimOE node. No authentication required.
Parameters
None.
Example request
curl -X POST "http://localhost:8083/jsonrpc/v1" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "getMe", "params": [], "id": 1}'
Example response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"accountId": "abc123-account-id",
"nodeId": "def456-node-id",
"nodeName": "My Device",
"version": "3.0.0"
}
}
Error cases
| Code | Message | Cause |
|---|---|---|
| -32603 | Internal error | Runtime is not ready |
getEdgeIdToken
Returns a signed JWT identity token for the node. This token is used in the account association flow to exchange for an access token.
Authentication
Requires ACCOUNT_API_KEY as bearer token in the Authorization header.
Parameters
None.
Token claims
The returned JWT contains these claims:
| Claim | Description |
|---|---|
sub | Node identifier |
iss | Issuer (mimOE runtime) |
iat | Issued at (Unix timestamp) |
exp | Expiration (Unix timestamp) |
node_id | Node unique identifier |
Example request
curl -X POST "http://localhost:8083/jsonrpc/v1" \
-H "Authorization: Bearer $ACCOUNT_API_KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "getEdgeIdToken", "params": [], "id": 1}'
Example response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
Error cases
| Code | Message | Cause |
|---|---|---|
| -32602 | Invalid params | ACCOUNT_API_KEY is missing or invalid |
| -32603 | Internal error | Token generation failed |
associateAccount
Links a developer account to the local mimOE node. This is required for continuum features like Account-Based Discovery and Proximity Discovery.
Authentication
Requires ACCOUNT_API_KEY as bearer token in the Authorization header.
Parameters
| Index | Type | Required | Description |
|---|---|---|---|
| 0 | string | Yes | Edge access token (with edge:account:associate scope) |
Example request
curl -X POST "http://localhost:8083/jsonrpc/v1" \
-H "Authorization: Bearer $ACCOUNT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "associateAccount",
"params": ["ACCESS_TOKEN"],
"id": 1
}'
Example response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "successfully associated"
}
}
Error cases
| Code | Message | Cause |
|---|---|---|
| -32602 | Invalid params | Missing or malformed access token |
| -32600 | Invalid Request | Token lacks edge:account:associate scope |
| -32603 | Internal error | Association failed (network or runtime error) |
Error Codes
Standard JSON-RPC 2.0 error codes:
| Code | Message | Description |
|---|---|---|
| -32700 | Parse error | Invalid JSON |
| -32600 | Invalid Request | Not a valid JSON-RPC 2.0 request |
| -32601 | Method not found | Method does not exist |
| -32602 | Invalid params | Invalid method parameters |
| -32603 | Internal error | Internal runtime error |