API Bearer Auth
The API Bearer Auth plugin enables authentication for the REST API by using JWT access an refresh tokens. After the user logs in, the access and refresh tokens are returned and can be used for the next requests. Issued tokens can be revoked from within the users admin screen. See below for the endpoints. Note that after activating this plugin, all REST API endpoints will need to be authenticated, unless the endpoint is whitelisted in the api_bearer_auth_unauthenticated_urls filter (see FAQ for how to use this filter). JWT Access tokens can be formatted as JWT tokens. For this to work, you first have to create a secret and add it to the wp-config.php file. If you don’t do this, access tokens will work also, but are just random strings. To create a random secret key, you can do for example: base64_encode(openssl_random_pseudo_bytes(64)); And then add the result to wp-config: define('API_BEARER_JWT_SECRET', 'mysecretkey'); If you have problems, you can verify your JWT tokens at: https://jwt.io/ Revoke tokens This plugin adds a column to the users table in de admin where you can see when a token expires. You can also revoke tokens by selection the “Revoke API tokens” from the bulk actions select box. API endpoints Note that all endpoints expect JSON in the POST body. Login Endpoint: POST /api-bearer-auth/v1/login Request body: Note: client_name is optional. But if you use it, make sure to use it as well for the refresh call! {"username": "my_username", "password": "my_password", "client_name": "my_app"} Response: { "wp_user": { "data": { "ID": 1, "user_login": "your_user_login", // other default WordPress user fields } }, "access_token": "your_access_token", "expires_in": 86400, // number of seconds "refresh_token": "your_refresh_token" } Make sure to save the access and refresh token! Refresh access token Endpoint: POST /api-bearer-auth/v1/tokens/refresh Request body: Note: client_name is optional. But if you did use it for the login call, make sure to use it here as well! {"token": "your_refresh_token", "client_name": "my_app"} Response success: { "access_token": "your_new_access_token", "expires_in": 86400 } Response when sending a wrong refresh token is a 401: { "code": "api_api_bearer_auth_error_invalid_token", "message": "Invalid token.", "data": { "status": 401 } } Do a request After you have the access token, you can make requests to authenticated endpoints with an Authorization header like this: Authorization: Bearer Note that Apache sometimes strips out the Authorization header. If this is the case, make sure to add this to the .htaccess file: RewriteCond %{HTTP:Authorization} ^(.*) # Don't know why, but some need the line below instead of the RewriteRule line # SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1] If you are not logged in or you send an invalid access token, you get a 401 response: { "code": "api_bearer_auth_not_logged_in", "message": "You are not logged in.", "data": { "status": 401 } } Important update Update immediately if you’re using a version below 20200807. Before this version all access tokens were updated when calling the refresh callback. If you are affected by this the fastest solution is to execute this query: update wp_user_tokens set access_token_valid = NOW(); This will invalidate all access tokens. This means that all users need to refresh their access token and will get a new access token and a unique one this time. A big thank to @harchvertelol for reporting this and suggesting the fix as well!
Top keywords
- token19×3.23%
- access17×2.89%
- tokens14×2.38%
- refresh12×2.04%
- access token10×1.70%
- api9×1.53%
- authorization7×1.19%
- bearer6×1.02%
- jwt6×1.02%
- user6×1.02%
- endpoints5×0.85%
- login5×0.85%
Webhook Actions – build automations and integrations with AI help
Describe the integration you want. The AI builds it. Webhook Actions ships with Build with AI — an in-admin agent that turns a plain-language request like “When a Contact Form 7 form is submitted, send it as JSON to my n8n webhook” into a working, tested automation. The agent proposes a plan you can review and edit, then creates the webhook, captures a real example payload from your site, maps the fields, sets dispatch conditions, probes your endpoint, and sends a test delivery. Nothing goes live without your confirmation — new webhooks are always created disabled, and you can undo the last change with one click. 📖 Full documentation at wpwebhooks.org/docs/ What you can connect Sources — anything in WordPress that fires an action. Webhook Actions turns any do_action into a trigger, so form submissions, WooCommerce orders, user registrations, post publishes and your own custom plugin events can all start an automation. That covers Elementor Forms, WPForms, Forminator, Fluent Forms, Gravity Forms, WooCommerce and your own code — there is no per-plugin add-on to hunt down. Contact Form 7 and IvyForms go one step further with built-in support: their submissions are normalized into clean JSON payloads automatically. Destinations — any HTTP endpoint. The plugin sends outgoing webhooks to anything that accepts a request: an n8n, Make, Zapier or Pabbly webhook node, a Slack or Discord incoming-webhook URL for order and form notifications, Airtable, Google Sheets, Mailchimp, HubSpot, Salesforce, Notion, your CRM, an internal microservice, or an AI agent API. There are no bundled per-service connectors and none are needed — point a webhook at a URL, map the fields, and send. Every delivery is queued, retried on failure and logged with full request and response history. That makes it a no-code way to sync WordPress data outward: describe what you want in chat and let the AI build it, or wire it up by hand in the admin UI. No PHP required either way. Bring your own AI — free options included WordPress 7.0 AI Client — if your site already has an AI provider connected (Settings → Connectors), the builder uses it directly; the plugin stores no keys Your own API key — connect Anthropic, OpenAI, or Google in the builder; keys are encrypted in the Credentials Vault and never returned over the API Free to run — a free Google AI Studio key gives you Gemini at no cost: step-by-step tutorial Automatic fallback — if a provider is rate-limited mid-build, the agent switches to another connected provider and keeps going What the AI works from The agent doesn’t guess — it works from your site’s real data. It maps fields against actually captured payloads, edits existing webhooks by name or id instead of duplicating them, validates endpoints with a guarded probe (SSRF-protected, secrets always redacted), and verifies the result with a real test delivery. Every operation is also published as a WordPress Ability, so external AI tools (Claude Code, Cursor) can drive the same toolset over MCP with scoped API tokens. The engine underneath (free) Turn any WordPress do_action into a first-class automation trigger your CRMs, n8n flows, AI agents, and internal services can consume — every dispatch is an outgoing webhook you fully control Persistent delivery queue with smart retry and exponential backoff — powered by WP-Cron, auto-upgrades to Action Scheduler or System Cron when available, (Pro) External Cron for guaranteed reliability Per-event UUID and ISO 8601 timestamp — enable downstream deduplication Delivery logs with full attempt history, request/response inspection, replay, and bulk retry Synchronous execution mode — fire inline without queue delay Payload mapping — rename, restructure, exclude, and type-cast fields with dot-notation paths Conditional dispatch — filter events by payload field values before dispatch, so a Slack notification or a CRM sync only fires when it should HTTP method, custom headers, and URL query parameters per webhook Dynamic endpoint URLs — {{ field.path }} placeholders resolved at dispatch time (free via fswa_webhook_url filter) Webhook Chains — wire 2xx completions to downstream webhooks with full observability Import & Export — move webhooks and chains between sites as portable JSON (triggers, field mapping, and conditions included; Code Glue with Pro), with strict validation and a per-item result summary on import Markdown descriptions — document what each webhook and chain does inline, with a Write/Preview toggle while editing Credentials Vault — store reusable auth secrets (Bearer, Basic, API key, custom) encrypted at rest; reference them from webhooks instead of pasting raw Authorization headers. Secrets are write-only over the API — never returned, only a masked hint Activity History — persistent audit log of every admin and API-token action Built-in CF7 and IvyForms integrations — structured payloads, no extra plugins Action Scheduler auto-detection — more reliable delivery on high-traffic sites Fully translatable — the entire admin interface and all server-side strings are internationalized; ships with Polish, Simplified Chinese, and Dutch, and is compatible with WPML and Polylang String Translation Full REST API with scoped API token authentication (read / operational / full / agent) — the agent scope grants full write access for AI assistants while never exposing stored secrets Developer extensibility — 16 filters and 7 action hooks (reference) Pro features AI credits included — Build with AI runs through the hosted WP Webhooks AI service on every Pro plan: no API keys to create, no provider accounts, a monthly credit allowance that renews automatically, and a live credits counter in the builder. Your own keys and WordPress connectors stay available any time AI writes Code Glue for you — the agent drafts PHP snippets, test-runs them against your real captured payloads, and assigns them to webhooks (with your confirmation) for pre-dispatch payload enrichment or post-dispatch side effects AI sets advanced conditions — with Pro the agent can propose multi-rule AND/OR condition groups instead of a single rule Code Glue — attach PHP snippets to any webhook+trigger (pre-dispatch payload enrichment, post-dispatch side effects) External Cron — replace unreliable visitor-triggered WP-Cron with a managed external pinger, provisioned automatically on license activation. Two modes: plugin queue endpoint (down to 20 s interval, configurable batch size) or WP-Cron endpoint (60 s, covers all WordPress background work). No server crontab or external dashboard — controlled entirely from wp-admin, with a live heartbeat chart and inline error alerts Unlimited conditions per trigger with AND/OR groups Per-webhook retry limit and backoff strategy overrides Dynamic URL templates — {{ }} syntax with no custom PHP required See pricing and upgrade → Examples Send Contact Form 7 submissions to a webhook (n8n demo) Send Gravity Forms Submissions to n8n Send IvyForms submissions to a webhook (n8n demo) WooCommerce orders to n8n on completion — wired up with a Claude Code agent WooCommerce to HubSpot integration — sync orders, contacts, and deals with no custom code