Authentication
Mint a token from /app/account (the API tokens panel). The plaintext is shown once — copy it then; the server
stores only a SHA-256 hash and you can't view it again. If you lose it, revoke
and create a new one.
Pass the token on every request:
Authorization: Bearer stwd_pat_<your-token>
Tokens are user-scoped: a token acts as the user who minted it. Revoking the
user's account revokes all their tokens via FK cascade.
RPCs
All RPCs are POST to https://steward-dev.ai/api/<service>.<Service>/<Method> with JSON bodies. Four read-only RPCs ship today.
MeService.Get — requires account:read
Returns the token owner's identity (login, email, avatar) plus a
permissions map for FE-relevant capability flags. Use this to validate
a token + discover what surfaces the user can reach before calling the
data RPCs.
curl -X POST https://steward-dev.ai/api/steward.api.v1.MeService/Get \
-H "Authorization: Bearer stwd_pat_..." \
-H "Content-Type: application/json" \
-d '{}'
ClaService.Get — requires cla:read
Returns the CLA configuration and signature state for a repo. Use this
to gate a PR check from a third-party CI runner.
curl -X POST https://steward-dev.ai/api/steward.api.v1.ClaService/Get \
-H "Authorization: Bearer stwd_pat_..." \
-H "Content-Type: application/json" \
-d '{"repo_id": "<repo-uuid>"}'
EvaluationsService.Get — requires evaluations:read
Returns one evaluation job by id, including the report JSON + markdown.
Use this to poll an evaluation triggered by a webhook.
curl -X POST https://steward-dev.ai/api/steward.api.v1.EvaluationsService/Get \
-H "Authorization: Bearer stwd_pat_..." \
-H "Content-Type: application/json" \
-d '{"id": "<evaluation-uuid>"}'
GovernanceService.GetSections — requires repos:read
Returns the parsed top-level sections of a repo's .steward/governance.pxf. Use this
to read policy without parsing the raw file yourself. For files that
extend a preset,
the response also carries the resolution: preset (the version pin), resolved_sections (the EFFECTIVE
config the judge actually runs, section by section), overridden_sections (which
top-level sections the repo's own file populates), available_presets, and resolve_error (the loader's
message when the file wouldn't load). Integrators reading policy
should consume resolved_sections — the raw sections of a
preset-pinned file are just the overrides.
curl -X POST https://steward-dev.ai/api/steward.api.v1.GovernanceService/GetSections \
-H "Authorization: Bearer stwd_pat_..." \
-H "Content-Type: application/json" \
-d '{"repo_id": "<repo-uuid>"}'
GovernanceService.PreviewPresetChange — requires repos:read
Read-only what-if: resolves the repo's current governance file as if its
preset pin were the candidate you pass (one of available_presets from
GetSections). Returns the candidate's resolved_sections in the same
shape, so you can diff effective policy across preset versions without
writing anything. Unknown candidates come back in resolve_error, not as a
transport error.
curl -X POST https://steward-dev.ai/api/steward.api.v1.GovernanceService/PreviewPresetChange \
-H "Authorization: Bearer stwd_pat_..." \
-H "Content-Type: application/json" \
-d '{"repo_id": "<repo-uuid>", "preset": "welcoming/v2"}'
Write RPCs
Token auth is read-only by design. CreateEvaluation,
GovernanceUpdateSection, and the other write RPCs require an interactive
browser session because each one intersects with the user's monthly credit
budget — a token-driven write loop could burn a user's quota faster than
their dashboard can warn them. Drive writes from the /app surface; reach
for an API token when a CI runner needs to poll status from outside the
browser.
Outbound webhooks (Steward pushing events to your service) are not
implemented — poll the read RPCs at your cadence. OpenAPI / gRPC reflection
isn't published; the curl examples above + this scope table are the
contract.