Skip to main content
Device RPC uses the RPC host for invoke, stream, and enqueue, plus the management API on api.ilyama.golain.io. Set these before running the examples:
Invoke, stream, and enqueue use the RPC host (https://rpc.ilyama.golain.io). Management routes stay on https://api.ilyama.golain.io/core/api/v1/....
Management responses use the envelope "ok": 1 with a data object. Invoke success returns Connect JSON for the protobuf response message. Invoke errors return { "ok": false, "message": "…" }.

Authentication

Every route requires: Invoke and enqueue also require Content-Type: application/json and Connect-Protocol-Version: 1.

Permissions

Rate limits

Back off on 429, 502, and 503.

List device services

Permission: can_invoke_rpc
Response data fields: services is empty when no schema is bound yet. Example:

Reflect device schema

Permission: can_write_device_metadata Forces the platform to reflect gRPC services from the device (when online), register the descriptor if new, and bind the device. Skips the device round-trip when the digest is already cached for the project. Request body: {}
Response data fields:

Get project descriptor

Permission: Standard project read auth Fetches raw descriptor bytes for codegen or inspection. The digest must exist in the project registry.
URL-encode the digest in the path (for example sha256:sha256%3A). Response data fields: You do not need this endpoint for basic invoke — the proxy loads descriptors automatically.

List invocation audit trail

Permission: can_invoke_rpc Query parameters: page (default 1), limit (default 50). Pass the same session_id you used as ?session_id= on invoke calls.
Response: ok: 1, data.items[], and pagination meta (page, limit, total). Each item: Raw request and response bodies are never stored.

Get queued call status

Permission: can_invoke_rpc Poll after enqueue. Uses the management API on api.ilyama.golain.io, not the RPC host.
Response data fields: → Step-by-step guide: Queued invoke

Sync invoke

Permission: can_invoke_rpc Query: optional session_id (UUID) for audit grouping. Headers: Authorization, ORG-ID, Content-Type: application/json, Connect-Protocol-Version: 1 Body: JSON object matching the protobuf request message.
Success: JSON matching the protobuf response message (Connect JSON). Echo example:
Errors: { "ok": false, "message": "…" } with HTTP 4xx/5xx. → Caller guide: Invoking methods

Server stream (SSE)

Permission: can_invoke_rpc Query: optional session_id (UUID) for audit grouping. Headers: Authorization, ORG-ID, Content-Type: application/json, Accept: text/event-stream Body: JSON object matching the protobuf request message (same as unary).
Success: text/event-stream with SSE events: Errors: JSON { "ok": false, "message": "…" } with HTTP 4xx/5xx before the stream opens, or an error SSE event mid-stream. Only methods with method_type: "server_stream" belong on this path. Unary methods on /streams/ return 501 only server-streaming rpc supported. Server-stream methods on the sync path return 501 streaming rpc not supported. → Caller guide: Invoking methods — Stream a method (SSE)

Enqueue (async invoke)

Permission: can_invoke_rpc Query: optional ttl_seconds — default 900, clamped 6086400. Headers: same as sync invoke; add Idempotency-Key when retrying the same enqueue.
Response (202 Accepted) — flat envelope, not nested under data:
Poll completion with GET …/rpc/queued/{call_id} on the management API.
Queued delivery is at-least-once. Device handlers must be idempotent — see Queued invoke.
→ Full guide: Queued invoke

OpenAPI playground

These management routes appear in the API Reference tab under Device RPC:
  • GET /projects/{project_id}/devices/{device_id}/rpc/services
  • POST /projects/{project_id}/devices/{device_id}/rpc/reflect
  • GET /projects/{project_id}/devices/{device_id}/rpc/sessions/{session_id}/invocations
  • GET /projects/{project_id}/devices/{device_id}/rpc/queued/{call_id}
  • GET /projects/{project_id}/rpc/descriptors/{digest}
Open the playground from API introduction. Sync invoke, server-stream SSE, and enqueue proxies are documented here — they are not in the OpenAPI spec. Use curl or a Connect client against the RPC host (https://rpc.ilyama.golain.io).