All endpoints live under the seoforge/v1 namespace. Authentication requires the edit_posts capability. You can authenticate via cookie auth with the X-WP-Nonce header (for front-end JavaScript), or via WordPress application passwords (for external tools, CI/CD, and server-to-server calls).
Authentication
There are two primary authentication methods:
bash
# Method 1: Application passwords (recommended for external tools)
curl -u "admin:ABCD 1234 EFGH 5678 IJKL 9012"
https://example.com/wp-json/seoforge/v1/dashboardphp
// Method 2: Cookie + Nonce (for JavaScript running within WordPress admin)
add_action( 'admin_enqueue_scripts', function () {
wp_enqueue_script( 'my-seo-dashboard', plugin_dir_url( __FILE__ ) . 'js/dashboard.js', [], '1.0', true );
wp_localize_script( 'my-seo-dashboard', 'mySeoConfig', [
'restUrl' => rest_url( 'seoforge/v1/' ),
'nonce' => wp_create_nonce( 'wp_rest' ),
] );
} );javascript
// JavaScript: Using nonce auth in fetch calls
async function fetchDashboard() {
const response = await fetch( mySeoConfig.restUrl + 'dashboard', {
headers: { 'X-WP-Nonce': mySeoConfig.nonce }
});
return await response.json();
}Endpoint Summary
| Method | Endpoint | Auth | Tier | Description |
|---|---|---|---|---|
| GET | /analyze/{post_id} | edit_posts | Free | Full SEO analysis |
| GET | /score/{post_id} | edit_posts | Free | Cached score lookup |
| POST | /meta/generate | edit_posts | PRO | AI meta generation |
| GET | /links/suggest/{post_id} | edit_posts | PRO | Internal link suggestions |
| GET | /schema/{post_id} | edit_posts | Free | JSON-LD schema |
| POST | /schema/detect/{post_id} | edit_posts | PRO | AI schema detection |
| GET | /dashboard | edit_posts | Free | Site-wide stats |
| POST | /fix/{post_id} | edit_posts | PRO | Auto-fix SEO issue |
| POST | /links/auto-insert/{post_id} | edit_posts | PRO | Auto-insert links |
| GET | /ai-readiness/{post_id} | edit_posts | PRO | AEO analysis |
| POST | /brief/generate | edit_posts | PRO | AI content brief |
| POST | /optimize/{post_id} | edit_posts | PRO | Content optimization |
| POST | /optimize/apply/{post_id} | edit_posts | PRO | Apply optimization |
| GET | /links/broken/{post_id} | edit_posts | PRO | Broken link check |
—