API reference

Platform API v1

The public API for published code sites. Calls use publishable keys and same-origin /api/v1/* routes.

Getting a key

Published and preview code sites receive internal keys automatically. To connect another integration, open the business’s Settings → Developers → Manage credentials.

Create a named key with the permissions the integration needs. Copy it before closing the creation dialog; the list never reveals it again.

  1. Open Settings → Developers

    Choose the business that owns the site, open Settings, then Developers → Manage credentials. You must be an owner or administrator of that exact organization, with organization-wide membership. A role in another organization or access limited to selected businesses does not unlock this screen.

  2. Create API key

    Under Platform API keys, choose Create API key. Enter a Name (1–60 characters) and select at least one option under Permissions. Use a separate key for each integration and select only what it needs.

  3. Copy once, then close

    In API key created, choose Copy credential, store it securely, then choose Done. Closing the dialog clears the displayed value. Nimlio stores only a hash for keys you create here; you cannot reveal the key again.

  4. Review and revoke

    The list shows the name, prefix, permissions, status, last use and creation date. Choose Revoke and confirm to stop access immediately. To change permissions or replace a lost key, create another and revoke the old one.

Developers settings with Platform API keys and Connect an AI agent panels.
The Developers screen keeps integration keys and site MCP connections together.
Site and plan requirements

Create a website first. Creating API keys requires Pro or Enterprise; Starter shows an upgrade dialog that opens billing for the site’s organization. Listing and revoking your own keys remain available after a downgrade. MCP connections additionally require code mode.

Available API permissions: content:read, catalog:read, booking:read, booking:write, leads:write, orders:write, events:write. Self-serve keys start with nk_pub_; only publishable keys authenticate /api/v1.

Managed by Nimlio

Nimlio provisions internal keys for site preview and publishing automatically. Rows marked Managed by Nimlio have no Revoke action. The server supplies the managed boolean; a key’s name alone does not make it managed. Self-serve keys remain revocable even if their names resemble internal keys. Internal provisioning retains the material it needs for embeds; self-serve creation does not.

For scripts, use your signed-in session with the management endpoints below. Creation accepts only name and optional scopes (a non-empty array); omitting scopes grants all seven, so set them explicitly. It returns 201, with data.key only in that response. List returns a metadata array in data, including managed, never the key or hash. Revoke returns 200; trying to revoke a managed key returns 409 conflict, with reason managed_api_key. Create, revoke and unsuspend are audited alongside their mutations. Suspension is a server status; Developers exposes create, list and revoke.

Session-authenticated key management
curl -X POST "https://<your-nimlio-host>/api/sites/<site-id>/api-keys" \
-b "<session cookie>" \
-H "Origin: https://<your-nimlio-host>" \
-H "Content-Type: application/json" \
-d '{"name":"Catalog integration","scopes":["catalog:read"]}'

curl "https://<your-nimlio-host>/api/sites/<site-id>/api-keys" \
-b "<session cookie>"

curl -X DELETE "https://<your-nimlio-host>/api/sites/<site-id>/api-keys/<key-id>" \
-b "<session cookie>" \
-H "Origin: https://<your-nimlio-host>"

Rate limits and daily quota

Limits apply per key and IP address each minute. Over the limit you get 429 rate_limited, except POST /api/v1/events: excess events are silently dropped and the response is still 204.

  • Reads: 800 per minute.
  • Slots, order status and events: 60 per minute.
  • Quotes and carts: 30 per minute.
  • Booking and order writes: 10 per minute.
  • Leads and newsletter: 5 per minute.
  • Photo and proof uploads: 3 per minute.

On top of that, newsletter sign-ups are capped at 100 per business per hour and cart writes at 2,000 per business per hour.

Each key also has a daily quota, 50,000 requests by default (it can differ by plan or deployment). Days are counted in the America/Bogota time zone.

Recipes

Copy-paste examples for the most common integration tasks. They use the placeholder key nk_pub_xxxxxxxx and your site's own origin; replace both with your own values.

Authenticate with a publishable key

Send the key in ONE of two headers: Authorization with a Bearer value, or X-Nimlio-Key. If both are sent with different values the request is rejected with 401 invalid_api_key, and no key at all is 401 missing_api_key. Secret keys that start with nk_sec_ are not accepted by /api/v1. A suspended key answers 403 api_key_suspended, and a password-protected site answers 403 site_locked for visitor reads. Publishable keys are safe to ship in browser code: they only read published data and write visitor-originated records.

curl https://your-site.example/api/v1/site \
-H "Authorization: Bearer nk_pub_xxxxxxxx"

# equivalent header form
curl https://your-site.example/api/v1/site \
-H "X-Nimlio-Key: nk_pub_xxxxxxxx"

Scopes: one per endpoint

Every endpoint in the reference declares exactly one scope, shown as a chip, and the key must hold that exact string. The scopes are content:read, catalog:read, booking:read, booking:write, leads:write, orders:write, and events:write. A key without the required scope gets the 403 response below.

curl https://your-site.example/api/v1/products \
-H "Authorization: Bearer nk_pub_xxxxxxxx"
{
"ok": false,
"error": {
"code": "forbidden",
"reason": "missing_scope",
"message": "API key is missing the required scope"
}
}

Use the filter in the reference to list every endpoint a scope unlocks, for example type orders:write.

Paginate catalog lists

Catalog lists accept limit (default 50, maximum 100) plus either offset or the cursor from the previous meta.nextCursor. When both are sent, offset wins, and a malformed cursor is 400 invalid_cursor. Never parse a cursor: pass it back as is.

const headers = { Authorization: "Bearer nk_pub_xxxxxxxx" };
const base = "https://your-site.example/api/v1";

async function allProducts() {
const items = [];
let cursor = null;
do {
const url = new URL(`${base}/products`);
url.searchParams.set("limit", "100");
if (cursor) url.searchParams.set("cursor", cursor);
const res = await fetch(url, { headers });
const body = await res.json();
if (!body.ok) throw new Error(body.error.code);
items.push(...body.data);
cursor = body.meta.hasMore ? body.meta.nextCursor : null;
} while (cursor);
return items;
}
{ "ok": true, "data": [], "meta": { "nextCursor": "100", "hasMore": true, "limit": 100 } }

CMS items differ: the items endpoint uses limit (default 25, maximum 100) and an opaque cursor, and returns data.items, data.nextCursor, and data.hasMore instead of a top-level meta.

Handle the error envelope

Success is always ok true with data, and lists add meta. Failure is always ok false with an error object that has code, message, and optionally reason, fieldErrors, values, details, and requestId. The code is a small stable vocabulary: invalid_input 400 (422 when the request is well formed but cannot be processed, such as a rejected upload), unauthenticated 401, forbidden 403, not_found 404, method_not_allowed 405, conflict 409, gone 410, limit_reached 409 or 402, payload_too_large 413, unsupported_media 415 or 406, rate_limited 429, unavailable 503, internal 500. The reason gives the specific cause, such as missing_scope, invalid_cursor, business_closed (410, the store is closed), or site_unpublished and site_not_found (404, the site is not being served).

async function nimlioFetch(path, init = {}) {
const res = await fetch(`https://your-site.example/api/v1${path}`, {
...init,
headers: { Authorization: "Bearer nk_pub_xxxxxxxx", "Content-Type": "application/json", ...init.headers },
});
if (res.status === 204) return null; // e.g. POST /events has no body
const body = await res.json();
if (body.ok) return body.data;
const { code, reason, message, fieldErrors, requestId } = body.error;
switch (code) {
case "invalid_input": // 400 — fieldErrors maps field -> message
throw new Error(`Fix the form: ${JSON.stringify(fieldErrors)}`);
case "unauthenticated": // 401 — reason: missing_api_key | invalid_api_key
case "forbidden": // 403 — reason: missing_scope | api_key_suspended | site_locked
throw new Error(`Key problem (${reason})`);
case "not_found": // 404
return null;
case "rate_limited": // 429 — back off and retry
await new Promise((r) => setTimeout(r, 1000));
return nimlioFetch(path, init);
default: // conflict 409, limit_reached 409/402, internal 500, ...
throw new Error(`${code}: ${message} (request ${requestId ?? "n/a"})`);
}
}

Quote requestId when you contact support. Analytics beacons (POST /api/v1/events) may answer 204 with no body.

Quote an order: prices are chosen server-side

The quote body is closed to selections: items, customer location, discount or gift codes, and the shipping rate. Any price, total, discount, currency, or businessId field is rejected with 400 client_order_fields_not_allowed. Amounts in the response are COP centavos.

curl -X POST https://your-site.example/api/v1/orders/quote \
-H "Authorization: Bearer nk_pub_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"items":[{"id":"<product-id>","type":"product","quantity":2}],"customerCity":"Bogotá","discountCode":"BIENVENIDO"}'

Reference

56 of 56 endpoints

Commerce

Storefront orders, quotes, carts, cart offers, payment proofs, reference photos, and affiliate visits.

POST/api/v1/affiliate-visitspublishable key

Record an affiliate link visit (returns a signed attribution token)

catalog:read
GET/api/v1/carts/{token}publishable key

Restore a cart snapshot

Returns 404 not_found until the business has this feature turned on.

orders:write
PUT/api/v1/carts/{token}publishable key

Save a cart snapshot (restore and abandoned-cart capture)

Returns 404 not_found until the business has this feature turned on.

orders:write
POST/api/v1/offers/{offerId}/viewspublishable key

Record a cart upsell offer view (always 204)

catalog:read
GET/api/v1/offers/cartpublishable key

Cart upsell offers for the given products

catalog:read
POST/api/v1/orderspublishable key

Create a storefront order checkout

orders:write
POST/api/v1/orders/{orderId}/payment-proofpublishable key

Upload the payment proof of a pending transfer order

orders:write
POST/api/v1/orders/{orderId}/resumepublishable key

Regenerate the checkout URL for a pending online order

orders:write
GET/api/v1/orders/{orderId}/statuspublishable key

Poll storefront order status

orders:write
POST/api/v1/orders/quotepublishable key

Quote a storefront order

orders:write
POST/api/v1/reference-photospublishable key

Upload a reference photo for a product that accepts one

orders:write

Booking

Availability, bookings, deposits, and booking management tokens.

POST/api/v1/booking/appointmentspublishable key

Create booking

booking:write
GET/api/v1/booking/contextpublishable key

Booking context

booking:read
POST/api/v1/booking/deposit-checkoutpublishable key

Create booking deposit checkout

booking:write
POST/api/v1/booking/discount-quotepublishable key

Quote a booking discount code (changes nothing)

booking:read
POST/api/v1/booking/gift-quotepublishable key

Quote a gift card against a booking deposit + tip (no mutation)

booking:read
GET/api/v1/booking/manage/{token}publishable key

Load booking by manage token

booking:read
POST/api/v1/booking/manage/{token}publishable key

Manage booking by token

booking:write
POST/api/v1/booking/manage/{token}/cancelpublishable key

Cancel booking by token

booking:write
POST/api/v1/booking/manage/{token}/reschedulepublishable key

Reschedule booking by token

booking:write
GET/api/v1/booking/slotspublishable key

Server-recomputed booking slots

booking:read

Catalog

Published services, products, collections, reviews, staff, galleries, and properties, plus catalog search.

GET/api/v1/catalogpublishable key

Published catalog aggregate

catalog:read
GET/api/v1/collectionspublishable key

Published collections

catalog:read
GET/api/v1/collections/{handle}publishable key

Published collection

catalog:read
GET/api/v1/collections/{handle}/productspublishable key

Published products of a collection

catalog:read
GET/api/v1/packagespublishable key

Service packages sold online

catalog:read
GET/api/v1/productspublishable key

Published products

catalog:read
GET/api/v1/products/{id}publishable key

Published product detail

catalog:read
GET/api/v1/products/{id}/reviewspublishable key

Approved reviews of a product

catalog:read
GET/api/v1/propertiespublishable key

Published properties

catalog:read
GET/api/v1/properties/{id}publishable key

Published property detail

catalog:read
GET/api/v1/servicespublishable key

Published services

catalog:read
GET/api/v1/services/{id}publishable key

Published service detail

catalog:read
GET/api/v1/staffpublishable key

Published staff

catalog:read
GET/api/v1/staff/{id}publishable key

Published staff detail

catalog:read

CMS

Published custom collections and content records.

GET/api/v1/cms/collectionspublishable key

Published CMS collections

content:read
GET/api/v1/cms/collections/{slug}/itemspublishable key

Published CMS collection items

content:read
GET/api/v1/cms/items/{slug}publishable key

Published CMS item

content:read
GET/api/v1/cms/items/{slug}/commentspublishable key

Approved comments of a published blog post (oldest first)

content:read
POST/api/v1/cms/items/{slug}/commentspublishable key

Submit a comment on a published blog post (held for moderation)

leads:write
GET/api/v1/cms/items/by-id/{id}/commentspublishable key

Approved comments of a published blog post (oldest first)

content:read
POST/api/v1/cms/items/by-id/{id}/commentspublishable key

Submit a comment on a published blog post (held for moderation)

leads:write

Content

Site shell and published page content.

GET/api/v1/contentpublishable key

Published content bundle

Returns 404 not_found until the business has this feature turned on.

content:read
GET/api/v1/sitepublishable key

Published site shell

content:read

Engagement

Leads, forms, newsletter and back-in-stock sign-ups, analytics events, and experiment assignment.

POST/api/v1/eventspublishable key

Analytics beacon

events:write
GET/api/v1/experiments/assignmentpublishable key

Experiment assignment for this visitor

Returns 404 not_found until the business has this feature turned on.

content:read
POST/api/v1/forms/{formId}/submissionspublishable key

Submit a generic form

leads:write
POST/api/v1/leadspublishable key

Create a lead

leads:write
POST/api/v1/newsletter/subscribepublishable key

Subscribe a contact to the newsletter (marketing consent)

Returns 404 not_found until the business has this feature turned on.

leads:write
POST/api/v1/restock/subscriptionspublishable key

Request a back-in-stock alert (single-purpose consent)

Returns 404 not_found until the business has this feature turned on.

leads:write

Meta

Health and public OpenAPI contract endpoints.

GET/api/v1/healthno auth

Platform API health

No key
GET/api/v1/openapi.jsonno auth

Platform API OpenAPI 3.1 contract

No key

Responses use the { ok, data | error } envelope, except analytics events that may return 204.