prufy
Skip to the page

APIIntroduction

API

Prufy API

Prove a domain is yours with one DNS record, and keep it proven. Everything the Prufy app does, it does through this API, so anything you can do there you can build yourself.

Your first request

Send a domain. You get back a claim, and inside it the one TXT record that proves the domain is yours. No sign-up comes first: the response sets a session cookie, and that cookie is what makes the claim yours.

curl -X POST 'https://www.prufy.dev/api/v1/claims' \
  -c cookies.txt -b cookies.txt \
  -H 'content-type: application/json' \
  -d '{
  "input": "yourcompany.com"
}'

The part to act on is view.record: add it at the domain's DNS provider, then run a check or wait for ours. The whole answer is on the Create a claim page.

The record to add
{
  "record": {
    "type": "TXT",
    "host": "_prufy-challenge",
    "fullName": "_prufy-challenge.yourcompany.com",
    "value": "prufy-domain-verification=xwqyp4hnsmgqxceo2xd6orgeay",
    "ttl": 300
  }
}

Requests and responses are JSON. The base address is https://www.prufy.dev, and the whole API is described in one OpenAPI document, generated from the same schemas the server validates with.

The basics

Create a claim, add the record, run a check. Start to verified.

Sessions without sign-up, and the tokens that stand in for one.

One shape for every error, and what each kind means.

How often each thing can be done, and what a limited response says.

Versioning

Every route lives under /api/v1. Within a version, changes only add: a new route, a new optional field in a request, a new field in a response, or a new value in a list that says it can grow. Removing or renaming a field, changing its type, or making something required is a new version.

  • Ignore fields you don't know. A response may gain fields at any time.
  • Expect new values in open lists. An event's type, an error's kind and a check's trigger can gain values. Skip an event you don't know, and treat an unknown error by its HTTP status.
  • Watch for two headers. A deprecated address answers with Deprecation and Sunset, and a Link to its replacement.

The addresses from before versioning, like /api/claims for /api/v1/claims, still answer the same way, with those headers. They stay until at least 2027-06-01, and until the clients still calling them have moved. The unsubscribe address in alert emails never goes away.

Foundations

The seven statuses, what moves a claim between them, and when we check.

Every outcome a check can have, and the one thing that fixes it.

Re-checks, the grace period, alerts, and getting ownership back.

API reference

One page per route, each with the request in three languages and a real response.

Claims

  • POSTCreate a claim
  • GETList claims
  • GETRetrieve a claim
  • POSTRun a check
  • POSTGet a new code
  • POSTAbandon a claim
  • GETGet the record as a zone-file line

Setup links

Alerts

Signing in

Domain Connect

System

  • GETCheck the API is up

Development

  • GETInspect a name's DNS
  • POSTMove the clock forward
  • POSTRun the worker