---
title: "Run Style Agent"
method: POST
path: "/style-agent/run"
tags: ["styleAgent"]
---

# Run Style Agent

`POST /style-agent/run`

Run a Style Agent content check.

Submit document text to analyze it against your organization's style
configuration. Set ``wait=true`` to block until the check completes and
return the result (201 Created); the default (``wait=false``) returns
202 Accepted immediately with a workflow id to poll via
``GET /style-agent/workflows/{workflow_id}``.

To check a PDF, Word, HTML, DITA, Markdown, or plain-text *file*, use
``POST /style-agent/run-file`` instead.

## Query parameters

- `wait` boolean

## Headers

- `Authorization` string, required

## Request body

- StyleAgentRunRequest — Request body for a Style Agent content check.
  - `style_guide_id` string, nullable — Style guide ID to check the document against. ``target_id`` is a deprecated alias for this field; send exactly one of the two names.
  - `content_profile_id` string, nullable — Language-service content profile ID for style checking.
  - `domain_ids` string[], nullable — Terminology domain IDs.
  - `document_ref` string, nullable — Caller-provided document identifier for tracking across scans.
  - `url` string, nullable — Document URL.
  - `document_name` string, nullable — Document name or title.
  - `webhook_url` string, uri, nullable — Optional webhook URL for async result delivery.
  - `text` string, required — Document text to analyze.

## Response `200`

Successful Response

- StyleAgentRunResponse — Response for a Style Agent content-check run, with the result envelope typed so the ``analysis`` naming contract is part of the published schema. The generic ``/agents`` endpoints keep the untyped result.
  - `workflow_id` string, required — Workflow ID for tracking
  - `request_id` string, nullable — Request tracking ID
  - `status` 'running' | 'completed' | 'failed' | 'timed_out' | 'cancelled', required — Status of a workflow execution.
  - `document_ref` string, nullable — Caller-provided document identifier.
  - `check_type` 'interactive' | 'automated' | 'batch' | 'baseline' — How a content check should be counted. The type fixes two things about a result: its priority (is someone waiting?) and its attribution (does it count as authoring activity for a person?). - INTERACTIVE: a writer checking content as they work — high priority, assigned. - AUTOMATED: a save/update check credited to the last editor — assigned. - BATCH: a bulk check of content you own — assigned to the content's author. - BASELINE: a check of content you do NOT own — a measurement, not authoring, so it is not assigned to anyone.
  - `assigned` boolean — Whether the check counts as authoring activity for an author.
  - `batch_id` string, nullable — Owning batch id (agbw_<nanoid>); null unless this is a batch check.
  - `result` StyleAgentResult — Result of a Style Agent content check. Only the ``analysis`` block is typed here — issues, quality scores, and any agent-specific keys flow through unchanged (``extra="allow"``). Validating ``analysis`` at this edge also mirrors the legacy ``targetId`` naming onto the canonical ``styleGuideId`` keys for results persisted before the rename.
    - `analysis` StyleAgentAnalysis — Style guide, content profile, and readability metadata forwarded from SLS. Cortex populates this from the language-service ``data.analysis`` block (legacy ``targetId`` naming) and helios_one republishes it on the style-agent API surface. ``styleGuideId`` / ``styleGuideDisplayName`` are the canonical public keys; the legacy ``targetId`` / ``targetDisplayName`` keys carry the same values (and are marked deprecated in the schema) until removed in a future API version. The mirror runs on validation, so results persisted before the rename gain the canonical keys when re-validated.
      - `styleGuideId` string, nullable
      - `styleGuideDisplayName` string, nullable
      - `targetId` string, nullable
      - `targetDisplayName` string, nullable
      - `contentProfileId` string, nullable
      - `contentProfileDisplayName` string, nullable
      - `words` integer, nullable
      - `sentences` integer, nullable
      - `clarityIndex` number, double, nullable
      - `informalityIndex` number, double, nullable
      - `livelinessIndex` number, double, nullable
      - `fleschReadingEase` number, double, nullable
  - `started_at` string, date-time, required — Workflow start time
  - `completed_at` string, date-time, nullable — Workflow completion time
  - `duration_seconds` number, double, nullable — Execution duration

## Other responses

- `401` — Authentication failed or no valid API key provided.
- `403` — Forbidden
- `422` — Invalid input for agent
- `500` — Workflow execution failed (wait=true)

---

[API](https://skmtc.dev/markup/apis/api-reference.md) · [All operations](https://skmtc.dev/markup/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/markup/api-reference/revisions/65e1214d0bbf/schema)
