The OpenAPI 3.0 description of the Phrase Studio public API (/v1/..., the endpoints of studio-api under
src/controllers/external/v1/).
Merging a change to schemas/projects.json on main publishes it: a workflow opens, approves and merges a pull
request in developer-hub, which renders the API reference. There is no manual review of that copy, so the checks
below are what keeps the published spec correct.
spec/
├── openapi.json root: info, servers, tags, and a reference to every path and schema
├── paths/ one file per URL path, with all its methods
└── schemas/ one file per reusable schema (Project, Recording, Pagination, ErrorResponse, ...)
schemas/projects.json GENERATED by `npm run bundle` from spec/. Never edit it by hand.
scripts/ bundler and rule checks, with tests
redocly.yaml lint configuration
schemas/projects.json stays committed because the developer hub copies that exact file.
npm ci # once
npm run bundle # spec/ -> schemas/projects.json
npm run lint # Redocly lint plus the Studio rules (below) on the bundled file
npm test # tests of the rule scripts, and the published spec against the rules
npm run validate # bundle, lint and test, what CI runs- Edit or add files under
spec/. A new URL path is a new file inspec/paths/plus one line inspec/openapi.json. Reuse the shared schemas through$ref(relative to the file:../schemas/Project.jsonfrom a path file,./Recording.jsonfrom a schema file). A new schema is a file inspec/schemas/plus one line undercomponents.schemasinspec/openapi.json. - Run
npm run validateand commitschemas/projects.jsontogether with the source.
Change the spec in the same pull request as the endpoint it describes.
CI fails the pull request when one of these is broken (scripts/check-spec-rules.mjs, plus Redocly's own rules):
- Every operation has
summary,description, a camelCaseoperationId,tagsandsecurity, a success or redirect response, a 4xx response and a401. - Every parameter, response and schema property has a
description. - Every success response has an example.
- Security schemes have a
description. - Account, organization, identity and owner fields (
accountId,organizationId,owner,username, ...) appear in no schema and no example: callers must never receive them, so the spec must not promise them. schemas/projects.jsonequals the bundle ofspec/.
Write descriptions for people and for AI agents alike: say what a call does, what it costs or changes, which values are allowed, and who may call it. Do not rely on a reader knowing Studio.
npx redocly build-docs schemas/projects.json --output /tmp/studio-api.html
open /tmp/studio-api.html