API docs

zpe-reviews

mount /reviews · base https://zpe.vc/reviews · v0.3.1 · 10 operations · 8 write · 0 need no account · wip

the document this app serves now. Contract: https://zpe.vc/reviews/_/api/v1/openapi.json · sha256 6b5cb343674b

GET /_/api/v1/reviews Every review this account holds, newest first, with what verified it and its state getReviews

Every review this account holds, newest first, with what verified it and its state

Parameters

No parameters.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200The reviews this account holds, newest first, each with the state it is in and the purchase that verified it.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

Every review this account holds, newest first, with what verified it and its state, with a token from the door.

GET /_/api/v1/reviews
curl -X GET 'https://zpe.vc/reviews/_/api/v1/reviews' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

GET /_/api/v1/wall The two populations and their counts, with the gap published only above the minimum sample getWall

The two populations and their counts, with the gap published only above the minimum sample

Parameters

nameinrequiredtypenotes
businessqueryyesstringThe business whose wall is being read, by its public id: a business that belongs to the calling account. A missing value is a 400, and an id the account does not own is a 404.

Request body

None: this operation takes its arguments in the path and the query.

Responses

statusmeaningbody
200Both populations and their counts, with the gap present only above the minimum sample.object
400`business` is required: name the business by its public id, `?business=<id>`.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No business with that public id belongs to this account.object
429Too many requests: this key has spent its request ceiling. Retry after the period the answer names.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

The two populations and their counts, with the gap published only above the minimum sample, with a token from the door.

GET /_/api/v1/wall
curl -X GET 'https://zpe.vc/reviews/_/api/v1/wall?business=string' \
  -H 'Authorization: Bearer $ZPE_TOKEN'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/erasures Honour an erasure request by the person's address: the contact record goes, the review becomes a tombstone, one event records it postErasures

Honour an erasure request by the person's address: the contact record goes, the review becomes a tombstone, one event records it

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
businessstringyes
contactstringyes

Responses

statusmeaningbody
200The erasure was honoured — `{erased, classes, reviews, replies}` — or, for `dry_run`, `{dry_run, would_erase, reviews, replies}`.object
400The request could not be read: a JSON body naming `business` and `contact` is required.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No business with that public id belongs to this account.object
409No record for that address now: nothing under this business matches it, which is also what an erasure already honoured looks like. The record is gone and this API keeps no marker of who was erased.object
429Too many requests: this key has spent its request ceiling, or this account has used its write allowance for the hour.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

Honour an erasure request by the person's address: the contact record goes, the review becomes a tombstone, one event records it, with a token from the door.

POST /_/api/v1/erasures
curl -X POST 'https://zpe.vc/reviews/_/api/v1/erasures' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "business": "string",
  "contact": "string"
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/replies/forward Turn the copy of a tenant's replies on or off and say where it goes. The stored inbox is never affected postRepliesForward

Turn the copy of a tenant's replies on or off and say where it goes. The stored inbox is never affected

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
businessstringyes
forward_tostringno
enabledbooleanyes

Responses

statusmeaningbody
200The setting was stored: `{ok, enabled, forward_to}`.object
400The request could not be read: a JSON body naming `business` and `enabled` is required, and a forward needs a full address to copy replies to.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No business with that public id belongs to this account.object
429Too many requests: this key has spent its request ceiling, or this account has used its write allowance for the hour.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

Turn the copy of a tenant's replies on or off and say where it goes. The stored inbox is never affected, with a token from the door.

POST /_/api/v1/replies/forward
curl -X POST 'https://zpe.vc/reviews/_/api/v1/replies/forward' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "business": "string",
  "forward_to": "string",
  "enabled": false
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/appeals Decide a removal appeal. Refused when the deciding principal is the one who removed it, so the chain shows two signatures postAppeals

Decide a removal appeal. Refused when the deciding principal is the one who removed it, so the chain shows two signatures

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
reviewstringyes
decision"restore" | "uphold"yes
notestringno

Responses

statusmeaningbody
200The decision was recorded: `{ok, hash}` names the chain entry.object
400The request could not be read: a JSON body naming `review` and `decision` is required.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No review with that id belongs to this account.object
409The store refused the decision: the principal that removed this review cannot decide its appeal, or the review is not removed and has no removal to decide.object
429Too many requests: this key has spent its request ceiling, or this account has used its write allowance for the hour.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

Decide a removal appeal. Refused when the deciding principal is the one who removed it, so the chain shows two signatures, with a token from the door.

POST /_/api/v1/appeals
curl -X POST 'https://zpe.vc/reviews/_/api/v1/appeals' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "review": "string",
  "decision": "restore",
  "note": "string"
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/invitations Create an invitation per eligible purchase and, when a sender is configured, send it. One purchase buys one review, and the address is never stored postInvitations

Create an invitation per eligible purchase and, when a sender is configured, send it. One purchase buys one review, and the address is never stored

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
businessstringyes
recipientsarray of objectyes
window_daysnumberno
sendbooleanno

Responses

statusmeaningbody
200What the campaign produced — `{issued, planned, refused, sent, links}` — with the links in the answer whether or not a sender is configured, because the tokens exist in no other place.object
400The request could not be read: a JSON body naming `business` and between one and 200 recipients is required.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No business with that public id belongs to this account.object
429Too many requests: this key has spent its request ceiling, or this account has used its write allowance for the hour.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

Create an invitation per eligible purchase and, when a sender is configured, send it. One purchase buys one review, and the address is never stored, with a token from the door.

POST /_/api/v1/invitations
curl -X POST 'https://zpe.vc/reviews/_/api/v1/invitations' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "business": "string",
  "recipients": [
    {
      "purchase": "string",
      "contact": "string"
    }
  ],
  "window_days": 0,
  "send": false
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/businesses Create a business under this account. Its public id is the URL, the claim record's label and the reply local part at once postBusinesses

Create a business under this account. Its public id is the URL, the claim record's label and the reply local part at once

Parameters

nameinrequiredtypenotes
Idempotency-KeyheadernostringThe caller's own retry handle. The same key sent twice writes one business and answers the business the first call answered. A header that is there and empty names nothing, so it is refused rather than read as a create.

Request body application/json · required

fieldtyperequirednotes
namestringyes
public_idstringyes
countrystringyes

Responses

statusmeaningbody
200That `Idempotency-Key` was already here: nothing was written, and the business is the one the first call answered with — even when this request's words moved.object
201The business this call created, as `{business, id}`. `business` is the public id, which is the URL, the claim record's label and the reply local part at once.object
400The request could not be readobject
401The credential is missing or does not open this accountobject
403This account may not do thatobject
404Nothing is hereobject
409That public id is taken. It becomes the URL, the claim label and the reply address at once, so it is one name per business and the caller chooses another.object
429Too many requestsobject

Example

Create a business under this account. Its public id is the URL, the claim record's label and the reply local part at once, with a token from the door.

POST /_/api/v1/businesses
curl -X POST 'https://zpe.vc/reviews/_/api/v1/businesses' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "name": "string",
  "public_id": "string",
  "country": "string"
}'
200 application/json
{
  "business": "string",
  "id": "string"
}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/purchases Record purchases against a business, hashing each address. A purchase is the proof a review rests on, so a duplicate reference is refused rather than counted twice postPurchases

Record purchases against a business, hashing each address. A purchase is the proof a review rests on, so a duplicate reference is refused rather than counted twice

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
businessstringyes
purchasesarray of objectyes

Responses

statusmeaningbody
200What the batch wrote — `{recorded, purchases, refused}` — one entry per row, so a partly refused batch names the rows that were refused and why.object
400The request could not be read: a JSON body naming `business` and between one and 500 purchases is required.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No business with that public id belongs to this account.object
429Too many requests: this key has spent its request ceiling, or this account has used its write allowance for the hour.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

Record purchases against a business, hashing each address. A purchase is the proof a review rests on, so a duplicate reference is refused rather than counted twice, with a token from the door.

POST /_/api/v1/purchases
curl -X POST 'https://zpe.vc/reviews/_/api/v1/purchases' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "business": "string",
  "purchases": [
    {
      "ref": "string",
      "amount_cents": 0,
      "currency": "string",
      "occurred_at": 0,
      "contact": "string",
      "proof_kind": "receipt",
      "proof_ref": "string"
    }
  ]
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/claims State the domain a business owns and get the record name and value that prove it, or the page tag instead postClaims

State the domain a business owns and get the record name and value that prove it, or the page tag instead

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
businessstringyes
domainstringyes

Responses

statusmeaningbody
200The challenge to publish — `{business, domain, already_claimed, dns, page, note}` — with the record that wins when both proofs exist.object
400The request could not be read: a JSON body naming `business` and a domain is required, and the domain is given alone, without a scheme or a path.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No business with that public id belongs to this account.object
429Too many requests: this key has spent its request ceiling, or this account has used its write allowance for the hour.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

State the domain a business owns and get the record name and value that prove it, or the page tag instead, with a token from the door.

POST /_/api/v1/claims
curl -X POST 'https://zpe.vc/reviews/_/api/v1/claims' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "business": "string",
  "domain": "string"
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.

POST /_/api/v1/claims/verify Read the TXT record and the page, and mark the business claimed when either answers. Until then it can publish nothing postClaimsVerify

Read the TXT record and the page, and mark the business claimed when either answers. Until then it can publish nothing

Parameters

No parameters.

Request body application/json · required

fieldtyperequirednotes
businessstringyes

Responses

statusmeaningbody
200Claimed: `{claimed, method, reason, domain}` names which proof answered.object
400The request could not be read: a JSON body naming `business` is required, and the business states a domain before it can be verified.object
401The credential is missing, or the door did not recognise it.object
403This key may not do that: it is granted a different app, or the door named no account to scope the request to.object
404No business with that public id belongs to this account.object
409Not proved: neither the DNS TXT record nor the page tag answered, so the business is not claimed and can publish nothing yet.object
429Too many requests: this key has spent its request ceiling, or this account has used its write allowance for the hour.object
500This app failed while answeringobject
503A service this app needs did not answer, so the request could not be checked.object

Example

Read the TXT record and the page, and mark the business claimed when either answers. Until then it can publish nothing, with a token from the door.

POST /_/api/v1/claims/verify
curl -X POST 'https://zpe.vc/reviews/_/api/v1/claims/verify' \
  -H 'Authorization: Bearer $ZPE_TOKEN' \
  -H 'content-type: application/json' \
  -d '{
  "business": "string"
}'
200 application/json
{}

The example is generated from the schema in the contract: the shape is the document's, the values are placeholders.