---
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}``.

## Query parameters

- `wait` boolean

## Headers

- `Authorization` string, required

## Request body

- StyleAgentRunRequest — Request body for a Style Agent content check. A focused subset of the generic agent-run request: it carries only the fields the Style Agent uses and omits the ones scoped to other agents (``agents`` sub-agents, ``goal``, ``persona_id``, ``voice_profile_id``). Dropping ``agents`` also means this endpoint can only ever run the Style Agent.
  - `text` string, required — Document text to analyze.
  - `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.

## 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.
  - `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.net/markup/apis/api-reference.md) · [All operations](https://skmtc.net/markup/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/markup/api-reference/revisions/8e28e770c55d/schema)
