REST API
Complete REST API for external integrations
REST API
Schemafy provides a complete REST API for developers who want to integrate with external tools or build custom workflows.
Base URL
text
https://yoursite.com/wp-json/schemafy/v1/Authentication
All endpoints require WordPress authentication with appropriate capabilities:
- Schema management:
manage_optionscapability - SEO analysis:
edit_postscapability
Endpoints
| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
| `/schemafy/v1/schemas` | GET | List all schemas with pagination and filters | `edit_posts` |
| `/schemafy/v1/schemas` | POST | Create a new schema | `manage_options` |
| `/schemafy/v1/schemas/{id}` | GET | Get a schema by ID | `edit_posts` |
| `/schemafy/v1/schemas/{id}` | PUT | Update an existing schema | `manage_options` |
| `/schemafy/v1/schemas/{id}` | DELETE | Delete a schema | `manage_options` |
| `/schemafy/v1/meta` | GET/POST | Meta tag management by URL | `manage_options` |
| `/schemafy/v1/social` | GET/POST | Social media tag management | `manage_options` |
| `/schemafy/v1/scan` | POST | Scan the site for auto-generation | `manage_options` |
| `/schemafy/v1/validate` | POST | Validate JSON-LD against Schema.org | `edit_posts` |
| `/schemafy/v1/bulk` | POST | Bulk operations (fix, cleanup, duplicates) | `manage_options` |
| `/schemafy/v1/schemas-by-url` | GET | Schemas assigned to a specific URL | Public |
> Note: Individual GET read endpoints for schemas are public; all write endpoints (POST/PUT/DELETE) require at minimum the edit_posts capability.
Code Examples
Get Schemas by URL
bash
# Obtener schemas de una URL específica
curl -X GET "https://tusitio.com/wp-json/schemafy/v1/schemas-by-url?url=https://tusitio.com/mi-pagina" \
-H "Authorization: Basic BASE64_CREDENTIALS"
# Crear un nuevo schema
curl -X POST "https://tusitio.com/wp-json/schemafy/v1/schemas" \
-H "Content-Type: application/json" \
-H "Authorization: Basic BASE64_CREDENTIALS" \
-d '{
"url": "https://tusitio.com/mi-pagina",
"schema_type": "Article",
"schema_name": "Mi Artículo",
"schema_data": "{\"@context\":\"https://schema.org\",\"@type\":\"Article\",\"headline\":\"Mi Artículo\"}"
}'