Features
gRPC API
Requires a license with the
grpcfeature. See pricing.
The gRPC API serves your content types and entries to gRPC clients on a port
of its own, with the same data, tenants, roles and data residency rules as the
REST APIs. A second port answers health checks and offers every method as a
plain JSON route, which is handy with curl. It adds no features over REST: it
carries the same calls over HTTP/2.
In the console
Link to the section In the consoleAs a super admin, open Delivery > gRPC. A badge says whether the gRPC API is Serving. Listeners gives the gRPC address, with a button to copy it, the Health and REST address and whether Reflection is on. On the default addresses it notes that the listeners are on loopback only. Services lists each service with what its health check reports, and REST, without a gRPC client lists the JSON routes. Refresh reads the status again.

How it works
Link to the section How it works| Listener | Variable | Default | Serves |
|---|---|---|---|
| gRPC | GRPC_ADDR | 127.0.0.1:3003 | SchemaService, ContentService, FlowService, gRPC health, and reflection outside production |
| Health and JSON | GRPC_HEALTH_ADDR | 127.0.0.1:3004 | /healthz, and every method as a JSON route under /api/ |
Both are separate from the Admin API (3001) and the Content API (3002).
Both default to loopback, so nothing outside the container reaches them until
you change the address. The gRPC listener is plaintext HTTP/2: put TLS in front
of it as you do for the Content API. The
Kubernetes deployment shows the container
ports and Service entries.
For the console steps, you are signed in to LyEve Console as a super
admin. For the API steps, you need a signed-in user's token in TOKEN. The
quickstart shows how to get one.
1. Open both listeners. This is set in the environment of the instance, not in the console or the API. Publish the ports (the engine image exposes 3003 and 3004), then restart:
GRPC_ADDR=0.0.0.0:3003GRPC_HEALTH_ADDR=0.0.0.0:30042. Check health.
Console v0.28.0
Open Delivery > gRPC. The badge reads Serving, Listeners gives the two addresses, and Services lists each service with what its health check says.
Engine API v0.62.0
The health route needs no token:
curl http://localhost:3004/healthz{"status": "SERVING", "services": {"": "SERVING", "lyeve.core.v1.ContentService": "SERVING", "lyeve.core.v1.SchemaService": "SERVING"}}3. List entries of a content type through the JSON route.
Console v0.28.0
Open Delivery > API labs and choose gRPC. Under Transcoded route,
pick GET /api/content/{schema}, type post in schema and choose
Run. The console runs the route inside the engine with your own token.
Engine API v0.62.0
curl http://localhost:3004/api/content/post \ -H "Authorization: Bearer $TOKEN"{"items": [{"id": "c8a14e2b-7d3f-4b90-a1c6-5e8f0d2b9a74", "title": "Hello"}]}4. Call the gRPC listener itself. Only a gRPC client does this.
grpcurl reads the services through reflection, which needs a token, so pass
one even for the health service:
grpcurl -plaintext -H "authorization: Bearer $TOKEN" \ localhost:3003 grpc.health.v1.Health/CheckThe answer is {"status": "SERVING"}. On engine v0.58.0, grpcurl list and
grpcurl describe read every LyEve service, but grpcurl cannot call them,
because the services take JSON messages and grpcurl sends binary ones. Call
them from a client that sends JSON messages, as
Call the services describes. In Go:
type jsonCodec struct{}
func (jsonCodec) Marshal(v any) ([]byte, error) { return json.Marshal(v) }func (jsonCodec) Unmarshal(b []byte, v any) error { return json.Unmarshal(b, v) }func (jsonCodec) Name() string { return "json" }
func listSchemas(token string) (json.RawMessage, error) { encoding.RegisterCodec(jsonCodec{}) conn, err := grpc.NewClient("localhost:3003", grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return nil, err } defer conn.Close() ctx := metadata.AppendToOutgoingContext(context.Background(), "authorization", "Bearer "+token) var out json.RawMessage err = conn.Invoke(ctx, "/lyeve.core.v1.SchemaService/ListSchemas", json.RawMessage(`{}`), &out, grpc.CallContentSubtype("json")) return out, err}The answer lists your content types as schemas, each with name and
definition. Without a token, the call fails with Unauthenticated.
Call the services
Link to the section Call the services| Service | Methods | Role |
|---|---|---|
lyeve.core.v1.SchemaService | ListSchemas, GetSchema | viewer, editor or admin |
lyeve.core.v1.ContentService | List, Get | viewer, editor or admin |
lyeve.core.v1.ContentService | Create, Update, Delete | editor or admin |
lyeve.core.v1.FlowService | Run, List | any signed-in user, and the flow's own auth setting |
grpc.health.v1.Health | Check, Watch | none |
grpc.reflection.v1.ServerReflection | a token, and only outside production. On engine v0.58.0 it lists and describes each service. |
A super admin may call every method. The services are defined in
lyeve/core/v1/schema.proto, lyeve/core/v1/content.proto and
lyeve/core/v1/flow.proto, package lyeve.core.v1.
Messages travel as JSON, so you can call the services without generated message
types: use the json content subtype, which sends
Content-Type: application/grpc+json. In Go, pass
grpc.CallContentSubtype("json"). In the .proto files, definition,
items, item, data, filters, input and input_schema are
google.protobuf.Struct fields, and the body of a flow run is a
google.protobuf.Value. On the wire each key is the field's own name, and its
value is a JSON object, or any JSON value for body, never an encoded string.
| Method | Request | Answer |
|---|---|---|
ContentService.List | schema, limit (default 50, 1 to 500), offset, filters (equality on known fields), locale, fields, populate, depth | items |
ContentService.Get | schema, id, locale, fields, populate, depth | item |
ContentService.Create | schema, data | item |
ContentService.Update | schema, id, data | item |
ContentService.Delete | schema, id | empty |
SchemaService.ListSchemas | none | schemas, each name and definition |
SchemaService.GetSchema | name | name and definition |
FlowService.Run | slug, input | run_id, status, headers, body |
FlowService.List | none | flows, each slug, name, description, auth and input_schema |
On content types that use soft delete, List and Get leave deleted entries
out, and Delete soft-deletes.
A content type's transports block decides what gRPC serves:
| Case | Answer |
|---|---|
The content type is off for gRPC | NOT_FOUND, the answer a missing content type gets, and ListSchemas leaves it out |
It is served, but not in this direction (r refuses writes, w refuses reads) | FAILED_PRECONDITION |
See Transports.
Choose fields and related entries
Link to the section Choose fields and related entriesList and Get take the read options the Content API takes:
fieldskeeps only the named fields of each entry.id,created_at,updated_atandresolved_localestay whatever you name, and a belongs-to relation keeps its key column and its entry together. A name the content type does not have, or one you may not read, answersINVALID_ARGUMENT.populateserves a relation as the entries it points at: a belongs-to or has-one relation as an entry ornull, a has-many or many-to-many relation as a list, newest first.author.companyreaches a relation of the related entry,*populates every relation at its level, andauthor{name}keeps only the named fields of each related entry. A name that is not a relation is skipped.depthpopulates every relation, to that many levels, from 0 to 10.filters, onList, keeps the entries whose fields equal the values you give. A value written as text is read by its field's type:trueorfalse, a number, a UUID with its dashes, a date written2006-01-02, or a time in RFC 3339. A value its field cannot hold, and a filter on a JSON field, answerINVALID_ARGUMENT. A field name the content type does not have is ignored, so check the spelling.
A related entry is what a read of its own content type gives you: from your tenant, not deleted, with that type's field rules, and a draft only when you may read drafts there. A has-one relation serves the newest entry you may read. A relation into a content type you may not read, or one gRPC does not read, is left out of the entry. So is a has-one or has-many relation whose related entries hide the field that links them to this one from you.
A read has three bounds, and past one it answers INVALID_ARGUMENT: 5000
related entries, counting an entry once under each entry it is served
under, 32 MiB of them, and 1000 database queries. A request to List that
keeps two fields of each post and serves its author's name and its tags:
{ "schema": "post", "fields": ["title", "author"], "populate": ["author{name}", "tags"]}Send it from a JSON client as in Try it, to
/lyeve.core.v1.ContentService/List.
Authenticate
Link to the section AuthenticateSend a signed-in user's session token in the authorization metadata on gRPC,
or the Authorization header on the JSON routes. API keys are not accepted
here, and neither is a sign-in that still waits for its second factor. Only the
health service and /healthz answer without a token. The token's tenant_id
claim decides the tenant, never a header the client sends. See
Tenants.
Every call is rate limited, authenticated, scoped to its tenant and checked for data residency before it runs.
Use the JSON routes
Link to the section Use the JSON routesThe health and JSON listener offers the same calls for clients without gRPC:
JSON routes on GRPC_HEALTH_ADDR
| Method | Path | Same as |
|---|---|---|
GET | /healthz | Health summary. ?service=<name> checks one service. No token needed. |
GET | /api/schemas | SchemaService.ListSchemas |
GET | /api/schemas/{name} | SchemaService.GetSchema |
GET | /api/content/{schema} | ContentService.List. Takes limit, offset, locale, filters[<field>], fields, populate and depth. |
GET | /api/content/{schema}/{id} | ContentService.Get. Takes locale, fields, populate and depth. |
POST | /api/content/{schema} | ContentService.Create. Answers 201. |
PUT | /api/content/{schema}/{id} | ContentService.Update |
DELETE | /api/content/{schema}/{id} | ContentService.Delete. Answers {"deleted": "<id>"}. |
GET | /api/flows | FlowService.List |
POST | /api/flows/{slug} | FlowService.Run. The body is the input. |
GET / redirects to /healthz.
On these routes the whole body is the entry, while the Content API on 3002
takes {"data": {...}}. Sending that envelope here creates an entry with one
field named data:
curl -X POST http://localhost:3004/api/content/post \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"title": "From gRPC JSON", "slug": "from-grpc-json"}'The answer is 201 with {"item": {...}}. A body is at most 1 MB, and one
that is not JSON answers 400 with {"error": "invalid JSON body"}.
The read options go in the query string, fields and populate as comma
lists, and a comma inside a projection's braces stays in its path:
curl "http://localhost:3004/api/content/post?fields=title,author&populate=author%7Bid,name%7D&filters%5Bfeatured%5D=true" \ -H "Authorization: Bearer $TOKEN"A filters key without its closing bracket, an empty name in fields, two
values for one filter, a brace in populate left open or closed without
opening, or a limit, offset or depth that is not a whole number
answers 400 with {"error": "invalid query parameter: <name>"}.
Run flows
Link to the section Run flowsWhen flows run beside gRPC, FlowService.Run starts a published
flow of the caller's tenant whose HTTP trigger lists grpc in protocols,
with input as the trigger body:
{"slug": "order-totals", "input": {"order": 7}}Send it from a JSON client as in Try it, to
/lyeve.core.v1.FlowService/Run. The same run is
POST /api/flows/order-totals on the JSON listener, with the input as the
body. In the console, open Delivery > API labs, choose gRPC, pick
POST /api/flows/{slug} under Transcoded route, fill in the slug and the
body, and choose Run. The console asks first, and Run it starts the
flow.
The answer carries the run id (empty when the flow's cache answered), the
status the flow set or 200, its headers and the body. The flow's auth
setting decides who may run it: public and auth flows answer, and admin
flows answer NOT_FOUND. Its rate limit and cache count gRPC callers apart
from REST and GraphQL callers.
| Code | Meaning |
|---|---|
NOT_FOUND | No published flow has that slug for this protocol and caller. |
PERMISSION_DENIED | The license does not carry flow-pro, which starting a flow over gRPC needs. |
RESOURCE_EXHAUSTED | The flow's rate limit refused the call. |
ABORTED | The call would nest flows too deep. |
UNAVAILABLE | The flow could not run. |
UNIMPLEMENTED | Flows are not available on this instance. The JSON routes answer 501. |
Admin routes
Link to the section Admin routesBoth need a super admin and live on the Admin API. The console's Delivery > gRPC page reads the status route, and API labs runs routes through the invoke route.
| Method | Path | Purpose |
|---|---|---|
GET | /api/admin/grpc/status | The listeners, their services, what health reports and the JSON routes. |
POST | /api/admin/grpc/invoke | Run one JSON route inside the engine with your own token and return its answer. |
curl -X POST http://localhost:3001/api/admin/grpc/invoke \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{"route": "GET /api/content/{schema}", "params": {"schema": "post"}}'route is one of the JSON routes, written as in the table. params fills its
{name} parts and body is sent on a write. The answer carries the status,
duration_ms, headers and body.
Settings
Link to the section Settings| Variable | What it does | Default |
|---|---|---|
GRPC_ADDR | Address of the gRPC listener | 127.0.0.1:3003 |
GRPC_HEALTH_ADDR | Address of the health and JSON listener | 127.0.0.1:3004 |
GRPC_RATE_LIMIT | Calls a second per gRPC method, shared by every caller. Only a positive number is taken, so the limit cannot be turned off. | 100 |
GRPC_RATE_BURST | Burst per gRPC method | 200 |
JWT_SECRET, JWT_SECRETS | The secrets tokens are checked against. Without one, every call except health is refused. | none |
APP_ENV | Outside production, server reflection is served. Nothing else changes. | production |
INSTANCE_REGION | With data residency, writes from a tenant assigned to another region are refused. | empty, so off |
A gRPC request is at most 4 MiB, and a larger one is refused with
RESOURCE_EXHAUSTED before it is read. A response is at most 32 MiB. Calls in
flight get up to 10 seconds to finish on shutdown. If you set LYEVE_PLUGINS to choose which
features start, include grpc. See
Licensing and tiers.
On the JSON routes, gRPC codes map to HTTP statuses.
| gRPC code | HTTP | Cause |
|---|---|---|
UNAUTHENTICATED | 401 | No token, a token that does not verify, or no JWT secret configured. |
PERMISSION_DENIED | 403 | The caller's role does not allow it, or FlowService without flow-pro. |
INVALID_ARGUMENT | 400 | A malformed request. |
NOT_FOUND | 404 | No such content type or entry. |
ALREADY_EXISTS | 409 | A conflicting entry. |
RESOURCE_EXHAUSTED | 429 | rate limit exceeded. Slow down or raise GRPC_RATE_LIMIT. |
FAILED_PRECONDITION | 421 | A write from a tenant that belongs in another region. The JSON answer is {"error": "write routed to wrong region", "target_region": "<slug>"}. |
FAILED_PRECONDITION | 400 | A content type served over gRPC in the other direction only. The JSON answer's error says the content type is read-only or write-only over gRPC. |
DEADLINE_EXCEEDED | 504 | The call ran out of time. |
UNAVAILABLE | 503 | The tenant's region could not be read, or the database did not answer. |
Related
Link to the section Related- GraphQL API: the same content for frontends that pick their fields.
- API endpoints: the REST routes and the transports block.
- Validate tokens with JWKS: check LyEve tokens in your own services.
- Flows: the flows
FlowService.Runstarts.