REST API endpoints and permissions

The OptinFlare routes are under /wp-json/optinflare/v1. Outside WordPress, authenticate with an API key and its secret (see REST API keys). A key needs the permission of the route, and its owner the matching WordPress capability.

Bash
curl 'https://example.com/wp-json/optinflare/v1/forms?per_page=20&page=1' \
  --header "X-OptinFlare-API-Key: $OPTINFLARE_API_KEY" \
  --header "X-OptinFlare-API-Secret: $OPTINFLARE_API_SECRET"

Permissions

  • forms:read, forms:write, forms:publish, forms:delete: read, edit, publish and delete forms. Publishing also requires forms:write.
  • submissions:read, submissions:write, submissions:export, submissions:delete: read submissions, add notes or send them again, export and delete them.
  • analytics:read: statistics.
  • integrations:read, integrations:write: list the integrations and their lists, tags and fields; connect, test and disconnect them.
  • automations:read, automations:write: lead magnet automations.
  • ai:use: AI features.
  • webhooks:use: forms that contain webhooks.
  • settings:read, settings:write and tools:read, tools:write: settings, import and export.

Main routes

  • Forms: GET /forms, GET /forms/{id}, POST /forms, PUT /forms/{id}, DELETE /forms/{id}, POST /forms/{id}/duplicate, GET /forms/{id}/export, POST /forms/import.
  • A/B variants (Pro): POST /forms/{id}/variant, DELETE /forms/{id}/variant/{variantId}.
  • Submissions: GET /submissions, GET /submissions/{id}, GET /submissions/export, POST /submissions/{id}/notes, POST /submissions/{id}/resend, DELETE /submissions/{id}, POST /submissions/bulk-delete.
  • Statistics: GET /stats/overview, /stats/chart, /stats/report, /stats/top-forms, /stats/form/{id}, /stats/submissions, /stats/funnel and, with Pro, /stats/ab/{id}.
  • Integrations: GET /providers, GET /providers/{provider}/audiences, /tags and /fields, POST /providers/{provider}/connect, POST /providers/{provider}/test, DELETE /providers/{provider}/connect.
  • Settings: GET and PUT on /settings/captcha, /settings/domain-blacklist, /settings/privacy and /settings/statistics.
  • AI (Pro): POST /forms/ai-generate, POST /forms/{id}/copilot/analyze.
  • Tools: GET /tools/info, POST /tools/export, POST /tools/import. A site-wide export or import requires several permissions at once, and an export made with a key never contains connection secrets.

Routes without a declared permission, such as API key management, webhook settings, the license or user preferences, are not available to API keys.

Errors and quotas

  • 401: credentials missing, invalid, expired or revoked, deleted owner, or a call over HTTP instead of HTTPS.
  • 403: missing permission, missing capability of the owner or restricted access to the form.
  • 429: the quota of the key is reached for this minute. The Retry-After header and data.retry_after give the wait in seconds.
  • 503: the quota could not be checked; the request was not run.

Quotas are counted per key and per minute, in windows that start on each UTC minute.

Last update