The inject endpoint returns all published schemas for a given page as a structured JSON response. The SchemaGen JavaScript SDK calls this endpoint automatically when it loads on your site, but you can also call it directly if you want to build a custom schema delivery layer or inspect what schemas are active for a specific URL.Documentation Index
Fetch the complete documentation index at: https://docs.schemagen.io/llms.txt
Use this file to discover all available pages before exploring further.
This endpoint requires no authentication. It is a public CORS-enabled endpoint safe to call from browser JavaScript or any server environment.
Endpoint
Query parameters
The UUID of your client site. You can find your Client ID in Settings → Client in the SchemaGen dashboard.
The absolute URL of the page you want to fetch schemas for. Must include the protocol (e.g.,
https://example.com/blog/my-post). SchemaGen uses this to match published schemas scoped to that specific page.Response
A successful request returns200 with a JSON body containing the schemas for the given page.
An array of raw JSON-LD objects — one for each published schema matching the requested URL. These are the objects you can embed directly in
<script type="application/ld+json"> tags.An array of full schema delivery records. Each item includes the JSON-LD object along with metadata such as the schema name, type, and status.
Response headers
| Header | Description |
|---|---|
X-Schemagen-Duration | Server-side processing time in milliseconds (e.g., 42ms). |
X-Schemagen-ID | The unique request ID, matching meta.requestId in the response body. |
Cache-Control | Always no-store, max-age=0. Responses are never cached to ensure schemas reflect the latest published state. |
Code examples
Example response
Error responses
| Status | Cause | Response body |
|---|---|---|
400 | clientId or url is missing or invalid. | { "error": "Validation failed", "details": {} } |
500 | An unexpected server error occurred. | { "error": "Internal Server Error" } |