Skip to content

API surface (gRPC + REST)

runed exposes its API over two transports:

  • gRPC on :7863 — the primary surface. Used by the CLI and ideal for automation.
  • REST on :7861 — auto-generated gateway over the same RPCs. Use when gRPC isn’t an option.

Both paths share the same auth, RBAC, and validation interceptors.

Every request (except AdminBootstrap) requires a bearer token:

Authorization: Bearer <token>

In gRPC, set the metadata key authorization. In REST, send the header.

The server exposes one gRPC service per resource group, all under the rune.api package:

gRPC serviceResourceREST base path
NamespaceServicenamespaces/v1/namespaces
ServiceServiceservices/v1/namespaces/{ns}/services
InstanceServiceinstances/v1/namespaces/{ns}/instances
LogServicelogs (streaming)/v1/namespaces/{ns}/logs
ExecServiceexec (streaming)/v1/namespaces/{ns}/exec
HealthServicehealth/v1/namespaces/{ns}/health
SecretServicesecrets/v1/namespaces/{ns}/secrets
ConfigmapServiceconfigmaps/v1/namespaces/{ns}/configmaps
AuthServicetokens, whoami/v1/auth
AdminServicebootstrap, users, policies, registries/v1/admin

Each service follows the standard CRUD pattern (Get, List, Create, Update, Delete) where applicable, plus streaming RPCs for logs, exec, and watch.

Source of truth: pkg/api/proto/ in the repo. Highlights:

Generated Go code lives in pkg/api/generated/.

The REST gateway follows gRPC-Gateway conventions:

  • GET /v1/.../{name}Get*
  • GET /v1/.../List*
  • POST /v1/.../Create*
  • PUT /v1/.../{name}Update*
  • DELETE /v1/.../{name}Delete*

Streaming RPCs are exposed as Server-Sent Events:

GET /v1/namespaces/default/logs/api?follow=true

Standard gRPC status codes:

CodeWhen
OKSuccess.
UnauthenticatedMissing / invalid bearer token.
PermissionDeniedToken valid, policy denies.
NotFoundResource doesn’t exist.
AlreadyExistsConflicts with an existing resource.
InvalidArgumentSchema or validation error.
FailedPreconditionState doesn’t allow the operation (e.g., delete in use).
InternalServer-side error. Check runed logs.

REST maps these to HTTP status codes (401, 403, 404, 409, 400, 412, 500).

For Go consumers, use the generated code:

import "github.com/runestack/rune/pkg/api/generated"
import "google.golang.org/grpc"
conn, _ := grpc.Dial("runed.example.com:7863", grpc.WithTransportCredentials(...))
client := generated.NewServiceServiceClient(conn)

For other languages, run protoc against pkg/api/proto/ with your language’s plugin.

  • OpenAPI / Swagger spec for the REST gateway — not generated today. Tracked.
  • Watch streams with ordered, resumable cursors — RUNE-027.
  • mTLS — RUNE-028.