logo

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_options capability
  • SEO analysis: edit_posts capability

Endpoints

EndpointMethodDescriptionAuth Required
`/schemafy/v1/schemas`GETList all schemas with pagination and filters`edit_posts`
`/schemafy/v1/schemas`POSTCreate a new schema`manage_options`
`/schemafy/v1/schemas/{id}`GETGet a schema by ID`edit_posts`
`/schemafy/v1/schemas/{id}`PUTUpdate an existing schema`manage_options`
`/schemafy/v1/schemas/{id}`DELETEDelete a schema`manage_options`
`/schemafy/v1/meta`GET/POSTMeta tag management by URL`manage_options`
`/schemafy/v1/social`GET/POSTSocial media tag management`manage_options`
`/schemafy/v1/scan`POSTScan the site for auto-generation`manage_options`
`/schemafy/v1/validate`POSTValidate JSON-LD against Schema.org`edit_posts`
`/schemafy/v1/bulk`POSTBulk operations (fix, cleanup, duplicates)`manage_options`
`/schemafy/v1/schemas-by-url`GETSchemas assigned to a specific URLPublic

> 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\"}"
  }'