Advanced2min read
REST API
Full REST API for external integrations, headless setups and custom workflows.
REST API
Schemafy exposes a complete REST API for developers who need to integrate with external tools or build custom workflows.
Available on: Business plan and above.
Base URL
text
https://yoursite.com/wp-json/schemafy/v1/Authentication
All write endpoints require WordPress authentication:
- Schema management:
manage_optionscapability - Read access:
edit_postscapability or public (for schemas-by-url)
Endpoints
| Endpoint | Method | Description | Auth |
|---|---|---|---|
| `/schemas` | GET | List all schemas (paginated + filters) | `edit_posts` |
| `/schemas` | POST | Create a new schema | `manage_options` |
| `/schemas/{id}` | GET | Get schema by ID | `edit_posts` |
| `/schemas/{id}` | PUT | Update existing schema | `manage_options` |
| `/schemas/{id}` | DELETE | Delete schema | `manage_options` |
| `/meta` | GET/POST | Meta tag management by URL | `manage_options` |
| `/social` | GET/POST | Social media tag management | `manage_options` |
| `/scan` | POST | Trigger auto-generation scan | `manage_options` |
| `/validate` | POST | Validate JSON-LD against Schema.org | `edit_posts` |
| `/bulk` | POST | Bulk operations (fix, cleanup, duplicates) | `manage_options` |
| `/schemas-by-url` | GET | Schemas assigned to a URL | Public |
Code Examples
Get schemas for a URL
bash
curl -X GET "https://yoursite.com/wp-json/schemafy/v1/schemas-by-url?url=https://yoursite.com/my-page" \
-H "Authorization: Basic BASE64_CREDENTIALS"Create a schema via API
bash
curl -X POST "https://yoursite.com/wp-json/schemafy/v1/schemas" \
-H "Content-Type: application/json" \
-H "Authorization: Basic BASE64_CREDENTIALS" \
-d '{
"url": "https://yoursite.com/my-page",
"schema_type": "Article",
"schema_name": "Homepage Article",
"schema_data": "{\"@context\":\"https://schema.org\",\"@type\":\"Article\",\"headline\":\"My Article\"}"
}'Was this page helpful?
Thanks for the feedback!