Spec0docsCLI 0.7.0

Re-provision a mock against its API's latest published spec

A mock is bound to the spec snapshot it was created from, so publishing a new version of an API leaves its mock serving the previous contract. This rebuilds it against the API's current spec.

The mock's public id, URL and API key are unchanged — those are what CI configs and clients already hold. Auto-generated variants are replaced with ones correct for the new spec; hand-written variants are carried over where their operation still exists, and the ones that couldn't be are listed in the response rather than silently dropped.

Idempotent: refreshing a mock that already serves the current spec reports refreshed: false and changes nothing.

Cross-org returns 404, not 403, so the existence of a mock is not leaked.

Requires scope write:mocks.

POST
/api/v1/public/mocks/{mockServerId}/refresh

Authorization

BearerAuth
AuthorizationBearer <token>

Bearer token. Either a Personal Access Token (pat_...) or a Service Account Token (sat_...). Issued via the Spec0 dashboard or /me/personal-access-tokens.

In: header

Path Parameters

mockServerId*string
Formatuuid

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://app.spec0.io/api/v1/public/mocks/497f6eca-6276-4993-bfeb-53cbbbba6f08/refresh"
{
  "mockServerId": "ab6f0051-1ea2-4f26-bcfb-0e9ea431b824",
  "specVersion": "string",
  "refreshed": true,
  "customVariantsCarriedOver": 0,
  "customVariantsDropped": [
    "string"
  ]
}
{
  "error": "string",
  "message": "string"
}
{
  "status": 0,
  "title": "string",
  "detail": "string",
  "type": "string",
  "instance": "string"
}
{
  "status": 0,
  "title": "string",
  "detail": "string",
  "type": "string",
  "instance": "string"
}
Was this helpful?