OneTablet API Documentation

Update webhook settings

POST/management/settings/setAllWebhookSettings

Set any of newUrl, newUrlEvents, newUrlEnabled and legacyUrlEnabled in one call.

An omitted field is left unchanged; a field you send is set. Send only what you are actually changing — you never have to restate a setting to keep it. In particular, registering a newUrl without mentioning legacyUrlEnabled does not switch your legacy order feed off.

Field by field:

  • newUrl — omitted: unchanged. A url: registered (send newUrlEvents with it). Explicit null: cleared. To stop delivery without throwing the registration away, send newUrlEnabled: false instead.
  • newUrlEvents — omitted: unchanged. Present: REPLACES the whole list, so [] means "no events". It is never an append; a list you could only add to would be useless.
  • newUrlEnabled — omitted: unchanged. Present: set.
  • legacyUrlEnabled — omitted: unchanged. Present: set.

On an organization that has never had any webhook settings, "unchanged" means the stored default: newUrl absent, newUrlEvents empty, and both enabled switches on.

legacyUrl MUST NOT appear in the request body at all — it is rejected with 400, not silently ignored, so you are never left believing you changed something you did not. OneTablet controls WHERE legacy delivers; legacyUrlEnabled is how you control WHETHER.

The name setAllWebhookSettings does not mean "resets everything you leave out". It means this ONE operation covers ALL of the settable webhook fields — there is no per-field endpoint to hunt for.

Validation:

  1. If newUrl is sent as a url, newUrlEvents must be sent with it and contain at least one event — registering a destination with no stated subscriptions would be a silent no-op.
  2. legacyUrl in the body is a 400.
  3. Every entry in newUrlEvents must be one of the published event types.
  4. newUrl must be https:// and must not resolve to a private (RFC1918), link-local, or cloud-metadata address.
  5. Any field in the body outside newUrl / newUrlEvents / newUrlEnabled / legacyUrlEnabled is a 400.
  6. A call that would leave the organization with NO webhook destination — clearing newUrl with null when no legacyUrl is on file, or a first-ever call that registers no destination at all — is a 400.

Returns the full updated settings, including the untouched legacyUrl, so you can confirm the write without a second call.

Safe to retry: this operation changes state but is idempotent.

Request

application/json
required
  • newUrlstring

    The new signed destination to register.

    Omitted -> the stored newUrl is left alone. A url -> registered, and at least one entry in newUrlEvents must accompany it in the SAME call. Explicit null -> the destination is cleared, which is refused with 400 when it would leave the organization with no webhook destination at all (no legacyUrl on file). Prefer newUrlEnabled: false to stop delivery: pausing keeps the registration, clearing throws it away.

  • newUrlEventsstring[]

    Which events newUrl receives.

    Omitted -> the stored subscription list is left alone. PRESENT -> it REPLACES the stored list wholesale, so [] genuinely means "no events" and this is not an append. Must contain at least one entry whenever newUrl is sent as a url.

    Possible values: [order.created, order.status.updated, order.rejected, order.cancelled, order.delivery.updated, store.status.changed, report.completed, menu.publication.completed]
  • newUrlEnabledboolean

    Pause switch for newUrl only. Omitted -> left at its stored value.

  • legacyUrlEnabledboolean

    Pause switch for legacyUrl only. Unlike legacyUrl itself — which has no field on this request at all and is rejected with 400 if sent — this one IS settable: it is the only way a partner can turn the legacy feed off themselves. false stops legacy delivery immediately; setting it back to true resumes it.

    Omitting it leaves legacy delivery exactly as it is; you never need to restate this field to keep legacy running.

Responses

200 — Your full webhook configuration after the update, including the untouched `legacyUrl`.

Headers

  • x-mealco-tx-idstringoptional

    The correlation id for this call, echoed on every response — a 200 exactly as much as a 400, 401 or 500. Quote it when reporting a problem and we can find every log line for the request, in every service it touched. You may also send your own x-mealco-tx-id on the request and we adopt it, so your correlation id becomes ours. Not marked required for one reason: a request whose JSON body is malformed is rejected before it reaches an operation, so no id exists yet and that single response carries neither this header nor the txId field of the error body. Everything that reaches an operation carries it.

  • legacyUrlstring

    The legacy orders-only feed's registered url. READ-ONLY through this API — absent when nothing is configured. Delivery to it is also gated by OneTablet's own order-notifications switch for your organization, and by legacyUrlEnabled below.

  • legacyUrlEnabledboolean

    A pause switch for legacyUrl ONLY — the sibling of newUrlEnabled for the legacy destination. Unlike legacyUrl itself, this IS settable through setAllWebhookSettings: it is how a partner finishes migrating off the legacy feed without OneTablet clearing legacyUrl as a support action. false silences legacyUrl alone; it has no effect on newUrl. It defaults true, so a destination nobody has ever switched off keeps delivering — including across a setAllWebhookSettings call that does not mention this field at all.

  • newUrlstring

    The new signed (v2= ES256) destination. Absent when nothing is registered.

  • newUrlEventsstring[]

    Which events are delivered to newUrl. Governs newUrl ONLY — the legacy feed has no per-event list and is always orders-only. Absent/empty when newUrl is absent.

    Possible values: [order.created, order.status.updated, order.rejected, order.cancelled, order.delivery.updated, store.status.changed, report.completed, menu.publication.completed]
  • newUrlEnabledboolean

    A pause switch for newUrl ONLY. false silences the new feed; it has no effect on legacyUrl, which has its own switch, legacyUrlEnabled.

About Settings

Read and set where OneTablet delivers your webhooks.

Your organization is resolved from the authenticated api key and is never a field on any request or response here, so no caller can point another organization's feed at their own server.

Two destinations, one configuration. legacyUrl is the pre-existing orders-only feed — the URL itself is read-only here (OneTablet controls where legacy delivers, and clears it only as a support action), and legacyUrlEnabled is the self-serve switch that lets you turn legacy delivery off yourself. newUrl is the signed (v2=, ES256) destination you register for yourself, together with newUrlEvents (which events it receives) and newUrlEnabled (its own pause switch). Any combination of legacyUrlEnabled / newUrlEnabled is valid at once — legacy-only, dual-run while migrating, or new-only once you are done — and registering or pausing one destination never touches the other.

The naming carries the semantics. newUrlEvents and newUrlEnabled govern newUrl ONLY; legacyUrlEnabled governs legacyUrl ONLY — the legacy feed has no per-event subscription list and is always orders-only. Do not read newUrlEnabled: false as "webhooks are off" — it silences newUrl alone, exactly as legacyUrlEnabled: false silences only legacyUrl.