Porkbun Webhooks API

Subscribe HTTPS endpoints to account events and Porkbun will `POST` a signed JSON payload to them as those events happen — no polling required. Manage endpoints with the **Webhooks** endpoints in this reference, the MCP tools (`create_webhook`, `list_webhooks`, …), or the web UI at `porkbun.com/account/api`. **Event types:** `domain.registered`, `domain.renewed`, `domain.transfer.completed`, `domain.transfer.failed` (an inbound transfer was rejected, the auth code was refused, or the domain is locked), `domain.expiring` (fires at 60/30/5 days before expiry), `dns.record.created`, `dns.record.updated`, `dns.record.deleted`, `account.verification.code_sent`, `account.verification.completed`, `cloudflare.connect.completed`, `cloudflare.connect.failed` (a Cloudflare move reached a terminal state — `status` in the payload distinguishes `done` from `skipped`/`failed`, so you can stop polling `/cloudflare/getQueue`). Subscribe to specific types, to a prefix wildcard like `dns.*`, or to `*` for everything (recommended — you'll receive new event types automatically). Call `GET /webhook/eventTypes` for the live catalog. **Payload envelope** — every delivery has the same outer shape: ```json { "event": "domain.registered", "id": "018f9c2a-7b3e-7c41-9b8a-2f1e6d4c5a90", "createdAt": "2026-06-17T18:30:00Z", "data": { "domain": "example.com", "tld": "com", "expireDate": "2027-06-17 18:30:00" } } ``` `id` is a UUIDv7 (time-ordered) and is also sent as the `X-Porkbun-Webhook-Id` header; use it to dedupe, since an endpoint may occasionally receive the same event more than once. `createdAt` is UTC (ISO 8601). The `data` object is event-specific; its fields are listed below. **What each event sends in `data`.** Dates inside `data` are UTC, formatted `YYYY-MM-DD HH:MM:SS`. Fields may be added over time, so ignore ones you don't recognise. No event carries contact details, auth codes, keys or other secrets. | Event | When it fires | `data` fields | |---|---|---| | `domain.registered` | A registration completes | `domain`, `tld`, `expireDate` | | `domain.renewed` | A renewal completes (manual, API or auto-renew) | `domain`, `tld`, `expireDate` (the new expiry) | | `domain.transfer.completed` | An inbound transfer finishes and the domain is in the account | `domain`, `tld` | | `domain.transfer.failed` | An inbound transfer did not go through: rejected by the losing registrar or registrant, auth code refused, or domain locked | `domain`, `tld`, `reason` (`rejected`, `gave_up`, `invalid_auth_code`, `domain_locked`), `willRetry` (Porkbun resubmits on its own), `submitAttempts` | | `domain.expiring` | 60, 30 and 5 days before expiry | `domain`, `tld`, `daysToExpire` (number: 60, 30 or 5), `expireDate` | | `dns.record.created` | A record is added (website, API, MCP, or a connected app) | `domain`, `name`, `id`, `type`, `content`, `ttl`, `prio` | | `dns.record.updated` | A record is changed | `domain`, `name`, `id`, `type`, `content`, `ttl`, `prio` (the values after the change) | | `dns.record.deleted` | A record is removed | `domain`, `name`, `id`, `type`, `content` (the values it had) | | `cloudflare.connect.completed` | A move to Cloudflare finished | `domain`, `status` (`done`), `message`, `cfAccountId`, `zoneId`, `previousNameservers`, `assignedNameservers`, `completedAt` | | `cloudflare.connect.failed` | A move to Cloudflare stopped without finishing | Same fields as completed; `status` is `failed` or `skipped`, `message` says why, `zoneId` may be `null` and the nameserver lists empty | | `account.verification.code_sent` | A verification code went to the account's email address or phone (from the website or the API) | `channel` (`email` or `phone`), `method` (`email`, `sms` or `call`), `sentTo` (masked), `expiresInMinutes` | | `account.verification.completed` | The account's email address or phone was verified (by link, website or API) | `channel`, `emailVerified`, `phoneVerified` (the account's state after this) | | `webhook.test` | You call `POST /webhook/test` | `endpointId` (number), `message` | Field notes: - `domain` is the registered domain (`example.com`); `tld` is its extension without the dot (`com`). - DNS events: `name` is the full hostname (`www.example.com`, or `example.com` for the apex). `id`, `ttl` and `prio` are strings, the same as in `/dns/retrieve`, and `prio` is `null` for types that have none. Record changes made by Porkbun itself for certificate issuance (`_acme-challenge` names) are not sent. - Verification events never contain the code: it only proves the address or phone is real because it arrives there. `code_sent` tells an agent to ask the person for it; `completed` tells it to retry what failed with `VERIFICATION_REQUIRED` once both are `true`. Login codes are not sent. - Cloudflare events: `previousNameservers` and `assignedNameservers` are arrays of hostnames; `cfAccountId` and `zoneId` are Cloudflare's IDs. Examples: ```json { "event": "domain.expiring", "id": "018f9c2a-7b3e-7c41-9b8a-2f1e6d4c5a91", "createdAt": "2026-06-17T09:00:00Z", "data": { "domain": "example.com", "tld": "com", "daysToExpire": 30, "expireDate": "2026-07-17 18:30:00" } } ``` ```json { "event": "dns.record.updated", "id": "018f9c2a-7b3e-7c41-9b8a-2f1e6d4c5a92", "createdAt": "2026-06-17T18:31:05Z", "data": { "domain": "example.com", "name": "www.example.com", "id": "123456789", "type": "A", "content": "192.0.2.1", "ttl": "600", "prio": null } } ``` ```json { "event": "cloudflare.connect.completed", "id": "018f9c2a-7b3e-7c41-9b8a-2f1e6d4c5a93", "createdAt": "2026-06-17T19:02:11Z", "data": { "domain": "example.com", "status": "done", "message": "Connected to Cloudflare.", "cfAccountId": "0123456789abcdef0123456789abcdef", "zoneId": "fedcba9876543210fedcba9876543210", "previousNameservers": ["curitiba.ns.porkbun.com", "fortaleza.ns.porkbun.com"], "assignedNameservers": ["anna.ns.cloudflare.com", "lee.ns.cloudflare.com"], "completedAt": "2026-06-17 19:02:10" } } ``` To see any event's exact payload against your own handler, use a sandbox key and `POST /sandbox/triggerWebhook` with `{"eventType": "...", "domain": "example.com"}`; `GET /webhook/delivery/{id}` shows the full payload of any past delivery. **Delivery headers:** - `X-Porkbun-Event` — the event type (e.g. `domain.renewed`). - `X-Porkbun-Webhook-Id` — the event UUID (matches `id` in the body). - `X-Porkbun-Webhook-Timestamp` — Unix seconds when the request was signed. - `X-Porkbun-Signature` — `sha256=` + the signature (see below). **Verify the signature.** The signature is `HMAC-SHA256(secret, "{timestamp}.{rawBody}")` where `secret` is the endpoint's signing secret, `{timestamp}` is the `X-Porkbun-Webhook-Timestamp` header value, and `{rawBody}` is the exact bytes of the request body (verify before parsing). Compare using a constant-time equality check, and reject timestamps that are too old (e.g. >5 minutes) to blunt replay attacks. ```php $timestamp = $_SERVER['HTTP_X_PORKBUN_WEBHOOK_TIMESTAMP']; $signature = $_SERVER['HTTP_X_PORKBUN_SIGNATURE']; // "sha256=..." $body = file_get_contents('php://input'); $expected = 'sha256=' . hash_hmac('sha256', $timestamp . '.' . $body, $endpointSecret); if (!hash_equals($expected, $signature) || abs(time() - (int)$timestamp) > 300) { http_response_code(400); exit; } // signature OK — now json_decode($body) and process ``` ```javascript import crypto from 'node:crypto'; const ts = req.header('X-Porkbun-Webhook-Timestamp'); const sig = req.header('X-Porkbun-Signature'); const expected = 'sha256=' + crypto.createHmac('sha256', endpointSecret) .update(`${ts}.${rawBody}`).digest('hex'); const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(sig)) && Math.abs(Date.now()/1000 - Number(ts)) < 300; ``` **Delivery log & manual resend.** Every attempt is recorded — list recent deliveries with `GET /webhook/deliveries` (filter by `endpointId` or `status`, newest first) and fetch one with its full payload via `GET /webhook/delivery/{id}`. History is retained ~30 days. To replay a delivery (e.g. after fixing a bug on your side), call `POST /webhook/resend` with the delivery `id`; it re-queues a fresh attempt reusing the **original event id**, so a consumer that dedupes on `X-Porkbun-Webhook-Id` treats it as the same event. The target endpoint must still exist and be ACTIVE. **Responding & retries.** Return any `2xx` status to acknowledge. Non-2xx responses, timeouts, or connection errors are retried with exponential backoff (~1m, 5m, 30m, 2h, 6h) up to 6 attempts. An endpoint that racks up 20 consecutive failures is automatically disabled and the account owner emailed; re-enable it (which resets the failure counter) via `POST /webhook/update` with `status: "ACTIVE"`. Use `POST /webhook/test` to send a `webhook.test` event and confirm your verifier works end-to-end.

GitHub OpenAPI

Operations 11

GET /webhook/eventTypes List subscribable event types #
GET /webhook/list List webhook endpoints #
GET /webhook/get/{id} Get a webhook endpoint #
POST /webhook/create Create a webhook endpoint #
POST /webhook/update Update a webhook endpoint #
POST /webhook/rotateSecret Rotate the signing secret #
POST /webhook/test Send a test event #
POST /webhook/delete Delete a webhook endpoint #
GET /webhook/deliveries List webhook deliveries #
GET /webhook/delivery/{id} Get a webhook delivery #
POST /webhook/resend Resend a delivery #

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/porkbun-com:porkbun-com-webhooks-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

porkbun-com-webhooks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Porkbun API v3 Webhooks API
  version: '3.109'
  description: 'The Porkbun API enables programmatic domain registration, DNS management, SSL certificate retrieval, and related operations. It is fully usable by AI agents, automation scripts, and developer tools. ## Sandbox / test mode


    Build and test an integration end-to-end with **no real registry actions, no DNS changes, no certificates, and no charges** by using a **sandbox API key** — a public key prefixed `pk1_sb_` (secret `sk1_sb_`), created at https://porkbun.com/account/api. Same base URL; just swap the key. In sandbox:

    - **A sandbox key sees only sandbox data.** Domains, DNS records, contacts and everything else in your live Porkbun account are invisible to it, including on a key you created on your own API Access page. Calling a live domain in the sandbox returns `INVALID_DOMAIN` for that reason, not because the name is wrong. - **Everything in the sandbox is created through the API.** The website only creates the keys. Register a test domain with `POST /domain/create/{domain}` first; that also creates its DNS zone, so there is no separate zone step. - **First steps:** `POST /domain/checkDomain/{name}` on a name nobody has registered, then `POST /domain/create/{domain}`, then `POST /dns/create/{domain}`, then `GET /dns/retrieve/{domain}`. - Every response includes `"sandbox": true` and an `X-Porkbun-Sandbox: true` header. - Registrations, renewals, transfers, DNS, contacts, nameservers, glue, and DNSSEC are simulated against an isolated datastore; your account starts with fake credit (top up/reset via `/sandbox/topup` and `/sandbox/reset`). Availability and pricing reflect the real catalog so quotes match production. - Endpoints that can''t be simulated — **hosting**, **email**, **closeouts** and **agent naming (ANS)** — return `SANDBOX_UNSUPPORTED`. Closeouts are excluded because the inventory and the purchase both live with a third party that has no test environment, so a simulated buy would claim a real domain. - **Webhooks are delivered in the sandbox.** Register an endpoint with `POST /webhook/create`, then either perform an operation (the matching signed event is delivered just like production) or fire any event on demand with `POST /sandbox/triggerWebhook` to test your handler and signature verification. ## Mock server (no credentials)


    Learn any endpoint''s exact response shape with **zero setup** — no key, no account. Every real path is mirrored under `/mock`:

    - `GET /mock` lists every mockable endpoint. - `GET|POST /mock/` returns a schema-accurate example response for that operation (e.g. `/mock/domain/listAll`). Append `?status=error` for the error shape. Mock responses touch no datastore, are identical in shape to the live API, and are signalled by an `X-Porkbun-Mock: true` header. Use it to build client code before you have credentials; switch to a sandbox key when you want real behavior with fake money. ## Quickstart


    **1. Get your API keys** — visit https://porkbun.com/account/api


    **2. Test connectivity**

    ```bash

    curl https://api.porkbun.com/api/json/v3/ip

    ```

    Returns your public IP. No credentials required. **3. Check domain availability** (also verifies your credentials)

    ```bash

    curl -X POST https://api.porkbun.com/api/json/v3/domain/checkDomain/example.com \

    -H "Content-Type: application/json" \

    -d ''{"apikey":"your_api_key","secretapikey":"your_secret_key"}''

    ```

    Returns `avail: "yes"/"no"` and `price` in USD. Returns an error if credentials are invalid. **4. Register the domain** — convert `price` to pennies (e.g. $9.73 → 973) for `cost`

    ```bash

    curl -X POST https://api.porkbun.com/api/json/v3/domain/create/example.com \

    -H "Content-Type: application/json" \

    -d ''{"apikey":"your_api_key","secretapikey":"your_secret_key","cost":973,"agreeToTerms":"yes"}''

    ```


    **5.'
  contact:
    name: Porkbun Support
    url: https://porkbun.com/support
  x-logo:
    url: https://porkbun.com/img/logo.png
servers:
- url: https://api.porkbun.com/api/json/v3
  description: Production
- url: https://api-ipv4.porkbun.com/api/json/v3
  description: Production (IPv4 only — use this if your client is on an IPv6 network and needs to reach the API over IPv4)
security:
- ApiKeyHeader: []
  SecretApiKeyHeader: []
tags:


# --- truncated at 32 KB (45 KB total) ---
# Full source: https://artifacts.apis.io/porkbun-com/openapi/porkbun-com-webhooks-api-openapi.yml