Daemon API
The daemon serves its API over Connect, which speaks three protocols on one endpoint: Connect's own browser-native HTTP, gRPC, and gRPC-Web. Anything that can send an HTTP request can call it, so a generated client is optional.
This reference is generated from the .proto contract, so it cannot drift from what the daemon serves. The Console is a reference frontend and has no privileged access to the API. A frontend you build can use the same published contract. Every service, method, message, and enum heading below links to the exact line in the .proto source that defines it.
Before you call anything
Start the daemon with magus server start. See the console reference for the endpoint and port, and the auth diagnostics for what a rejected token means. Requests carry a hashed, expiring mgs_ bearer token.
Services
| Service | Methods | Package |
|---|---|---|
| ActivityService | 2 | magus.activity.v1alpha1 |
| GraphService | 7 | magus.graph.v1alpha1 |
| InsightService | 1 | magus.insight.v1alpha1 |
| JobService | 2 | magus.job.v1alpha1 |
| MemoryService | 5 | magus.memory.v1alpha1 |
| MetricsService | 2 | magus.metrics.v1alpha1 |
| NotesService | 2 | magus.notes.v1alpha1 |
| StatusService | 2 | magus.status.v1alpha1 |
| TokenService | 3 | magus.token.v1alpha1 |
| ToolService | 1 | magus.tool.v1alpha1 |
| ViewerService | 7 | magus.viewer.v1alpha1 |
Shared types
A package with no service of its own: its types are documented here instead of on a service page, and a service that uses one links to it.
| Package | File |
|---|---|
| magus.query.v1alpha1 | proto/magus/query/v1alpha1/query.proto |
Calling a method without a generated client
A unary Connect method is a plain POST with a JSON body, so curl is a complete client. protojson, not the .proto field name, decides the wire shape:
- Field names are lowerCamelCase (
page_sizein the tables below ispageSizeon the wire). int64,uint64,fixed64, andsfixed64values are JSON strings, not numbers (large values overflow a JSON number's safe integer range).bytesis base64. ATimestampis an RFC 3339 string; aDurationis a string like"1.5s".- An enum serializes as its value name (
"TOKEN_SCOPE_CONNECTOR"), not its number.
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MAGUS_TOKEN" \
-d '{"pageSize":0,"pageToken":""}' \
http://127.0.0.1:7391/magus.activity.v1alpha1.ActivityService/ListActivityEvents
The path is always /<package>.<Service>/<Method>, which every page below states per method. A request body shown as {} takes no fields; a longer one is a shallow skeleton (top-level scalar and enum fields only) and does not attempt to satisfy every field's constraints - a string.pattern rule still needs a value matching that pattern.
Streaming methods
A server-streaming method returns a sequence of messages over one HTTP response rather than one body, so a single curl -d request cannot cleanly demux it. Use a generated Connect client, or a tool built for streaming RPCs such as grpcurl (grpcurl -plaintext ... /magus.metrics.v1alpha1.MetricsService/StreamMetrics). Streaming methods:
- MetricsService.StreamMetrics (server streaming)
- StatusService.StreamStatus (server streaming)
- ViewerService.StreamEvents (server streaming)