Replace a mock server's API key
Issues a new key for the mock and returns it. The previous key stops working immediately, so anything configured with it needs the new one.
Same authorization as revealing the key (manage on the mock), audit-logged, and
cross-org returns 404.
Requires scope write:mocks.
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
Format
uuidResponse 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/api-key/regenerate"{
"mockServerId": "ab6f0051-1ea2-4f26-bcfb-0e9ea431b824",
"apiKey": "string",
"apiKeyPreview": "ms_Ab12C..."
}{
"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?