---
title: "Validate a stub payload without persisting"
method: POST
path: "/stubs/validate"
tags: ["stubs"]
---

# Validate a stub payload without persisting

`POST /stubs/validate`

Validates one or more stubs and returns them normalized without adding to storage

## Request body

- union
  - Stub[]
    - `id` string, uuid
    - `service` string, required
    - `method` string, required
    - `priority` integer — Priority of the stub. Higher priority stubs are matched first.
    - `used` boolean — Response-only — whether the stub has matched at least once. Ignored on input.
    - `headers` StubHeaders
      - `equals` object
      - `contains` object
      - `matches` object
      - `anyOf` StubHeadersAnyOfElement[] — Alternative header matchers (OR logic)
        - `equals` object
        - `contains` object
        - `matches` object
    - `input` StubInput, required
      - `ignoreArrayOrder` boolean
      - `equals` object
      - `contains` object
      - `matches` object
      - `anyOf` StubInputAnyOfElement[] — Alternative input matchers (OR logic)
        - `ignoreArrayOrder` boolean
        - `equals` object
        - `contains` object
        - `matches` object
    - `inputs` StubInput[] — Inputs to match against. If multiple inputs are provided, the stub will be matched if any of the inputs match.
      - `ignoreArrayOrder` boolean
      - `equals` object
      - `contains` object
      - `matches` object
      - `anyOf` StubInputAnyOfElement[] — Alternative input matchers (OR logic)
        - `ignoreArrayOrder` boolean
        - `equals` object
        - `contains` object
        - `matches` object
    - `output` StubOutput, required
      - `data` unknown
      - `stream` unknown[]
        - unknown
      - `headers` object
      - `error` string
      - `code` integer
      - `details` object[] — gRPC status details packed into google.protobuf.Any (each item must contain type URL in `type`)
        - `type` string, required — Full Any type URL (for example, type.googleapis.com/google.rpc.ErrorInfo)
      - `delay` string — Delay before sending the response
    - `options` StubOptions — Optional behavior settings for a stub
      - `times` integer — Max number of matches; 0 = unlimited
    - `effects` StubEffect[] — Side effects applied after successful stub match
      - `action` 'upsert' | 'delete', required
      - `id` string — Stub UUID for delete action
      - `stub` object — Stub payload for upsert action
    - `source` string — Source of the stub (file, rest, mcp, proxy)
  - Stub
    - `id` string, uuid
    - `service` string, required
    - `method` string, required
    - `priority` integer — Priority of the stub. Higher priority stubs are matched first.
    - `used` boolean — Response-only — whether the stub has matched at least once. Ignored on input.
    - `headers` StubHeaders
      - `equals` object
      - `contains` object
      - `matches` object
      - `anyOf` StubHeadersAnyOfElement[] — Alternative header matchers (OR logic)
        - `equals` object
        - `contains` object
        - `matches` object
    - `input` StubInput, required
      - `ignoreArrayOrder` boolean
      - `equals` object
      - `contains` object
      - `matches` object
      - `anyOf` StubInputAnyOfElement[] — Alternative input matchers (OR logic)
        - `ignoreArrayOrder` boolean
        - `equals` object
        - `contains` object
        - `matches` object
    - `inputs` StubInput[] — Inputs to match against. If multiple inputs are provided, the stub will be matched if any of the inputs match.
      - `ignoreArrayOrder` boolean
      - `equals` object
      - `contains` object
      - `matches` object
      - `anyOf` StubInputAnyOfElement[] — Alternative input matchers (OR logic)
        - `ignoreArrayOrder` boolean
        - `equals` object
        - `contains` object
        - `matches` object
    - `output` StubOutput, required
      - `data` unknown
      - `stream` unknown[]
        - unknown
      - `headers` object
      - `error` string
      - `code` integer
      - `details` object[] — gRPC status details packed into google.protobuf.Any (each item must contain type URL in `type`)
        - `type` string, required — Full Any type URL (for example, type.googleapis.com/google.rpc.ErrorInfo)
      - `delay` string — Delay before sending the response
    - `options` StubOptions — Optional behavior settings for a stub
      - `times` integer — Max number of matches; 0 = unlimited
    - `effects` StubEffect[] — Side effects applied after successful stub match
      - `action` 'upsert' | 'delete', required
      - `id` string — Stub UUID for delete action
      - `stub` object — Stub payload for upsert action
    - `source` string — Source of the stub (file, rest, mcp, proxy)

## Response `200`

Successful operation

- Stub[]
  - `id` string, uuid
  - `service` string, required
  - `method` string, required
  - `priority` integer — Priority of the stub. Higher priority stubs are matched first.
  - `used` boolean — Response-only — whether the stub has matched at least once. Ignored on input.
  - `headers` StubHeaders
    - `equals` object
    - `contains` object
    - `matches` object
    - `anyOf` StubHeadersAnyOfElement[] — Alternative header matchers (OR logic)
      - `equals` object
      - `contains` object
      - `matches` object
  - `input` StubInput, required
    - `ignoreArrayOrder` boolean
    - `equals` object
    - `contains` object
    - `matches` object
    - `anyOf` StubInputAnyOfElement[] — Alternative input matchers (OR logic)
      - `ignoreArrayOrder` boolean
      - `equals` object
      - `contains` object
      - `matches` object
  - `inputs` StubInput[] — Inputs to match against. If multiple inputs are provided, the stub will be matched if any of the inputs match.
    - `ignoreArrayOrder` boolean
    - `equals` object
    - `contains` object
    - `matches` object
    - `anyOf` StubInputAnyOfElement[] — Alternative input matchers (OR logic)
      - `ignoreArrayOrder` boolean
      - `equals` object
      - `contains` object
      - `matches` object
  - `output` StubOutput, required
    - `data` unknown
    - `stream` unknown[]
      - unknown
    - `headers` object
    - `error` string
    - `code` integer
    - `details` object[] — gRPC status details packed into google.protobuf.Any (each item must contain type URL in `type`)
      - `type` string, required — Full Any type URL (for example, type.googleapis.com/google.rpc.ErrorInfo)
    - `delay` string — Delay before sending the response
  - `options` StubOptions — Optional behavior settings for a stub
    - `times` integer — Max number of matches; 0 = unlimited
  - `effects` StubEffect[] — Side effects applied after successful stub match
    - `action` 'upsert' | 'delete', required
    - `id` string — Stub UUID for delete action
    - `stub` object — Stub payload for upsert action
  - `source` string — Source of the stub (file, rest, mcp, proxy)

## Other responses

- `400` — Invalid stub data
- `422` — Validation error
- `500` — Internal Server Error

---

[API](https://skmtc.net/bavix/apis/gripmock-api-schema.md) · [All operations](https://skmtc.net/bavix/apis/gripmock-api-schema/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bavix/gripmock-api-schema/versions/b6e2357aa9c3/schema)
