Porkbun Hosting API

Three products share these endpoints; the `sku` you pass to `/hosting/create` picks one: • **Secure Static Hosting**: you upload the files; Porkbun serves them over HTTPS. SKUs `PIXIESECURESTATIC…` • **Cloud for WordPress**: a managed WordPress site, managed through WordPress itself. SKUs `CLOUDWORDPRESS…` • **Link in Bio** (paid): a page of links, edited with the `/linkinbio` endpoints. SKUs `PIXIELINKSM1` and `PIXIELINKSY1`. The free plan is turned on with `/linkinbio/create`, not here. All three: `/hosting/plans`, `/hosting/create`, `/hosting/get`, `/hosting/updateAutoRenew`, `/hosting/delete`. Static hosting only: `/hosting/deploy`, `/hosting/files`, `/hosting/getFile`, `/hosting/makeDir`, `/hosting/deleteFile` (anything else returns `NOT_SUPPORTED_FOR_PRODUCT`). WordPress only: `/hosting/wpRequest` and `/hosting/wpUploadMedia` (edit content and add images, no credentials needed), `/hosting/createWpCredentials`, `/hosting/getWpCredentials`, `/hosting/deleteWpCredentials`, and the site management below. A domain's first purchase of a product is a 15-day free trial that auto-renews at the plan price; buying the same product again after cancelling is charged (one free trial per domain per product). **Cloud for WordPress site management:** `GET /hosting/get` shows the site's PHP and WordPress versions, SSL, storage, search visibility, staging and background jobs; `setPhpVersion`, `setWordPressVersion`, `reissueSsl` and `setSearchVisibility` change them; `backups`, `createBackup`, `deleteBackup` and `restoreBackup` manage backups (add `"staging": true` for the staging copy). **Staging:** `getStaging`, `createStaging`, `resetStaging`, `publishStaging`, `deleteStaging`, and its settings `setStagingGate` (password), `setStagingGuard` (outbound email/API) and `setStagingEnvironment`. **Site-share keys** (`/apikey/share`, permission `site`, one domain) can use every call here except `/hosting/create`, `/hosting/delete` and `/hosting/updateAutoRenew`.

GitHub OpenAPI

Operations 35

GET /hosting/plans List the hosting plans you can buy #
POST /hosting/create/{domain} Buy a hosting plan (static, WordPress or paid Link in Bio) #
GET /hosting/get/{domain} Get the hosting on a domain #
POST /hosting/deploy/{domain} Upload site files (static hosting only) #
GET /hosting/files/{domain} List site files (static hosting only) #
POST /hosting/getFile/{domain} Read files from a static site #
POST /hosting/deleteFile/{domain} Delete a site file (static hosting only) #
POST /hosting/delete/{domain} Cancel a hosting plan #
POST /hosting/makeDir/{domain} Create a directory (static hosting only) #
POST /hosting/wpRequest/{domain} Edit a WordPress site: one REST API call, run inside the site #
POST /hosting/wpUploadMedia/{domain} Add an image or file to a WordPress site's media library #
POST /hosting/createWpCredentials/{domain} Mint WordPress REST API credentials (WordPress only) #
GET /hosting/getWpCredentials/{domain} List WordPress application passwords (WordPress only) #
POST /hosting/deleteWpCredentials/{domain} Revoke WordPress application passwords (WordPress only) #
POST /hosting/updateAutoRenew/{domain} Turn hosting auto-renew on or off #
POST /hosting/setPhpVersion/{domain} Set the PHP version #
POST /hosting/setWordPressVersion/{domain} Set the WordPress version #
POST /hosting/reissueSsl/{domain} Restart SSL issuance #
POST /hosting/setSearchVisibility/{domain} Show or hide the site from search engines #
GET /hosting/backups/{domain} List backups #
POST /hosting/backups/{domain} List backups #
POST /hosting/createBackup/{domain} Take an on-demand backup #
POST /hosting/deleteBackup/{domain} Delete an on-demand backup #
POST /hosting/restoreBackup/{domain} Restore from a backup #
GET /hosting/getStaging/{domain} Get the staging site #
POST /hosting/getStaging/{domain} Get the staging site #
POST /hosting/createStaging/{domain} Create a staging site #
POST /hosting/resetStaging/{domain} Rebuild the staging site #
POST /hosting/publishStaging/{domain} Publish staging to the live site #
POST /hosting/deleteStaging/{domain} Delete the staging site #
POST /hosting/setStagingGate/{domain} Set staging password protection #
POST /hosting/setStagingGuard/{domain} Block or allow outbound email and API calls from staging #
POST /hosting/setStagingEnvironment/{domain} Set the staging environment type #
POST /hosting/manifest/{domain} Build an agent manifest for a site and return the bytes to sign #
POST /hosting/publishManifest/{domain} Publish the signed agent manifest to the site #

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-hosting-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-hosting-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Porkbun API v3 Hosting 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 (144 KB total) ---
# Full source: https://artifacts.apis.io/porkbun-com/openapi/porkbun-com-hosting-api-openapi.yml