Skip to main content

Account Association API

JSON-RPC 2.0 interface for managing node identity, tokens, and account association.

Prerequisites
  • ACCOUNT_API_KEY: Found in mimoe-api-key.env in 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 the Authorization header 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

MethodAuthDescription
getMeNoneReturns node metadata
getEdgeIdTokenACCOUNT_API_KEY (bearer)Returns a JWT identity token for the node
associateAccountACCOUNT_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

CodeMessageCause
-32603Internal errorRuntime 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:

ClaimDescription
subNode identifier
issIssuer (mimOE runtime)
iatIssued at (Unix timestamp)
expExpiration (Unix timestamp)
node_idNode 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

CodeMessageCause
-32602Invalid paramsACCOUNT_API_KEY is missing or invalid
-32603Internal errorToken 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

IndexTypeRequiredDescription
0stringYesEdge 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

CodeMessageCause
-32602Invalid paramsMissing or malformed access token
-32600Invalid RequestToken lacks edge:account:associate scope
-32603Internal errorAssociation failed (network or runtime error)

Error Codes

Standard JSON-RPC 2.0 error codes:

CodeMessageDescription
-32700Parse errorInvalid JSON
-32600Invalid RequestNot a valid JSON-RPC 2.0 request
-32601Method not foundMethod does not exist
-32602Invalid paramsInvalid method parameters
-32603Internal errorInternal runtime error