Limited offer 50% off on your first year, for new customers. Applied automatically at checkout. See pricing

API

Let agents work in your backend

Every resource in your admin is also available as a JSON:API. Hand it to a coding agent, and let it look up, create and update records for you, following the same rules as your admin.

Why you'll love it

Made for coding agents
Claude Code, Codex, Cursor and other coding agents can look up, create and update records with plain HTTP requests. Ask for a change in your own words, and the agent makes it in your backend.
Every repository, no extra code
Every repository you have set up for the admin is also available at /uchi/api, using the same fields. There's nothing extra to write or keep in sync.
The same rules as your admin
The API is protected by the same authentication as your admin, or by tokens if you prefer. Records are saved through ActiveRecord, so your validations run, and errors point to the attribute that caused them.
A well-known standard
The API follows the JSON:API specification, with pagination, search, sorting and sparse fieldsets. Agents, scripts and client libraries already know how to talk to it.

How the API works

Every repository is served at /uchi/api/:resource and follows the JSON:API specification. Records are built from the repository's fields: associations become relationships, and everything else becomes attributes.

Lists are paginated, searched with filter[search], sorted with sort and trimmed to the fields you ask for with fields, all as the specification describes. Creating and updating records only accepts the fields from your forms, and validation errors point to the attribute that caused them. The API documentation lists every endpoint and status code.

Implementation

Your repositories are already an API

The API comes with Uchi 0.5.0 and uses the repositories you already have. It shares the admin's authentication by default. To give a coding agent its own access, define Uchi::Api::ApplicationController and authenticate requests with a token.

Dig deeper

Everything you need to know, in the documentation.

Ready to build an awesome admin for your app?