Webhooks

Sync a repository when translations are ready: signed events, retries, and GitHub repository_dispatch.

A webhook tells your repository, or any HTTPS endpoint, the moment a project's translations are ready. Pull then, instead of on a timer: a nightly or 15:00 sync ships whatever happened to be translated at that hour, and a release cut right after a push ships the new strings untranslated. Webhooks belong to a project and need the admin role.

Sync a GitHub repository

GitHub starts a workflow from a repository_dispatch request. Create a fine-grained token with Contents: write on the repository and give it to Glossa as a header. Glossa stores it server-side and never shows it again, not even to admins:

npx @meterapp/glossa webhooks create https://api.github.com/repos/OWNER/REPO/dispatches \  --project web --header "Authorization: Bearer $GITHUB_DISPATCH_TOKEN"npx @meterapp/glossa webhooks test <id>          # 204 from GitHub: the token worksnpx @meterapp/glossa webhooks deliveries --project web

For an api.github.com/repos/…/dispatches URL the body is GitHub's shape, {event_type, client_payload}, with event_type set to glossa.translations.ready. The workflow runs on it and pulls every locale:

# .github/workflows/translations.ymlname: Translationson:  repository_dispatch:    types: [glossa.translations.ready]  workflow_dispatch:jobs:  pull:    runs-on: ubuntu-latest    permissions:      contents: write      pull-requests: write    env:      GLOSSA_API_KEY: ${{ secrets.GLOSSA_API_KEY }}    steps:      - uses: actions/checkout@v5      - run: npx @meterapp/glossa pull      - uses: peter-evans/create-pull-request@v7        with:          branch: glossa/translations          title: "i18n: translations from Glossa"          commit-message: "i18n: translations from Glossa"

github.event.client_payload holds the event below (project slug, locales, counts). Keep a release gate in the deploy job: the webhook makes the pull timely, the gate makes sure a build never ships without it.

Events

EventSent whenPayload
translations.readyTranslate jobs of the project finished, none is queued or running any more, and the queue has been quiet for a minute. A burst of pushes is one event.project {id, slug, name}, locales, counts {translated, needs_review, jobs, failed_jobs}, per_locale, job_ids, checked_at
job.failedA translate job of the project failed.project, job {id, locales, error, finished_at}, checked_at
pingSent by test_webhook only, never retried.project, message, checked_at

Jobs held until next month by the AI budget don't keep a project busy. counts adds up the translate jobs that finished since the previous event; strings that came back flagged are in needs_review and wait in the review queue.

Any HTTPS endpoint

Other URLs get the event itself as the JSON body:

{  "delivery_id": "4812",  "event": "translations.ready",  "project": { "id": "…", "slug": "web", "name": "Web app" },  "locales": ["de", "es", "fr"],  "counts": { "translated": 42, "needs_review": 3, "jobs": 2, "failed_jobs": 0 },  "per_locale": { "de": { "translated": 14, "needs_review": 1 }, "…": {} },  "job_ids": ["…", "…"],  "checked_at": "2026-11-11T15:02:00.000Z"}
curl -X POST https://getglossa.dev/api/v1/create_webhook \  -H "Authorization: Bearer gls_…" -H "Content-Type: application/json" \  -d '{"project": "web", "url": "https://hooks.example.com/glossa", "events": ["translations.ready", "job.failed"]}'

Every request carries X-Glossa-Event, X-Glossa-Delivery (the same id across retries, so you can skip duplicates) and X-Glossa-Signature: sha256=…, the hex HMAC-SHA256 of the raw body keyed with the secret create_webhook returned:

import { createHmac, timingSafeEqual } from "node:crypto";
// raw: the request body exactly as received, before JSON.parseexport function verifyGlossa(raw: string, header: string | null, secret: string): boolean {  const expected = "sha256=" + createHmac("sha256", secret).update(raw).digest("hex");  return header !== null && header.length === expected.length && timingSafeEqual(Buffer.from(header), Buffer.from(expected));}

Delivery and retries

  • Any 2xx answer within 10 seconds is a delivery. Redirects are not followed: use the final URL.
  • 401, 403, 404 and other 4xx answers (except 408, 425 and 429) fail at once: a wrong token or URL doesn't fix itself. Fix it and run test_webhook.
  • Timeouts, network errors, 5xx and 429 are retried after 1, 2, 4 … minutes, eight attempts in all (about four hours).
  • URLs must be HTTPS on a public host. Glossa checks what the host resolves to before every request and refuses private and loopback addresses.

npx @meterapp/glossa webhooks deliveries --project web (list_webhook_deliveries) shows each delivery, its attempts and the endpoint's last answer, with tokens and the secret blanked out.

Ops

OpDoes
create_webhookSubscribe a URL to a project's events. Returns the signing secret, once.
list_webhooksURL, events, format, the names of custom headers and the last delivery.
test_webhookSend a signed ping now and see the HTTP status.
list_webhook_deliveriesEvery delivery with its payload, attempts, status and the endpoint's last answer.
delete_webhookStop sending; the delivery log goes with it.

They work the same over MCP, the CLI (npx @meterapp/glossa webhooks) and REST.