Source-backed reference for WordPress, the REST API, authentication, errors, webhooks, and safe project workflows.
Quickstart
1.Create an account and a dashboard project with source and target languages.
2.Create a project API key. Its plaintext is shown once and must not be embedded in browser code.
3.Install the WordPress plugin, enter the API URL and key, and run the connection test.
4.Open a translated URL and verify navigation, hreflang, cache, dynamic content, and quota status.
Authentication: Prefer Authorization: Bearer <key>. ?api_key=<key> remains compatible with legacy plugin clients. Dashboard routes use a signed-in session and are not a public API.
API reference
POST
/api/translate
public
Translates a batch of strings through the configured project provider while honoring cache, glossary, bot, quota, and velocity rules.
Auth: Project API key via Authorization: Bearer or ?api_key= query parameter.
Word type t follows the plugin contract. Human traffic uses bot=0; every bot value >=1 is cache-only and never invokes a provider.
cache_only is true for bots and when automatic translation is disabled. Clients may serve returned cache hits but must not persist source-identical cache misses as translations.
Only fresh provider-billed words consume monthly quota. A 402 means quota exhaustion; a 429 includes Retry-After for request or fresh-word velocity limits.
Idempotency-Key is optional. Success and deterministic responses can be replayed for up to 24 hours without repeating side effects. A retryable 429 is deduplicated and replayed only for its bounded Retry-After window; after that, the same key starts a new execution. A different body returns 409 only while the record is retained.
GET
/api/public/status
public
Checks API and database availability. Returns 200 when ready and a 503 Problem Details body when unavailable.
Returns the authoritative SaaS project settings together with normalized translation exclusions, collision-safe translated URL slugs, and the synchronization timestamp used by the WordPress runtime.
Auth: Project API key via bearer header or query parameter.
The project block is the authoritative runtime readback for SaaS-managed project settings and includes their current version.
Mappings that would shadow another source slug or have an ambiguous reverse mapping are omitted. Projects above the bounded 10,000-record runtime contract receive a 413 error instead of a silently truncated map.
POST
/api/plugin/settings-sync
plugin
Stores WordPress-owned routing and runtime options while comparing mirrored project values with the authoritative SaaS configuration.
Auth: Project API key via bearer header or query parameter.
SaaS is authoritative for the project name, domain, source and target languages, automatic redirect, AI notice, automatic translation, website type, and industry context. Incoming mirrored differences are listed in mirrorConflicts and are not written back.
WordPress is authoritative for routing mode, domain mappings, and email, search, and AMP translation. Client-side dynamic translation remains plugin-local and is not written into the SaaS project.
In SUBDOMAIN mode, mapped target languages use their unique host; unmapped target languages fall back to path prefixes on the source host.
WordPress
Plugin REST routes run on the WordPress site and require WordPress administrator permissions. Dynamic translation uses a nonce, short-lived word ticket, per-IP budget, and the server-side organization cap. Missing authorization degrades to cache-only behavior; bots never trigger fresh translation.
A Universal JavaScript snippet and reverse proxy are not currently available. WordPress is the only supported integration path.
AMP pages enter the translation pipeline only when the plugin option is enabled. The multilingual sitemap at /deepglot-sitemap.xml is advertised in robots.txt and contains only validated internal language alternatives.
From version 0.12.0, an ordinary page request does not wait for fresh translations by default. Missing segments enter a bounded, deduplicated queue and are translated by WP-Cron. If a cold request cannot store both its text and cache target because the short queue lock is busy, its source-language response is not cached and a later request can retry. The visual editor and WooCommerce emails remain synchronous because those outputs cannot converge automatically on a later request.
Administrators can start a bounded URL synchronization from the Deepglot sitemap under Settings → Deepglot. A side-effect-free preview with an immutable snapshot and sample URLs must be confirmed before it starts. When WordPress recognizes a safe HTTPS request on the same host as an internal target still stored with HTTP, the snapshot uses the same internal target with HTTPS. Semantic query parameters and fragments are preserved. A foreign request host is never copied. One absolute, query- and fragment-free redirect on the exact same origin and in the requested target language is verified explicitly through separate public and origin probes; automatic redirect following remains disabled. Other redirects remain bounded failures. Each batch contains at most 250 target pages, feeds the same translation queue at a controlled rate, and can be paused, resumed, or cancelled. It is not a permanent background crawler.
GET /wp-json/deepglot/v1/settings
PUT /wp-json/deepglot/v1/settings
PATCH /wp-json/deepglot/v1/settings
GET /wp-json/deepglot/v1/status
POST /wp-json/deepglot/v1/test-connection
GET /wp-json/deepglot/v1/url-sync
POST /wp-json/deepglot/v1/url-sync/preview
POST /wp-json/deepglot/v1/url-sync
POST /wp-json/deepglot/v1/url-sync/pause
POST /wp-json/deepglot/v1/url-sync/resume
POST /wp-json/deepglot/v1/url-sync/retry-failed
DELETE /wp-json/deepglot/v1/url-sync
POST /wp-json/deepglot/v1/translate-dynamic
WordPress operations help
The first request for a page without cached translations can intentionally show source content. It places missing segments in the warm-up queue, and an immediately due WP-Cron event processes them in the background. Once the queue and event are stored, Deepglot makes one non-blocking WP-Cron nudge per request. That nudge is skipped for DISABLE_WP_CRON and while cron is already running. After success, Deepglot purges affected pages from supported full-page caches so the next request receives the locally cached translation.
Only translation 429 responses set the active marker. The marker and warmer backoff are bound to the API key and backend; configuration changes, late responses from the previous configuration, and legacy or unbound markers do not block new translations.
When every attempted provider reports only a count mismatch for the same multi-text root chunk, Deepglot starts direct singleton isolation. It skips redundant binary intermediate shapes and retries each original text through the configured provider chain in input order. The provider-call ceiling is chain length × (chunk size + 1) for a multi-text root, while an original singleton gets one chain; a default eight-text chunk with two providers therefore allows at most 18 provider calls. All root chunks and isolated singletons share the request-wide provider-call concurrency cap (default 12) and a provider-work deadline of at most 100 seconds. PDF translation uses a separate 40-second budget from route entry; authentication, multipart handling, and PDF preparation reduce the remaining provider time so the 60-second route nominally retains 20 seconds for completion work. A failing parallel chunk stops new sibling provider calls. Singleton, call-budget, and deadline mismatches remain terminal; timeouts, authentication failures, rate limits, U+0000, and other malformed responses never trigger these extra requests.
Deepglot finishes all bounded root-chunk attempts before starting singleton work. It collects only roots whose complete provider chains produced count mismatches; any other terminal error still aborts siblings immediately. Before calibration, Deepglot compares the remaining deadline with a conservative one-wave reserve: the fastest elapsed duration among the completed full count-mismatch root chains. If that reserve cannot fit, no singleton provider call starts. This root-derived reserve is used only for calibration admission and is never extrapolated across later work. It then runs exactly one global calibration wave containing the first min(request-wide concurrency, total mismatched texts) real singletons through their full provider fallback chains and retains its results. If the shared deadline expires during any admitted singleton wave despite the admission checks, Deepglot returns the same typed deadline error instead of a generic timeout. The remaining work is split into request-wide bounded waves. Before each later wave, Deepglot compares waves still pending × duration of the immediately preceding observed singleton wave with the remaining shared deadline and remeasures after every completed wave. That deadline is the earlier of the local provider-work ceiling and the caller's monotonic absolute deadline; the PDF route passes its route-entry 40-second deadline so authentication, upload handling, and preparation consume the same budget. If the pending work cannot fit, the request stops after the last retained wave and before any further singleton call. API and PDF return the stable 503 code ‘translation_count_mismatch_deadline’; once the first provider call starts, the API conservatively retains its velocity reservation and retains an idempotent same-key 503 for at most 60 seconds. Otherwise, the remaining affected texts continue through the same globally bounded singleton queue, preserving result order and each text's full provider fallback chain.
The localized public request URL remains the cache target even after the request router internally rewrites it to the source path.
1. Synchronize URLs
Create a small URL preview in the Deepglot settings first, then confirm the immutable snapshot. Verify that a stale HTTP target on the same safe host appears with HTTPS and that semantic query parameters are preserved. The job uses only internal sitemap targets, reports aggregate progress, pauses on exhausted quota or an invalid API key, and automatically backs off on API rate limits. Individual pages can still be triggered by an ordinary human visit.
2. Check WP-Cron
If the page stays in the source language, verify WP-Cron or the configured system cron is running. Hosts with DISABLE_WP_CRON need their own cron invocation.
3. Check page caches
The completed status confirms the processed queue at the WordPress origin, not the public page-cache response. WP Rocket, W3 Total Cache, and LiteSpeed Cache purge completed URLs individually. WP Super Cache is purged globally only when the tracked URL queue is empty, so pending pages remain cached. For other full-page caches, purge the page cache manually, keep Deepglot's translation cache, and then verify the target-language page without sync parameters.
For fast local providers: The deepglot_max_sync_batches filter can translate a bounded number of batches during the page request. The asynchronous default is recommended for external AI providers.
Weekly workspace activity digest
The weekly digest is opt-in per user and workspace. The preference is stored in account settings; the PATCH route updates both the enabled state and the requested email locale.
Period and content
The cron processor aggregates the previous complete UTC Monday-to-Monday week. It counts new translations and words, manual translations and words, and runtime translation requests; import and manual batches are not counted as runtime requests.
Delivery and retry behavior
The protected Vercel Cron runs at 08:00 UTC on Monday. Quiet weeks are skipped. A unique claim per user, workspace, and period prevents duplicate deliveries across concurrent invocations; failed sends release their claim for retry.
The documented implementation history forms the basis for the current v0.12.8 implementation. v0.12.1 assigned a new public asset version to the Retry-After-aware dynamic translator. v0.12.2 verifies exactly one safe canonical redirect during URL synchronization without enabling automatic redirect following. v0.12.3 stores text and URL queues in a versioned, checksummed ASCII envelope so emoji and other four-byte Unicode remain durable on legacy WordPress option tables; damaged persistence is not silently replaced. v0.12.4 protects translated transient values with a separate versioned ASCII envelope. A failed cache write stays in both queues, prevents the page purge, and keeps a non-durable inline result out of the page cache. v0.12.5 translates explicitly configured consent widgets even when they render before the dynamic footer observer and localizes their internal links with server-side routing rules without sending URLs to a translation provider. v0.12.6 follows WordPress core post-type viewability: built-in public pages remain in the sitemap and URL synchronization, while non-viewable builder content types, attachments, and non-queryable taxonomies stay excluded. v0.12.7 synchronizes project-wide settings as a versioned SaaS snapshot. v0.12.8 translates generic ARIA labels, image tooltips, and human-readable RSS/Atom feed titles without sending ordinary link metadata to the translation provider, and rejects blank translation-cache values including legacy entries. A GitHub release or ZIP build does not automatically install a customer plugin; production installation and live QA remain separate approvals.
v0.11.4Numeric-only source slugs remain mapped after dedicated cache readback.
v0.11.5Translation batches receive a bounded 60-second request window.
v0.11.6Large cold pages split into ordered parallel requests bounded by string count and 2,000 UTF-8 bytes.
v0.11.7A trusted final HTML filter can localize language-specific media safely and falls back when the callback returns empty.
Errors and retries
Public and plugin routes use a Problem Details-style JSON contract. error remains as a legacy alias for existing plugin versions. Clients should branch on code and status; detail is human-readable.
A validation_failed response for U+0000 means a text, language, title, or request-URL field contains a NUL character that PostgreSQL cannot represent. Deepglot does not send that input to a provider or store it. Remove only U+0000 before retrying; other control characters and valid Unicode are supported.
Retryable 429 responses are not retained by Idempotency-Key beyond the bounded Retry-After window: concurrent same-key callers receive the same response, and the key may execute again after expiry. A 422 velocity_request_too_large is deterministic and retains the normal replay contract. Split an oversized request or PDF into smaller units.
{
"type": "https://deepglot.ai/problems/validation-failed",
"title": "Validation failed",
"status": 400,
"detail": "languageFrom and languageTo are required.",
"code": "validation_failed",
"instance": "/api/public/languages/is-supported",
"error": "languageFrom and languageTo are required.",
"errors": { "languageFrom": ["Required"], "languageTo": ["Required"] }
}
400 validation_failed
401 missing_api_key / invalid_api_key
402 quota_exhausted
409 idempotency_conflict
422 velocity_request_too_large
429 rate_limit_exceeded / velocity_limited
500 internal_error
503 service_unavailable
Webhooks
Project managers configure public HTTPS targets. Deepglot checks targets for SSRF at creation and dispatch, signs timestamp.payload with HMAC-SHA256, and sends X-Deepglot-Event, X-Deepglot-Timestamp, and X-Deepglot-Signature. Failed deliveries retry after 60, 300, and 900 seconds.
translation.created
translation.updated
translation.manual_updated
translation.deleted
glossary.upserted
glossary.deleted
slug.upserted
import.completed
Project surfaces
These routes power the dashboard and are not a stable external REST contract. API keys, languages, webhooks, exclusions, and the Pro+ translation-memory setting require management access. Human review and PDF translation are additionally project- and language-scoped. Managers may edit, delete, assign, and approve segments; translators may only edit and submit segments assigned to them in their language. Glossary CRUD currently uses the weaker project-membership gate. Import, export, and editor sessions use signed-in, project-specific access.
edit / metadata: manager or assigned translator; delete: manager
/api/projects/[projektId]/pdf-translations
project / language scoped
/api/projects/[projektId]/webhooks
manage
Languages, versioning, and support
The /api/public/languages catalog is canonical. sharedAcrossProviders=false means supported by the product but not guaranteed by every selectable provider.
The current public API is unversioned. Backward-compatible fields may be added; breaking changes require a versioned path or an announced deprecation window of at least 90 days. Plugin versions and production behavior changes are recorded in GitHub Releases, ROADMAP.md, and HANDOFF.md.
An MCP server, official SDK/CLI, and agent skills are not currently available. DPP localization is a later, unvalidated direction and not a compliance claim. Decision record