Skip to main content
POST
Run a sandbox evaluation for one submitted OAS definition.

Authorizations

Authorization
string
header
required

The Tyk Dashboard API Access Credentials

Query Parameters

ruleset_ids
string[]

Saved ruleset IDs, comma-separated (repeated params also accepted by the handler). When set, overrides category-based resolution. Inactive rulesets are accepted when selected explicitly. Mutually exclusive with categories.

Maximum array length: 20
categories
string[]

Governance categories, comma-separated (repeated params also accepted by the handler). Resolves to active oas-api rulesets. The only category source for this endpoint — the submitted file carries none. Mutually exclusive with ruleset_ids.

Maximum array length: 10
api_id
string

Optional transient API ID echoed on response rows and used in issue IDs. Recommended for CI: if omitted, the fallback is x-tyk-api-gateway.info.id, then a deterministic hash of the canonicalized parsed document — which changes on every spec edit, churning issue IDs between commits.

api_name
string

Optional display name for the submitted document (engine-internal identity; response rows identify the API by api_id only). Defaults to x-tyk-api-gateway.info.name, then info.title, then api_id.

Body

Envelope transport for POST /api/evaluations/sandbox/oas. Carries the API definition as a string and nothing else — evaluation metadata (ruleset_ids, categories, api_id, api_name) stays in query params. Extra fields are rejected with 400.

content
string
required

The OpenAPI/Tyk OAS definition as a string — JSON or YAML, auto-detected (JSON parse attempted first, then YAML). Same accepted document shape as raw-body mode.

Response

Evaluation completed. evaluated_apis is always 1 on this endpoint. The response may include a non-empty error string for partial engine failures. CI gates must inspect the body — truncated == true, a present error, or blocking-severity issues all arrive with HTTP 200.

rulesets
object[]
required

Rulesets actually executed in this run. Single-ruleset callers see one entry; category-based callers see the resolved set. Each entry carries the ruleset's configured action and its per-ruleset severity counts. Empty array means no rulesets matched the request (category input with no intersection, or the only matches had a different resource_type than the APIs).

issues
object[]
required

Per-rule violations across all evaluated APIs, sorted by severity then location. Capped at MaxSandboxIssues (1000) — see truncated. Shared row schema with /api/governance/issues.

total
integer
required

Un-truncated issue count produced by the engine.

truncated
boolean
required

True when total > MaxSandboxIssues and issues was capped. FE renders a banner; CI/CD pipelines should treat this as a failure since the build is being gated against partial data.

error_count
integer
required

Run-wide count of severity-0 (error) issues, computed pre-truncation — trustworthy even when issues is capped. Count field names and severity mapping match the persisted ApiGovernanceResult summaries (tyk_governance_api_summaries).

warn_count
integer
required

Run-wide severity-1 (warn) issue count, pre-truncation.

info_count
integer
required

Run-wide severity-2 (info) issue count, pre-truncation.

hint_count
integer
required

Run-wide severity-3 (hint) issue count, pre-truncation.

evaluated_apis
integer
required

Number of APIs the engine actually applied rules against. Always 1 for /sandbox/oas.

elapsed_ms
integer<int64>
required

Wall-clock duration of engine.Evaluate, in milliseconds.

error
string

Joined error string when the engine returned failures for some (ruleset, api) pairs (per errors.Join from the mechanism story). Absent on full success. Per-pair attribution is deferred — see ticket.