Developers Dashboard

From a description of a business to a live website in one request, then change a block and publish it.

One request starts a full build: research, a design, the copy, pages and images, then deploy and a review pass. This page takes you from a new key to a live site, then shows how to change it.

1. Make a key

In the dashboard, open Settings, Developers and create an account key. It acts as your account, on your sites. Leave the generate scope on (it is on by default for account keys). The key is shown once, so keep it somewhere safe.

Shell
export UNVOP_KEY="unvop_live_ab12cd34_…"

Check it works. GET /me answers with the key's kind, scopes and sites:

curl https://api.unvop.com/v1/me \
  -H "Authorization: Bearer $UNVOP_KEY"

2. Start a build

Describe the business in two or three sentences or more. Real details make a better site: what it does, who for, where, and what makes it different.

curl https://api.unvop.com/v1/builds \
  -H "Authorization: Bearer $UNVOP_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: harbour-bakery-1" \
  -d '{
    "prompt": "Harbour Bakery is a family bakery in Falmouth. Sourdough, pastries and celebration cakes, open 7 to 3 every day, with a cafe upstairs looking over the harbour.",
    "name": "Harbour Bakery",
    "subdomain": "harbour-bakery"
  }'

The answer is 202 Accepted with the build:

JSON
{
  "job": {
    "id": "job_…",
    "status": "queued",
    "stage": "queued",
    "message": "Waiting for a builder",
    "siteId": null,
    "url": null
  }
}

The Idempotency-Key makes the request safe to send again: a repeat gets the same build back instead of starting a second one. Check a subdomain first with GET /subdomains/harbour-bakery if you want to be sure it is free.

3. Follow it

A build takes several minutes. Stream its progress as Server-Sent Events: a build event each time the stage or message changes, then done.

Shell
curl -N https://api.unvop.com/v1/builds/job_…/events \
  -H "Authorization: Bearer $UNVOP_KEY" \
  -H "Accept: text/event-stream"
The stream
event: build
data: {"id":"job_…","status":"running","stage":"researching","message":"Reading about Harbour Bakery", …}

event: done
data: {"status":"succeeded","siteId":"site_…","url":"https://harbour-bakery.unvop.dev","error":null}

Or ask now and then with GET /builds/{buildId}. When status is succeeded, siteId and url say where the site is. Builds and progress covers reconnecting, cancelling and retrying.

4. Change a block

Read the homepage (index is the homepage). Note the ETag header and a block id from blocks:

Shell
curl -i https://api.unvop.com/v1/sites/site_…/pages/index \
  -H "Authorization: Bearer $UNVOP_KEY"

Then change that block's props. Props you leave out are kept, and If-Match makes sure nobody changed the page since you read it:

Shell
curl -X PATCH https://api.unvop.com/v1/sites/site_…/pages/index/blocks/b_… \
  -H "Authorization: Bearer $UNVOP_KEY" \
  -H "Content-Type: application/json" \
  -H 'If-Match: "…the ETag…"' \
  -d '{ "props": { "heading": "Fresh bread from 7am" } }'

5. Publish

Changes are drafts until you publish. Each publish keeps a revision you can restore later.

Shell
curl -X POST https://api.unvop.com/v1/sites/site_…/pages/index/publish \
  -H "Authorization: Bearer $UNVOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "note": "New opening hours" }'

The change is live. From here: