# Porkbun API v3 — Mock

> Credential-free mock server returning schema-accurate example responses for any endpoint.

Part of the Porkbun API v3.48. Topic index: https://porkbun.com/llms · Full reference: https://porkbun.com/llms-full.txt · Overview: https://porkbun.com/llms.txt · OpenAPI spec: https://porkbun.com/api/json/v3/spec

**Auth:** send `X-API-Key` / `X-Secret-API-Key` headers (preferred) or `apikey` / `secretapikey` in the JSON body. Create keys at https://porkbun.com/account/api

---

# Endpoints

## GET /api/json/v3/mock

**Mock server: list mockable endpoints**

Credential-free. Returns a directory of every endpoint that can be mocked, each with a ready-to-call mock URL.

Response fields:

| Field | Type | Description |
|---|---|---|
| `status` | string |  |
| `mock` | boolean |  |
| `count` | integer |  |
| `endpoints` | object[] |  |

## GET /api/json/v3/mock/{path}

**Mock server: example response for an endpoint**

Credential-free. Mirror any real endpoint path after `/mock` (e.g. `/mock/domain/listAll`, `/mock/dns/create/example.com`) to get a schema-accurate example success response. Append `?status=error` for the error-response shape. Touches no datastore; signalled by the `X-Porkbun-Mock: true` header.

| Parameter | In | Required | Description |
|---|---|---|---|
| `path` | path | yes | The real endpoint path to mock, e.g. `domain/listAll`. |
| `status` | query | no | Set to `error` to return the error-response shape. |

---

## More

- Guides (how-tos): https://porkbun.com/llms/guides
- Topic index: https://porkbun.com/llms
- Full reference (one file): https://porkbun.com/llms-full.txt
- OpenAPI spec (full schemas): https://porkbun.com/api/json/v3/spec
- Short overview: https://porkbun.com/llms.txt
- Official MCP server: https://porkbun.com/mcp (`npx -y @porkbunllc/mcp-server`)
- Create API keys: https://porkbun.com/account/api
