Skip to main content
The Widgetic API is a REST API. It takes and returns JSON over HTTPS. The SDKs and the CLI are generated from the same contract, and you can download the OpenAPI specification for your own tooling.

Base URL

Every path in this reference is relative to:
GET /widgets is therefore https://api.widgetic.com/v1/widgets. Send every request over HTTPS.
The public embed endpoints, the ones under /embed, are the exception: they are served from https://api.widgetic.com, without /v1. A visitor’s browser calls them, so they take no key. See Embedding widgets.

Authentication

Send your API key in the Authorization header as a bearer token:
There are two kinds of key, and they work differently:
  • An organisation key (wdg_org_) is made in the dashboard under Settings → API keys. It acts as one workspace and works in that workspace only. Most endpoints in this reference take it.
  • A partner key (wgt_prt_) is made in the same place, in your partner’s home workspace, and is for platforms that run Widgetic for their own customers. The endpoints for managed users, editor sessions, credits, billing and notifications need it. An endpoint that needs one says so at the top of its page.
Keep keys on your server. A browser never holds one: to let a customer’s browser edit, make an editor session on your server and send its short-lived token instead. API keys lists what each kind of key can call and shows how to tell which one you hold. Read Authentication for scopes, plans and how to limit a key, and Partner overview if you are a partner. GET /tokens/validate tells you which account and workspace a key belongs to.

Requests and responses

Send Content-Type: application/json with a request body, and ask for application/json back. Every answer has the same envelope.
Branch on error.code, which is meant for programs, and not on error.message, which is meant for people. Quote error.correlationId when you write to the support team. The full list of codes is in Errors.

Response codes

Pagination

Lists take page (from 1) and size (20 by default, at most 100), and answer with a meta object that holds total, hasNextPage and hasPreviousPage. GET /widgets returns the whole list when you pass neither page nor size, so always page it. See Pagination.

Idempotency

Creating calls take an Idempotency-Key header, so you can retry after a timeout without making the thing twice. The reference lists the header on every call that takes it, and a call that requires it answers 400 without it. Send the same key when you retry. See Idempotency.

Rate limits

A key is counted over 15-minute windows, on its own: about 3,000 requests for a key and 1,000,000 for a partner key. Read the allowance that applies to a call in its RateLimit-Limit header, and wait Retry-After seconds after a 429. See Rate limits and Usage limits.
Do not poll for changes. A partner account can have signed webhooks sent to its server when an invoice is paid, credits run low or a customer publishes a widget, and polling counts against your rate limit. See Webhooks and events.

SDKs, CLI and specification

SDKs

Typed clients for TypeScript, Python, Go, Java, C#, Ruby, PHP and Bash.

CLI

Every REST call from a terminal, a script or CI.

OpenAPI

The specification this reference is built from, as JSON.

Ask the assistant

Every page has a menu at the top right: copy the page as Markdown, or open it in ChatGPT, Claude or Cursor with a question about it. The whole site is also available as llms.txt for your own tools. Need help? Write to the support team.