Skip to main content

API Specs

CLI equivalents of Admin Tasks → API Specs. Both commands are admin-only, same as the API Specs tab.

Note: These commands need sudodocs-cli 1.1.0 or later. Upgrade with pip install --upgrade sudodocs-cli.

Show the Current Settings​

sudodocs admin api-specs get

Prints the source repository, branch, spec paths, API style rules, and whether your Knowledge Base writing style is applied. Saved repository tokens are never shown.

Change the Settings​

sudodocs admin api-specs set --integration-id 42 --spec-path src/openapi.yaml --ruleset recommended

Options you leave out keep their current value, so you can change one thing at a time:

sudodocs admin api-specs set --branch release/2.0
sudodocs admin api-specs set --ruleset custom --ruleset-path .redocly.yaml
OptionDescription
--integration-idUse a connected repository. Find its ID with sudodocs admin integrations list. Recommended - its token or GitHub App access is reused.
--repo-urlUse another public repository by URL instead.
--branchBranch to scan. Defaults to main.
--spec-pathPath to the main spec, for example src/openapi.yaml.
--other-specsOther spec files, comma-separated. Each is validated on its own.
--ref-foldersFolders the spec references with $ref, comma-separated.
--base-url-domainOverrides the base URL in the final spec.
--rulesetrecommended, recommended-strict, minimal, spec (OpenAPI compliance only), or custom. See Choose the Style Rules.
--ruleset-pathPath to your redocly.yaml in the repository. Required with --ruleset custom.
--writing-style / --no-writing-styleApply your Knowledge Base style guide to summaries and descriptions.

Headless API​

EndpointMethodPurpose
/admin/api-specsGETCurrent settings, without secrets. Wrapped by sudodocs admin api-specs get.
/admin/api-specsPOSTAny of integration_id, git_repo_url, git_branch, spec_file_path, secondary_spec_paths, reference_folder_paths, base_url_domain, api_ruleset, api_ruleset_path, apply_writing_style. Fields left out keep their value. Wrapped by sudodocs admin api-specs set.