Developer documentation

Integrate Deepglot

Source-backed reference for WordPress, the REST API, authentication, errors, webhooks, and safe project workflows.

Quickstart

  1. 1.Create an account and a dashboard project with source and target languages.
  2. 2.Create a project API key. Its plaintext is shown once and must not be embedded in browser code.
  3. 3.Install the WordPress plugin, enter the API URL and key, and run the connection test.
  4. 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.

Source: src/app/api/translate/route.ts

Request

curl https://deepglot.ai/api/translate \
  -H "Authorization: Bearer dg_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 9b9e42d8-7ef2-4a91-82ff-b5ec71ba5832" \
  -d '{
    "l_from": "de",
    "l_to": "en",
    "words": [{ "w": "Hallo Welt", "t": 1 }],
    "request_url": "https://example.com/",
    "bot": 0
  }'

Response

{
  "l_from": "de",
  "l_to": "en",
  "request_url": "https://example.com/",
  "title": "",
  "bot": 0,
  "from_words": ["Hallo Welt"],
  "to_words": ["Hello world"]
}
  • Word type t follows the plugin contract. Human traffic uses bot=0; every bot value >=1 is cache-only and never invokes a provider.
  • 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. Repeating the same body and key within 24 hours replays the first response without repeating side effects; a different body returns 409.
GET

/api/public/status

public

Checks API and database availability. Returns 200 when ready and a 503 Problem Details body when unavailable.

Auth: None.

Source: src/app/api/public/status/route.ts

Response

HTTP/1.1 200 OK

// Database unavailable: HTTP 503 with a service_unavailable Problem Details body.
GET

/api/public/languages

public

Lists the canonical supported language catalog and whether each language is shared across all configurable providers.

Auth: None.

Source: src/app/api/public/languages/route.ts

Response

[
  {
    "code": "de",
    "local_name": "Deutsch",
    "english_name": "German",
    "sharedAcrossProviders": true
  }
]
  • Provider-specific coverage can be narrower. Check the configured provider before promising a language pair.
GET

/api/public/languages/is-supported?languageFrom=de&languageTo=en

public

Checks whether both language codes are in the canonical catalog and are different.

Auth: None.

Source: src/app/api/public/languages/is-supported/route.ts

Response

{ "is_supported": true }
GET

/api/plugin/runtime-config

plugin

Returns 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.

Source: src/app/api/plugin/runtime-config/route.ts

Response

{
  "exclusions": { "urls": [], "regexes": [], "selectors": [] },
  "urlSlugs": [
    { "originalSlug": "ueber-uns", "translatedSlug": "about-us", "langTo": "en" }
  ],
  "syncedAt": "2026-07-13T10:00:00.000Z"
}
  • 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

Synchronizes WordPress routing, languages, runtime options, source host, and optional subdomain mappings into the project.

Auth: Project API key via bearer header or query parameter.

Source: src/app/api/plugin/settings-sync/route.ts

Request

{
  "routingMode": "PATH_PREFIX",
  "siteUrl": "https://example.com",
  "sourceLanguage": "de",
  "targetLanguages": ["en"],
  "autoRedirect": false,
  "translateEmails": false,
  "translateSearch": true,
  "translateAmp": false,
  "domainMappings": []
}

Response

{
  "ok": true,
  "project": {
    "id": "project-id",
    "originalLang": "de",
    "languages": [{ "langCode": "en", "isActive": true }]
  }
}
  • 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.

  • 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
  • POST /wp-json/deepglot/v1/translate-dynamic

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.

{
  "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
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
  • 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; only managers may assign or approve. Glossary CRUD currently uses the weaker project-membership gate. Import, export, and editor sessions use signed-in, project-specific access.

RouteAccess
/api/projects/[projektId]/api-keysmanage
/api/projects/[projektId]/languagesmanage
/api/projects/[projektId]/glossarymember
/api/projects/[projektId]/exclusionsmanage
/api/projects/[projektId]/importsession
/api/projects/[projektId]/exportsession
/api/projects/[projektId]/editor-sessionssession
/api/projects/[projektId]/translation-memorymanage / Pro+
/api/projects/[projektId]/translationsproject / language scoped
/api/projects/[projektId]/translations/[translationId]manager or assigned translator
/api/projects/[projektId]/pdf-translationsproject / language scoped
/api/projects/[projektId]/webhooksmanage

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

Questions or integration feedback? office@ostheimer.at·Back to homepage