API
Diode Console APIs Overview
Diode Console provides APIs for automating fleet creation, membership changes, and retirement using organization-scoped keys.
The public integration surface is JSON-RPC 2.0 over HTTPS. It is not Moonbeam RPC: on-chain work is queued by the console and completed asynchronously through the Diode chain layer.
Available APIs
| API | Description | Availability |
|---|---|---|
|
Console JSON-RPC API
POST /api/v1/rpc |
Manage fleet lifecycle and members from scripts, MDM tooling, or internal systems. | All organizations |
|
Organization API keys
dck_... |
Create, update, and revoke secrets in Settings. Each key is scoped to one organization with a label, fleet access mode (all fleets vs restricted grants), and action scopes. | Owners and admins |
|
Fleet operations
fleet.* |
Create, rename, list members, look up a device, add/remove members, and start fleet retirement. | Authenticated keys |
Authentication
Create API keys under Settings
(owners and admins only). Set an optional label,
choose fleet access (all fleets in the org or an explicit grant list), and select
action scopes
(read, member changes,
rename, destroy, fleet creation). Keys with only
create_fleet
may start with an empty grant list; each successful
fleet.create
adds the new fleet to grants when access is restricted. You can edit keys later; the secret stays read-once.
Copy the secret when it is created; only the hash is stored on the server.
Send it as a Bearer token. Lowercase bearer
is accepted.
Header
Authorization: Bearer YOUR_API_KEY
Request Format
Every call is a JSON object with jsonrpc, method,
params
(object), and id
(string or number).
Successful responses include result;
failures include error.
Batch Requests
POST a JSON array of request objects to run multiple calls in one HTTP request. Empty arrays are rejected with HTTP 400 and a JSON-RPC error object. For device imports, prefer the member batch methods over JSON-RPC request arrays: they create one database batch and split on-chain work into safe transaction chunks.
Batch example (curl)
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '[{"jsonrpc":"2.0","method":"fleet.create","params":{"name":"Alpha"},"id":1},{"jsonrpc":"2.0","method":"fleet.create","params":{"name":"Beta"},"id":2}]'
fleet.create
Create a new fleet for the organization. Returns
fleet_id
and initial state
while deployment continues asynchronously.
Parameters
-
name(string, required): display name.
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.create","params":{"name":"Production"},"id":1}'
Example response
{"jsonrpc":"2.0","id":1,"result":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","state":"deploying"}}
fleet.rename
Update the fleet name in the console. Imported read-only fleets can use this metadata-only operation.
Parameters
fleet_id(UUID string, required).name(string, required).
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.rename","params":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","name":"Staging"},"id":2}'
Example response
{"jsonrpc":"2.0","id":2,"result":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","name":"Staging","state":"live"}}
fleet.info
Read-only snapshot: device count (fleet member rows), registry stake as a wei string
(or null if the balance cannot be read), chain id, operator and accountant addresses,
and the fleet smart contract address. Hex fields use lowercase
0x
prefixes. Imported fleets are supported.
Parameters
fleet_id(UUID string, required).
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.info","params":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000"},"id":21}'
Example response
{"jsonrpc":"2.0","id":21,"result":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","device_count":2,"stake_wei":"1000000000000000000","chain_id":1284,"operator":"0x2222222222222222222222222222222222222222","accountant":"0x3333333333333333333333333333333333333333","contract_address":"0x742d35cc6634c0532925a3b844bc9e7595f0beb"}}
fleet.member.add
Add a member address to a fleet. Imported read-only fleets reject this method.
Parameters
fleet_id(UUID string, required).-
address(string, required): member wallet address. label(string, optional).
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.member.add","params":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","address":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","label":"Device A"},"id":3}'
Example response
{"jsonrpc":"2.0","id":3,"result":{"member_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","state":"pending_add"}}
fleet.member.add_batch
Add many member addresses to a fleet. The console validates the full request before
inserting members, then queues one
AddDeviceBatch
on-chain transaction per safe chunk.
Parameters
fleet_id(UUID string, required).-
members(array, required): objects withaddressand optionallabel. -
addresses(array): shorthand alternative when labels are not needed.
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.member.add_batch","params":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","members":[{"address":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb","label":"Device A"},{"address":"0x1111111111111111111111111111111111111111","label":"Device B"}]},"id":4}'
Example response
{"jsonrpc":"2.0","id":4,"result":{"count":2,"members":[{"member_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","state":"pending_add"},{"member_id":"6ba7b811-9dad-11d1-80b4-00c04fd430c8","state":"pending_add"}]}}
fleet.member.list
Paginated list of devices (fleet members) for a fleet. Includes removed rows still stored in the console. Imported read-only fleets are supported.
Parameters
fleet_id(UUID string, required).-
limit(integer, optional): page size, default 50, maximum 100. -
offset(integer, optional): rows to skip, default 0.
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.member.list","params":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","limit":50,"offset":0},"id":41}'
Example response
{"jsonrpc":"2.0","id":41,"result":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","members":[{"member_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","address":"0x742d35cc6634c0532925a3b844bc9e7595f0beb","label":"Device A","state":"active"}],"total":1,"limit":50,"offset":0,"has_more":false}}
fleet.member.get
Fetch one member by console id or device address. Pass exactly one of
member_id
or address. Imported read-only fleets are supported.
Parameters
fleet_id(UUID string, required).-
member_id(UUID): console member row id. -
address(string): device address (0xhex).
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.member.get","params":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","address":"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"},"id":42}'
Example response
{"jsonrpc":"2.0","id":42,"result":{"member_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","address":"0x742d35cc6634c0532925a3b844bc9e7595f0beb","label":"Device A","state":"active"}}
fleet.member.remove
Remove a member by its console id. Imported read-only fleets reject this method.
Parameters
member_id(UUID string, required).
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.member.remove","params":{"member_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8"},"id":5}'
Example response
{"jsonrpc":"2.0","id":5,"result":{"member_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","state":"pending_remove"}}
fleet.member.remove_batch
Remove many members. Pass member_ids
directly, or pass fleet_id
with addresses
to remove by device address. The console queues
RemoveDeviceBatch
transactions in safe chunks.
Parameters
-
member_ids(array): console member UUIDs. -
fleet_idplusaddresses(array): remove by fleet and member address.
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.member.remove_batch","params":{"member_ids":["6ba7b810-9dad-11d1-80b4-00c04fd430c8","6ba7b811-9dad-11d1-80b4-00c04fd430c8"]},"id":6}'
Example response
{"jsonrpc":"2.0","id":6,"result":{"count":2,"members":[{"member_id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8","state":"pending_remove"},{"member_id":"6ba7b811-9dad-11d1-80b4-00c04fd430c8","state":"pending_remove"}]}}
fleet.destroy
Start fleet retirement by requesting full unstake. Imported read-only fleets reject this method. Chain completion remains asynchronous.
Parameters
fleet_id(UUID string, required).
Example request
curl https://console.diode.io/api/v1/rpc \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"jsonrpc":"2.0","method":"fleet.destroy","params":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000"},"id":7}'
Example response
{"jsonrpc":"2.0","id":7,"result":{"fleet_id":"550e8400-e29b-41d4-a716-446655440000","state":"unstaking","note":"unstake_enqueued"}}
Common Error Responses
JSON-RPC errors use negative numeric code
values. HTTP status is usually 200 for application-level errors except where noted.
| Code | Message | Notes |
|---|---|---|
| -32001 | unauthorized | Missing or non-Bearer Authorization (HTTP 401). |
| -32001 | invalid_api_key | Revoked or unknown key (HTTP 401). |
| -32003 | forbidden |
Missing action scope or fleet not in the key grant list. Check error.data.message:
insufficient_scope
or fleet_not_allowed.
|
| -32004 | fleet_not_found | No matching fleet in the key organization. |
| -32005 | imported_readonly | Mutating call on an imported fleet. |
| -32006 | fleet_not_live | Member add when fleet is not live. |
| -32007 | cap_exceeded | Member cap reached. |
| -32008 | member_not_found | No matching member in the key organization. |
| -32009 | fleet_not_deployed | Destroy before deployment finished. |
| -32010 | invalid_fleet_state | Destroy not valid for current state. |
| -32011 | nothing_to_unstake | The fleet has no balance to unstake. |
| -32012 | registry_unavailable |
Registry read failed; data.reason
may be present.
|
| -32601 | method_not_found |
data.method echoes the unknown name.
|
| -32600 | invalid_request | Malformed JSON-RPC object; empty batch uses HTTP 400. |
| -32700 | invalid_request | Unparsed body or wrong top-level shape. |
| -32602 | invalid_params |
Bad UUID, missing fields, or validation;
data
may list field errors.
|
| -32603 | internal_error | Unexpected failure during destroy handling. |