Skip to content
BlokloDocumentation

API keys and public API

Read projects, publishing status and form submissions, and republish a site from your own scripts and automation tools, with a workspace key.

The public Bloklo API is available at https://bloklo.com/api/v1. Every request must have an Authorization: Bearer <key> header with a workspace key. A key gives access only to the projects of the workspace in which it was created. Responses are JSON.

Creating a key

  1. Open Settings → API keys and choose New key.
  2. Enter a name (what the key is for), tick the scopes you need, optionally enter the allowed IP addresses and pick the validity (no expiry, 30 days, 90 days or 1 year).
  3. Choose Create key, then Copy. The full key is shown only in this window; after it is closed, the list keeps only the beginning (for example blk_Ab12Cd34…).

Keys are created, changed and revoked by people allowed to make changes in the workspace (in the team space: the Owner and Admin roles). The Viewer role only sees the list. A workspace can have at most 20 active keys. Creating, changing and revoking a key is recorded in the Change log, without the key itself.

Important

Store the key like a password: do not paste it into site code, a repository or messages. A key with the submissions scope gives access to the personal data of people who filled in forms.

Scopes

ScopeWhat it allows
projects:readProject list, project details and publishing status.
submissions:readForm submissions from published sites and the number of submissions in each form.
publishRepublishing a site that is already published, at the same address. The current version from the editor is published.

The scope and validity of an existing key cannot be changed. To change them, create a new key and revoke the old one. The name and the IP address list can be changed in the key's menu (Change name and IP addresses); the change applies immediately.

Allowed IP addresses

The list accepts single IPv4 and IPv6 addresses and CIDR ranges (for example 198.51.100.0/24), up to 20 entries. A request from an address outside the list gets a 403 ip_not_allowed response. An empty list means the key works from any address. In the key window, Add current address adds the address from which the panel was opened.

Endpoints

RequestScopeResult
GET /api/v1/keyanyThe name, scopes, IP addresses and expiry of the key used in the request. Useful for checking the connection.
GET /api/v1/projectsprojects:readdata: the workspace's projects, most recently changed first.
GET /api/v1/projects/{id}projects:readdata: one project.
GET /api/v1/projects/{id}/publicationprojects:readdata: whether the site is published, its address, the time of the last publication, the custom domain and its status, and review (pending or rejected when the publication awaits approval or was rejected).
GET /api/v1/projects/{id}/formssubmissions:readdata: the site's forms with submission counts (total without spam, new, spam).
GET /api/v1/projects/{id}/submissionssubmissions:readdata: submissions, newest first, plus page, limit, total. Parameters: form (form name), status (new, handled or spam; without it, everything except spam), since (ISO 8601 date, submissions from that moment), page (from 1), limit (1–100, 50 by default).
POST /api/v1/projects/{id}/republishpublishBuilds and publishes the current version of the site at its existing address, with the title, description and indexing setting from the last publication. data: the address and the publication time.

Example

curl -H "Authorization: Bearer blk_…" https://bloklo.com/api/v1/projects

A project in the response has the fields id, name, description, createdAt, updatedAt, templateId, published, slug, url (the published site's address or null), publishedAt and customDomain (domain, status). A submission has the fields id, form, status, data (the form fields), createdAt and handledAt. Test submissions sent from the editor preview are not returned.

Errors and limits

An error has the form {"error": {"code": "…", "message": "…"}}. The code field is stable and suitable for handling in a program, message is an English description.

HTTP status and `code`Meaning
401 invalid_keyThe key is missing, unknown, revoked, expired, or belongs to a blocked or deleted account.
403 ip_not_allowedThe address the request came from is not on the key's list.
403 insufficient_scopeThe key does not have the scope the endpoint requires.
404 not_foundThe project does not exist or belongs to another workspace.
409 not_publishedRepublishing a site that is not published. The first publication is done in the panel.
409 review_requiredThis version of the site needs approval before publishing; publish it from the panel.
422 blockedThe site contains elements that are not allowed for security reasons; ask the agent to fix them.
429 rate_limitedLimit exceeded: 120 requests per minute per key, republishing 10 times per hour per key, 30 failed authentication attempts per minute from one address.

Revoking and last use

The key list shows the creation date, the author, the last use and the address it came from. Revoke key in the key's menu disables it immediately and cannot be undone; revoked and expired keys stay in a separate part of the list. A key also stops working when the account of the person who created it is blocked or deleted. A key of an account that was given the Viewer role keeps read access only.

Tip

For automation tools (for example n8n, Make, Zapier), a plain HTTP request step with an Authorization header is enough. For scheduled jobs, the since parameter for submissions is convenient.

Something unclear or out of date? Contact us