Style guides
Generated from apiome-rest/openapi.yaml (API version 1.719.0) — do not edit by hand. How to authenticate is on the REST API reference.
Tag: style-guides · 23 operations
GET /v1/style-guides/{tenant_slug}
List Style Guides
List the tenant's style guides with list-view rollups (rules on, assignments).
Builtin guide first, then by name; one page of at most limit guides (1,000 at most).
Pass the page's nextCursor as cursor while hasMore is true (#7196).
Args:
tenant_slug: The tenant in the URL.
limit: Page size.
cursor: Where the page starts (nextCursor of the previous page).
auth_data: The authenticated principal.
Returns: The page of guides and whether another follows.
Raises: HTTPException: 400 for a malformed cursor.
Operation id: list_style_guides_v1_style_guides__tenant_slug__get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
limit | query | integer | no | Page size. At most 1000. |
cursor | query | string or null | no | Opaque cursor from the previous page (next_cursor, or the X-Next-Cursor header). Omit for the first page. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list style guides. | application/json StyleGuideListResponse |
| 422 | Validation Error | application/json HTTPValidationError |
POST /v1/style-guides/{tenant_slug}
Create Style Guide
Create a custom guide; sourceGuideId copies that guide's rules (duplicate).
Operation id: create_style_guide_v1_style_guides__tenant_slug__post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for create style guide.
application/json—StyleGuideCreateRequest
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for create style guide. | application/json StyleGuideOut |
| 422 | Validation Error | application/json HTTPValidationError |
DELETE /v1/style-guides/{tenant_slug}/assignments/projects/{project_id}
Unassign Project
Remove a project's guide assignment; it falls back to the tenant default.
Operation id: unassign_project_v1_style_guides__tenant_slug__assignments_projects__project_id__delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
project_id | path | string | yes | Project identifier that scopes the request. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for unassign project. | application/json map of string |
| 422 | Validation Error | application/json HTTPValidationError |
POST /v1/style-guides/{tenant_slug}/import
Import Style Guide
Create a custom guide from an apiome.style-guide export document (#1747).
The document comes from content (a paste or an uploaded file's text) or url
(fetched through the SSRF guard). It is validated in full before anything is written, so
a malformed document creates nothing. Built-in rule ids this instance does not register
are reported in skipped rather than failing the import. name overrides the
document's guide.name — use it to import next to an existing guide of the same name.
Operation id: import_style_guide_v1_style_guides__tenant_slug__import_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for import style guide.
application/json—StyleGuideImportRequest
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for import style guide. | application/json StyleGuideImportResponse |
| 400 | The url could not be fetched or was blocked by the SSRF guard. | — |
| 409 | A guide with the resulting name already exists (detail.code). | — |
| 422 | Malformed document: detail.message explains the problem and detail.pointer points at the offending node. | — |
PATCH /v1/style-guides/{tenant_slug}/{guide_id}
Update Style Guide
Rename / re-describe a custom guide (the builtin guide is read-only).
Operation id: update_style_guide_v1_style_guides__tenant_slug___guide_id__patch
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for update style guide.
application/json—StyleGuideUpdateRequest
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for update style guide. | application/json StyleGuideOut |
| 422 | Validation Error | application/json HTTPValidationError |
DELETE /v1/style-guides/{tenant_slug}/{guide_id}
Delete Style Guide
Delete a custom guide; its assignments cascade and the affected projects fall back to the tenant default. Deleting the current default promotes the builtin guide.
Operation id: delete_style_guide_v1_style_guides__tenant_slug___guide_id__delete
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for delete style guide. | application/json map of string |
| 422 | Validation Error | application/json HTTPValidationError |
PUT /v1/style-guides/{tenant_slug}/{guide_id}/assignments/projects/{project_id}
Assign Project
Assign a guide to one project (replaces the project's previous assignment).
A project-level assignment wins over the tenant default in the GOV-1.4 resolution order, so the project's next lint run scores under this guide.
Operation id: assign_project_v1_style_guides__tenant_slug___guide_id__assignments_projects__project_id__put
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
project_id | path | string | yes | Project identifier that scopes the request. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for assign project. | application/json map of string |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/custom-rules
Get Style Guide Custom Rules
The guide's custom-rules YAML document (GOV-2.3, #4435).
Returns the Spectral-compatible YAML the custom-rules tab edits. Readable by any tenant member — the tab renders read-only for non-admins and the built-in guide.
Operation id: get_style_guide_custom_rules_v1_style_guides__tenant_slug___guide_id__custom_rules_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for get style guide custom rules. | application/json StyleGuideCustomRulesResponse |
| 422 | Validation Error | application/json HTTPValidationError |
PUT /v1/style-guides/{tenant_slug}/{guide_id}/custom-rules
Put Style Guide Custom Rules
Replace the guide's custom-rule rows from YAML (GOV-2.3, #4435).
Strictly validates the document (same contract as POST /v1/lint/custom-rules/validate,
but rules: {} clears every custom rule). Built-in rows are untouched. Malformed YAML
returns HTTP 422 with a pointer for inline editor markers.
Operation id: put_style_guide_custom_rules_v1_style_guides__tenant_slug___guide_id__custom_rules_put
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for put style guide custom rules.
application/json—StyleGuideCustomRulesPutRequest
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for put style guide custom rules. | application/json StyleGuideCustomRulesResponse |
| 422 | Malformed guide: detail.message explains the problem and detail.pointer points at the offending YAML node. | — |
POST /v1/style-guides/{tenant_slug}/{guide_id}/custom-rules/preview
Preview Style Guide Custom Rules
Dry-run draft custom rules against a project revision (GOV-2.3, #4435).
Parses the draft YAML, reconstructs the revision's OpenAPI document, evaluates only the custom rules, and returns their violations — nothing is persisted.
Operation id: preview_style_guide_custom_rules_v1_style_guides__tenant_slug___guide_id__custom_rules_preview_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for preview style guide custom rules.
application/json—StyleGuideCustomRulesPreviewRequest
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for preview style guide custom rules. | application/json StyleGuideCustomRulesPreviewResponse |
| 422 | Malformed draft YAML: detail.message + detail.pointer. | — |
PUT /v1/style-guides/{tenant_slug}/{guide_id}/default
Set Tenant Default
Make a guide the tenant default — what every project without its own assignment lints under from the next run onward.
Operation id: set_tenant_default_v1_style_guides__tenant_slug___guide_id__default_put
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for set tenant default. | application/json StyleGuideOut |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/export
Export Style Guide
Download a guide's rule configuration as an apiome.style-guide document (#1747).
The document carries the guide's name, description, external lint profile, built-in
rule overrides and custom rules — exactly what POST …/import reads back. Readable by
any tenant member, and works for the read-only built-in guide too. The response sets
Content-Disposition so browsers save it as <guide-name>.style-guide.json.
Operation id: export_style_guide_v1_style_guides__tenant_slug___guide_id__export_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for export style guide. | application/json StyleGuideExportDocument |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/ladder
Get Style Guide Ladder
Return the guide's maturity ladder, or ladder: null when it has none (GVM-1.1).
Readable by any tenant member. For the built-in Apiome Recommended guide the response
also carries the default Bronze / Silver / Gold ladder as a read-only template.
Operation id: get_style_guide_ladder_v1_style_guides__tenant_slug___guide_id__ladder_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for get style guide ladder. | application/json StyleGuideLadderResponse |
| 422 | Validation Error | application/json HTTPValidationError |
PUT /v1/style-guides/{tenant_slug}/{guide_id}/ladder
Put Style Guide Ladder
Create or replace the guide's maturity ladder (GVM-1.1, #5854). Tenant admin only.
The body is the complete ladder, levels lowest first. Refused with 422 and a
detail.code / detail.pointer when a level relaxes a lower one
(ladder-level-not-cumulative, naming the level and rule), a rule id is not in the
registry (ladder-unknown-rule), an axis is not an axis key (ladder-unknown-axis),
or the ladder is otherwise malformed. The built-in guide is read-only (409).
A successful save appends a ladder_changed revision, snapshots a new policy pack (both
freeze the ladder, so their fingerprints move) and audits style_guide.ladder_changed.
Saving an identical ladder changes nothing. A ladder without the guide's
requiredPublishLevel is refused (422 ladder-required-level-removed, GVM-1.3): clear
or change the required level first.
Operation id: put_style_guide_ladder_v1_style_guides__tenant_slug___guide_id__ladder_put
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for put style guide ladder.
application/json—StyleGuideLadderModelInput
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for put style guide ladder. | application/json StyleGuideLadderResponse |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/policy
Get Style Guide Policy Settings
Return draft policy gate settings for a style guide (CLX-1.3, #4850).
Operation id: get_style_guide_policy_settings_v1_style_guides__tenant_slug___guide_id__policy_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for get style guide policy settings. | application/json StyleGuidePolicySettingsOut |
| 422 | Validation Error | application/json HTTPValidationError |
PUT /v1/style-guides/{tenant_slug}/{guide_id}/policy
Put Style Guide Policy Settings
Update draft policy gates and optionally snapshot a policy pack (CLX-1.3, #4850).
Also carries the CTG-3.4 (#4478) breaking-publish guardrail level and the COL-2.3 (#4519) approval policy, both of which the publish flow reads through the same guide-resolution chain.
DCW-3.4 (private-suite#2364) adds the component-library policy: ordered
componentApprovalStages (validated strictly — a bad stage is a 422, never silently
dropped) and componentDeprecationNoticeDays.
requiredReviewerRole distinguishes omitted from null: omitting it leaves the
stored role alone, sending null clears it. requiredPublishLevel (GVM-1.3, #5856)
follows the same rule and must name a level of the guide's ladder (422 required-publish-level-unknown otherwise); it is frozen into the next policy pack.
Every other field keeps the omit-to-leave-unchanged rule the endpoint has always had.
Operation id: put_style_guide_policy_settings_v1_style_guides__tenant_slug___guide_id__policy_put
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for put style guide policy settings.
application/json—StyleGuidePolicySettingsPutRequest
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for put style guide policy settings. | application/json StyleGuidePolicySettingsOut |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/policy-versions
List Style Guide Policy Versions
List immutable policy pack versions for a style guide, newest first (CLX-1.3, #4850).
One page of at most limit versions (200 at most); pass the page's nextCursor as
cursor while hasMore is true (#7196).
Args:
tenant_slug: The tenant in the URL.
guide_id: The guide whose policy versions are read.
limit: Page size.
cursor: Where the page starts (nextCursor of the previous page).
auth_data: The authenticated principal.
Returns: The page of policy versions and whether another follows.
Raises: HTTPException: 400 for a malformed cursor; 404 when the guide is unknown.
Operation id: list_style_guide_policy_versions_v1_style_guides__tenant_slug___guide_id__policy_versions_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
limit | query | integer | no | Page size. At most 200. |
cursor | query | string or null | no | Opaque cursor from the previous page (next_cursor, or the X-Next-Cursor header). Omit for the first page. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list style guide policy versions. | application/json StyleGuidePolicyVersionListResponse |
| 422 | Validation Error | application/json HTTPValidationError |
POST /v1/style-guides/{tenant_slug}/{guide_id}/policy-versions
Publish Style Guide Policy Version
Snapshot the live guide into a new immutable policy pack (CLX-1.3, #4850).
Operation id: publish_style_guide_policy_version_v1_style_guides__tenant_slug___guide_id__policy_versions_post
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful response for publish style guide policy version. | application/json StyleGuidePolicyVersionOut |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/policy-versions/{policy_version_id}
Get Style Guide Policy Version
Fetch one policy pack version for a style guide (CLX-1.3, #4850).
Operation id: get_style_guide_policy_version_v1_style_guides__tenant_slug___guide_id__policy_versions__policy_version_id__get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
policy_version_id | path | string | yes | Path parameter identifying the policy version id segment. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for get style guide policy version. | application/json StyleGuidePolicyVersionOut |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/revisions
List Style Guide Revisions
The guide's immutable revision history, newest first (GOV-1.6, #4432).
One entry per edit — create, rename, rule-catalog save, custom-rule save, policy-gate change — with the change kind, the actor, and the fingerprints a lint result pins to. Saves that changed nothing are not entries: the history is real changes only.
Reading self-heals a guide with no history yet (created before GOV-1.6, or seeded by the V159 migration): its current state is captured as revision 1 rather than showing an empty list for a guide that demonstrably exists. Readable by any tenant member — compliance review is not an admin-only activity.
One page of at most limit revisions (500 at most; a larger limit is now a 422
rather than silently clamped). Pass the page's nextCursor as cursor while
hasMore is true (#7196).
Args:
tenant_slug: The tenant in the URL.
guide_id: The guide whose history is read.
limit: Page size.
cursor: Where the page starts (nextCursor of the previous page).
auth_data: The authenticated principal.
Returns: The page of revisions and whether another follows.
Raises: HTTPException: 400 for a malformed cursor; 404 when the guide is unknown.
Operation id: list_style_guide_revisions_v1_style_guides__tenant_slug___guide_id__revisions_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
limit | query | integer | no | Page size. At most 500. |
cursor | query | string or null | no | Opaque cursor from the previous page (next_cursor, or the X-Next-Cursor header). Omit for the first page. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for list style guide revisions. | application/json StyleGuideRevisionListResponse |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/revisions/{revision_id}
Get Style Guide Revision
One immutable revision with the rules and policy gates it froze (GOV-1.6, #4432).
This is what makes a past lint result defendable: a report carries guideRevisionId, and
this endpoint returns exactly the ruleset that produced it — including custom rule
definitions — no matter how the live guide has changed since.
Operation id: get_style_guide_revision_v1_style_guides__tenant_slug___guide_id__revisions__revision_id__get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
revision_id | path | string | yes | Revision UUID (versions.id). |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for get style guide revision. | application/json StyleGuideRevisionDetailOut |
| 422 | Validation Error | application/json HTTPValidationError |
GET /v1/style-guides/{tenant_slug}/{guide_id}/rules
Get Style Guide Rules
The guide's built-in rule catalog view (GOV-2.2, #4434).
Every GOV-1.2 registry rule with its category, default severity and rationale, merged
with this guide's style_guide_rules state (enabled + severity override). Readable by
any tenant member — the rule catalog tab renders read-only for non-admins.
Operation id: get_style_guide_rules_v1_style_guides__tenant_slug___guide_id__rules_get
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for get style guide rules. | application/json StyleGuideRulesResponse |
| 422 | Validation Error | application/json HTTPValidationError |
PUT /v1/style-guides/{tenant_slug}/{guide_id}/rules
Put Style Guide Rules
Replace the guide's built-in rule rows (GOV-2.2, #4434) — the catalog tab's save.
The body is the guide's complete desired built-in rule state (at most one entry per registered rule id; unknown ids are rejected). Custom-rule rows are untouched. The next lint run under the guide picks the new rows up via GOV-1.4's content-addressed compile.
Operation id: put_style_guide_rules_v1_style_guides__tenant_slug___guide_id__rules_put
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tenant_slug | path | string | yes | URL-safe tenant slug that scopes the request. |
guide_id | path | string | yes | Style guide identifier. |
authorization | header | string or null | no | JWT bearer token for authenticated access (Authorization: Bearer <token>). |
X-API-Key | header | string or null | no | Tenant-scoped API key used as an alternative to JWT bearer authentication. |
Request body (required)
Request body for put style guide rules.
application/json—StyleGuideRulesPutRequest
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful response for put style guide rules. | application/json StyleGuideRulesResponse |
| 422 | Validation Error | application/json HTTPValidationError |
Schemas used
HTTPValidationError
Validation error response emitted when request data fails schema checks.
| Property | Type | Required | Description |
|---|---|---|---|
detail | array of ValidationError | no | Detail. |
StyleGuideCreateRequest
Create a custom style guide, optionally copying an existing guide's rules (GOV-2.1).
source_guide_id implements both duplicate flows: duplicating a custom guide and
"start from Recommended" (duplicating the read-only builtin guide as an editable copy).
| Property | Type | Required | Description |
|---|---|---|---|
name | string | yes | Guide display name (unique per tenant). |
description | string or null | no | Optional free-text description. |
sourceGuideId | string or null | no | Guide (same tenant) whose rule rows are copied into the new guide. |
externalLintProfile | string or null | no | CLX-2.2 profile: baseline | tenant_guide | strict (default baseline). |
StyleGuideCustomRulesPreviewRequest
Dry-run custom-rule evaluation against a project revision (GOV-2.3, #4435).
| Property | Type | Required | Description |
|---|---|---|---|
yaml | string | yes | Draft custom-rules YAML to evaluate (not persisted). |
projectId | string | yes | The project owning the revision to lint against. |
versionRecordId | string | yes | The revision (versions.id) to lint against. |
StyleGuideCustomRulesPreviewResponse
Live violations from evaluating draft custom rules (GOV-2.3, #4435).
| Property | Type | Required | Description |
|---|---|---|---|
projectId | string | yes | Project ID. |
versionRecordId | string | yes | Version Record ID. |
versionId | string | yes | Version ID. |
count | integer | yes | Number of violations returned. |
findings | array of LintFindingOut | yes | Custom-rule violations, sorted deterministically. |
ruleErrors | map of string | no | Rule id -> sandbox abort reason for rules that could not be evaluated. |
StyleGuideCustomRulesPutRequest
Replace a guide's custom-rule rows from YAML (GOV-2.3, #4435).
| Property | Type | Required | Description |
|---|---|---|---|
yaml | string | yes | The style-guide YAML document (rules.<id>: {description, severity, given, then}). |
StyleGuideCustomRulesResponse
A guide's custom-rules YAML document (GOV-2.3, #4435).
| Property | Type | Required | Description |
|---|---|---|---|
guideId | string | yes | The guide's id. |
guideName | string | yes | The guide's display name. |
source | string | yes | builtin (read-only, seeded) | custom (tenant-authored). |
yaml | string | yes | The Spectral-compatible custom-rules YAML document. |
ruleCount | integer | yes | Number of custom rules in the document (0 for rules: {}). |
StyleGuideExportDocument
A portable style-guide rule configuration (#1747) — the export and import format.
Carries the guide's name, description and external lint profile, its built-in rule overrides and its custom rules. Policy gates, assignments and revision history are not included: they are tenant-specific rather than rule configuration.
| Property | Type | Required | Description |
|---|---|---|---|
format | string | yes | Always apiome.style-guide. |
formatVersion | integer | yes | Document version (currently 1). |
exportedAt | string | yes | ISO-8601 time the document was written. |
guide | StyleGuideExportGuideOut | yes | Guide. |
builtinRules | array of StyleGuideExportBuiltinRuleOut | yes | Built-in rule overrides, sorted by ruleId (absent rules are disabled). |
customRules | array of StyleGuideExportCustomRuleOut | yes | Custom rules in stored order. |
StyleGuideImportRequest
Create a style guide from an export document (#1747): the JSON, or a URL to fetch it.
Exactly one of content (a pasted document or an uploaded file's text) and url
must be supplied.
| Property | Type | Required | Description |
|---|---|---|---|
content | string or null | no | The export document's JSON text (paste or uploaded file). |
url | string or null | no | http/https URL of an export document to fetch (SSRF-guarded). |
name | string or null | no | Name for the new guide; defaults to the document's guide.name. |
sourceLabel | string or null | no | Human label for the source (e.g. the uploaded filename), echoed back. |
StyleGuideImportResponse
The guide an import created, with what it stored and what it skipped (#1747).
| Property | Type | Required | Description |
|---|---|---|---|
guide | StyleGuideOut | yes | The newly created custom guide. |
sourceLabel | string or null | no | The source label (the request's, or the fetched URL). |
builtinRuleCount | integer | yes | Built-in rule rows stored. |
customRuleCount | integer | yes | Custom rules stored. |
skipped | array of StyleGuideImportSkippedRuleOut | no | Entries not stored — e.g. built-in rule ids this instance does not register. |
StyleGuideLadderModelInput
A style guide's ordered maturity ladder, lowest level first (GVM-1.1, #5854).
| Property | Type | Required | Description |
|---|---|---|---|
name | string | yes | Ladder display name. |
levels | array of StyleGuideLadderLevelModel | yes | Ordered levels, lowest first. An empty ladder is refused (ladder-empty). |
StyleGuideLadderResponse
GET|PUT /v1/style-guides/{tenant}/{guideId}/ladder (GVM-1.1, #5854).
| Property | Type | Required | Description |
|---|---|---|---|
guideId | string | yes | Guide ID. |
ladder | StyleGuideLadderModelOutput or null | no | The guide's ladder, or null when it has none. A guide without a ladder has no levels to meet — it is never reported as meeting every level. |
contentFingerprint | string or null | no | SHA-256 of the canonical ladder; null when there is no ladder. |
updatedAt | string or null | no | Updated At. |
readOnly | boolean | no | True for the built-in guide, whose ladder cannot be set. |
template | StyleGuideLadderModelOutput or null | no | The default Bronze / Silver / Gold ladder, returned for the built-in Apiome Recommended guide only. A read-only template: it is not applied to any tenant. |
StyleGuideListResponse
The tenant's style guides for the Control Panel list view (GOV-2.1, #4433).
| Property | Type | Required | Description |
|---|---|---|---|
guides | array of StyleGuideOut | yes | One page of the tenant's guides, builtin first then by name. |
count | integer | yes | Number of guides in this page (== len(guides)). |
hasMore | boolean | no | Whether another page exists. |
nextCursor | string or null | no | Pass as cursor to read the next page; null on the last page. |
StyleGuideOut
One tenant style guide with its list-view rollups (GOV-2.1, #4433).
source == 'builtin' marks the seeded read-only "Apiome Recommended" guide: it can be
duplicated and assigned but never edited or deleted. is_default is the tenant-default
badge; tenant_assigned reports an explicit tenant-wide assignment row (which resolves
ahead of the default flag in the GOV-1.4 chain — the API keeps the two in sync).
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Stable resource identifier. |
name | string | yes | Human-readable name. |
description | string or null | no | Free-text description. |
source | string | yes | builtin (read-only, seeded) | custom (tenant-authored). |
isDefault | boolean | yes | True for the tenant's default guide (the list view's default badge). |
ruleCount | integer | yes | Total style_guide_rules rows on the guide (enabled and disabled). |
enabledRuleCount | integer | yes | Rules currently enabled — the list view's 'rules on' column. |
tenantAssigned | boolean | yes | True when an explicit tenant-wide assignment row points at this guide. |
projectAssignments | array of StyleGuideProjectAssignmentOut | no | Projects explicitly assigned to this guide, sorted by project name. |
externalLintProfile | string | no | CLX-2.2 OpenAPI external validation pack profile: baseline | tenant_guide | strict. |
createdAt | string (date-time) or null | no | Created At. |
updatedAt | string (date-time) or null | no | Updated At. |
StyleGuidePolicySettingsOut
Draft policy gate settings on a live style guide (CLX-1.3, #4850).
| Property | Type | Required | Description |
|---|---|---|---|
guideId | string | yes | Guide ID. |
axisGates | object | no | Per-axis min grade/score floors, e.g. {quality: {minGrade: B}}. |
requiredCoverage | array of string | no | Required Coverage. |
ciOutcomes | StyleGuideCiOutcomesOut | no | Ci Outcomes. |
breakingPublishPolicy | enum "off", "warn", "block" | no | Guardrail applied when a publish is breaking without a semver major bump (CTG-3.4): off, warn (default), or block. |
requiredApprovals | integer | no | Review approvals a draft must carry before it can be published (COL-2.3); 0 (default) disables the approval gate. |
requiredReviewerRole | string or null | no | Role slug at least one of those approvals must come from (COL-2.3); null means any approver counts. |
componentApprovalStages | array of ComponentApprovalStageModel | no | Ordered approval stages a component-library revision must pass before it can be published (DCW-3.4); empty (default) means no component approval gate. |
componentDeprecationNoticeDays | integer | no | Minimum days between scheduling a component revision deprecation and its sunset (DCW-3.4). |
compatibilityMode | enum "BACKWARD", "FORWARD", "FULL", "NONE" | no | Compatibility mode classified diffs, compatibility checks, the CI diff gate and the publish guardrail grade by when a request names none (XPC-4.5): BACKWARD (default), FORWARD, FULL or NONE. |
compatibilityTransitive | boolean | no | When true, a change is checked against every earlier revision, not only the base (BACKWARD_TRANSITIVE and friends; XPC-4.5). |
protobufBreakingCategory | enum "WIRE", "WIRE_JSON", "PACKAGE", "FILE" | no | buf breaking category Protobuf changes are graded at (XPC-4.5): WIRE, WIRE_JSON (default), PACKAGE or FILE. |
requiredPublishLevel | string or null | no | Key of the maturity level a draft must reach before it publishes (GVM-1.3); a level of the guide's own ladder. null (default) means no level gate. |
StyleGuidePolicySettingsPutRequest
Replace draft policy gate settings on a custom style guide (CLX-1.3, #4850).
| Property | Type | Required | Description |
|---|---|---|---|
axisGates | object or null | no | Axis Gates. |
requiredCoverage | array of string or null | no | Required Coverage. |
ciOutcomes | StyleGuideCiOutcomesOut or null | no | Ci Outcomes. |
breakingPublishPolicy | enum "off", "warn", "block" or null | no | Breaking-publish guardrail level (CTG-3.4); omit to leave unchanged. |
requiredApprovals | integer or null | no | Approvals required before publish (COL-2.3); 0 disables the gate, omit to leave unchanged. |
requiredReviewerRole | string or null | no | Role slug at least one approval must come from (COL-2.3); send null to clear it, omit to leave unchanged. |
componentApprovalStages | array of ComponentApprovalStageModel or null | no | Ordered component-library approval stages (DCW-3.4), at most 5; send [] to turn the gate off, omit to leave unchanged. |
componentDeprecationNoticeDays | integer or null | no | Minimum deprecation notice in days (DCW-3.4); omit to leave unchanged. |
compatibilityMode | enum "BACKWARD", "FORWARD", "FULL", "NONE" or null | no | Compatibility mode (XPC-4.5); omit to leave unchanged. |
compatibilityTransitive | boolean or null | no | Check every earlier revision, not only the base (XPC-4.5); omit to leave unchanged. |
protobufBreakingCategory | enum "WIRE", "WIRE_JSON", "PACKAGE", "FILE" or null | no | buf breaking category for Protobuf changes (XPC-4.5); omit to leave unchanged. |
requiredPublishLevel | string or null | no | Maturity level key a draft must reach before it publishes (GVM-1.3); must be a level of the guide's ladder. Send null to clear it, omit to leave unchanged. |
snapshot | boolean | no | When true (default), also append an immutable policy pack version. |
StyleGuidePolicyVersionListResponse
List of policy pack versions for a style guide (CLX-1.3, #4850).
| Property | Type | Required | Description |
|---|---|---|---|
versions | array of StyleGuidePolicyVersionOut | no | Versions. |
count | integer | no | Number of versions in this page. |
hasMore | boolean | no | Whether another page exists. |
nextCursor | string or null | no | Pass as cursor to read the next page; null on the last page. |
StyleGuidePolicyVersionOut
One immutable style-guide policy pack version (CLX-1.3, #4850).
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Stable resource identifier. |
guideId | string | yes | Guide ID. |
versionNumber | integer | yes | Version Number. |
contentFingerprint | string | yes | Content Fingerprint. |
axisGates | object | no | Axis Gates. |
requiredCoverage | array of string | no | Required Coverage. |
ciOutcomes | StyleGuideCiOutcomesOut | no | Ci Outcomes. |
ladder | StyleGuideLadderModelOutput or null | no | The maturity ladder frozen into this pack (GVM-1.1); null when none. |
requiredPublishLevel | string or null | no | The level key the publish gate requires, frozen into this pack (GVM-1.3); null when no level gate is armed. |
actorUserId | string or null | no | Actor User ID. |
actorLabel | string or null | no | Actor Label. |
createdAt | string or null | no | Created At. |
StyleGuideRevisionDetailOut
A style-guide revision including its frozen rules and policy gates (GOV-1.6, #4432).
| Property | Type | Required | Description |
|---|---|---|---|
id | string | yes | Revision id — what a lint result pins to. |
guideId | string | yes | The guide this revision belongs to. |
revisionNumber | integer | yes | Monotonic revision number within the guide (starts at 1). |
changeKind | string | yes | What produced the revision: created | edited | rules_changed | custom_rules_changed | policy_changed | imported | ladder_changed. |
name | string | yes | Guide name at the time of this revision. |
description | string or null | no | Guide description at the time of this revision. |
externalLintProfile | string or null | no | External validation profile at the time of this revision (CLX-2.2). |
ruleCount | integer | no | Number of rule rows frozen into this revision. |
enabledRuleCount | integer | no | How many of those rules were enabled. |
customRuleCount | integer | no | How many of those rules carried a custom definition (GOV-1.3). |
contentFingerprint | string | yes | SHA-256 of the frozen rule rows — identical to the fingerprint the linter stamps on the compiled guide, which is how lint results resolve their revision. |
snapshotFingerprint | string | yes | SHA-256 of the whole snapshot (identity + rules + policy gates). Equal fingerprints mean an edit changed nothing, and no revision is appended. |
actorUserId | string or null | no | User who made the change; null for system captures or deleted users. |
actorLabel | string or null | no | Human-readable actor label recorded at the time of the change. |
createdAt | string or null | no | When the revision was recorded (rows are write-once). |
rules | array of object | no | The guide's rule rows as they were, sorted by rule id: ruleId-equivalent rule_id, enabled, severity, and custom_def for custom rules. |
policy | object | no | Draft policy gates at the time of this revision: axisGates, requiredCoverage, ciOutcomes (CLX-1.3). |
ladder | StyleGuideLadderModelOutput or null | no | The maturity ladder at the time of this revision (GVM-1.1); null when the guide had none. |
StyleGuideRevisionListResponse
A style guide's immutable revision history, newest first (GOV-1.6, #4432).
| Property | Type | Required | Description |
|---|---|---|---|
guideId | string | yes | Guide ID. |
guideName | string | yes | Guide Name. |
revisions | array of StyleGuideRevisionOut | no | Revisions. |
count | integer | no | Number of revisions in this page. |
hasMore | boolean | no | Whether another page exists. |
nextCursor | string or null | no | Pass as cursor to read the next page; null on the last page. |
StyleGuideRulesPutRequest
Replace a guide's built-in rule rows (GOV-2.2, #4434).
The request is the guide's complete desired built-in rule state: rows for registry rules
omitted here are deleted (leaving those rules disabled at their defaults). Custom-rule
rows (custom_def present) are untouched — they are managed by the custom-rules tab.
| Property | Type | Required | Description |
|---|---|---|---|
rules | array of StyleGuideRuleOverrideIn | yes | The guide's built-in rule rows; at most one entry per rule id. |
StyleGuideRulesResponse
A guide's full built-in rule catalog view (GOV-2.2, #4434), sorted by rule id.
Merges the GOV-1.2 registry with the guide's style_guide_rules overrides so the rule
catalog tab renders and saves from one payload. Custom rules (GOV-1.3 rows carrying a
custom_def) are not part of this view.
| Property | Type | Required | Description |
|---|---|---|---|
guideId | string | yes | The guide's id. |
guideName | string | yes | The guide's display name. |
source | string | yes | builtin (read-only, seeded) | custom (tenant-authored). |
rules | array of StyleGuideRuleOut | yes | Every registered built-in rule with this guide's state, sorted by ruleId. |
count | integer | yes | Number of registry rules (== len(rules)). |
enabledCount | integer | yes | Rules this guide currently enables. |
docsPage | string | yes | Repository-relative path of the rule reference page docsAnchor points into. |
StyleGuideUpdateRequest
Rename / re-describe a custom style guide (GOV-2.1). Builtin guides are read-only.
| Property | Type | Required | Description |
|---|---|---|---|
name | string or null | no | New display name, when renaming. |
description | string or null | no | New description; empty string clears it. |
externalLintProfile | string or null | no | CLX-2.2 profile: baseline | tenant_guide | strict. |