Developers

askher in your systems.
Same rules as Sofia.

An API to read the business's profile, check availability and manage bookings, webhooks to know right away what happens, and a button to paste on your website. Included from the Pro plan.

Basics

Getting started

The API is served at https://askher.it/api/v1, in JSON and UTF-8. Dates use the YYYY-MM-DD format and times HH:MM, always in the business's time zone (Europe/Rome). Bookings go through the same checks as Sofia on the phone: capacity, duration, opening hours, closures and groups. You can never book a seat that isn't there.

Every request carries the key in the Authorization header. Writes (POST, PATCH) take a JSON body with Content-Type: application/json, up to 4,096 bytes.

curl https://askher.it/api/v1/locale \
  -H "Authorization: Bearer $ASKHER_CHIAVE"

Keys and subscription

Keys are created in the management console, under Sul tuo sito → Chiavi API (“On your site → API keys”). They start with ask_live_, are valid for a single business and are shown in full only once: copy yours right away.

A key can be revoked at any time: from then on, calls return 401. Keep it on the server, never in browser or app code.

The API, webhooks and the button are included in the Pro and Enterprise plans at no extra cost. On the Base plan, or without an active subscription, calls return 403. Custom integrations and dedicated software are built by us, on quote (Enterprise).

Rate limits

Per key: 60 requests per minute, of which at most 10 writes (create, update, cancel). Per business, across all keys: 2,000 requests per hour.

Every response carries X-RateLimit-Limit and X-RateLimit-Remaining (for the key's per-minute limit), errors included; the only exceptions are 401 and 403, which come before the limits are checked. Beyond a limit you get 429 with Retry-After: the seconds to wait before retrying.

Errors

Errors always have the same shape. campi lists the fields to fix (400 and 422); with 409 you get alternative instead, the nearest free times.

422Response

{
  "errore": {
    "codice": "dati_non_validi",
    "messaggio": "Controlla i campi indicati: data AAAA-MM-GG, ora HH:MM, persone intero da 1 a 60, nome fino a 80 caratteri, telefono da 6 a 15 cifre, note fino a 300 caratteri.",
    "campi": ["ora"]
  }
}

The codice is stable and meant for your code; the messaggio is a sentence in Italian to show or log.

StatusCodeWhen
400parametri_non_validijson_non_validocampo_sconosciutoidempotency_key_non_validaInvalid parameters, JSON or Idempotency-Key, or unexpected fields
401chiave_mancantechiave_non_validachiave_revocataKey missing, wrong or revoked
403piano_non_inclusoabbonamento_non_attivoThe business's plan does not include the API, or the subscription is not active
404prenotazione_non_trovataNo booking with that code
409non_disponibilerichiesta_in_corsoNo availability (the response contains alternatives), or a request with the same Idempotency-Key is still in progress
413corpo_troppo_grandeBody larger than 4,096 bytes
415formato_non_supportatoBody without Content-Type: application/json
422dati_non_validinessun_cambioidempotency_key_riusataValues with the wrong format or out of range, nothing to change, or an Idempotency-Key already used with a different body
429troppe_richiesteRate limit exceeded: retry after Retry-After
502prenotazioni_non_raggiungibiliThe booking system is not responding: try again shortly
503prenotazioni_non_attiveThe business's bookings are not yet connected to askher

Endpoints

Business information

GET/api/v1/locale

Everything Sofia knows: name, address, weekly hours, upcoming closures, booking rules, menu with prices, allergens and sold-out dishes, services, diets, payment methods and notices for customers.

Fields left empty in the profile come back as null or empty. caparra and dehors are null when not active; animali is ammessi, solo_piccola_taglia or non_ammessi. With no premises open to the public (home visits, online, at the client's) senza_sede is true: indirizzo, come_arrivare and parcheggio are null and zona gives the area served; with premises senza_sede is false and zona is null.

curl https://askher.it/api/v1/locale \
  -H "Authorization: Bearer $ASKHER_CHIAVE"

200Response

{
  "id": "osteria-del-borgo",
  "nome": "Osteria del Borgo",
  "assistente": "Sofia",
  "descrizione": "Cucina di tradizione e pasta fatta in casa.",
  "cucina": ["italiana"],
  "fascia_prezzo": "€€",
  "sito": null,
  "modalita": "tavoli",
  "coperti": 60,
  "agenda": null,
  "senza_sede": false,
  "indirizzo": { "via": "Via Roma 1", "citta": "Bergamo", "cap": "24121" },
  "zona": null,
  "come_arrivare": null,
  "parcheggio": null,
  "orari": {
    "lunedi": [],
    "martedi": [{ "da": "19:00", "a": "23:00" }],
    "mercoledi": [{ "da": "19:00", "a": "23:00" }],
    "giovedi": [{ "da": "19:00", "a": "23:00" }],
    "venerdi": [{ "da": "12:00", "a": "14:30" }, { "da": "19:00", "a": "23:30" }],
    "sabato": [{ "da": "12:00", "a": "14:30" }, { "da": "19:00", "a": "23:30" }],
    "domenica": [{ "da": "12:00", "a": "15:00" }]
  },
  "chiusure": [{ "dal": "2026-12-24", "al": "2026-12-26", "motivo": "Natale" }],
  "prenotazioni": {
    "persone_max": 10,
    "tolleranza_minuti": 15,
    "caparra": null,
    "regole": []
  },
  "menu": [
    {
      "piatto": "Casoncelli alla bergamasca",
      "categoria": "Primi",
      "prezzo": 14,
      "allergeni": ["glutine", "uova", "latte"],
      "etichette": ["della casa"],
      "disponibile": true,
      "descrizione": null
    }
  ],
  "servizi": {
    "asporto": true,
    "consegna": false,
    "eventi_privati": true,
    "wifi": true,
    "accessibile": true,
    "seggiolone": true,
    "dehors": { "posti": 20, "periodo": "da maggio a settembre" },
    "animali": "solo_piccola_taglia"
  },
  "diete": { "vegetariano": true, "vegano": false, "senza_glutine": true, "senza_glutine_certificato": false },
  "pagamenti": ["Contanti", "Carte di credito"],
  "avvisi": []
}

Appointment-based businesses

Practices, salons and centres work by appointment: GET /api/v1/locale says so with modalita: "appuntamenti" (restaurants have "tavoli") and agenda lists the services with their length in minutes, the staff and who does what. Each staff member handles one appointment at a time; with no staff listed, the business handles one at a time.

In this mode availability, creation and changes also accept servizio, operatore and durata_min, and persone becomes optional (it defaults to 1). If the business has a price list, the service must be one of its services (case and accents don't matter) and sets the length; without operatore askher picks a free staff member among those who offer that service. For a restaurant these fields return 400 (campo_sconosciuto) in the body and are ignored in the query.

curl -X POST https://askher.it/api/v1/prenotazioni \
  -H "Authorization: Bearer $ASKHER_CHIAVE" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: visita-0412" \
  -d '{"data":"2026-12-03","ora":"10:00","servizio":"Igiene","nome":"Verdi"}'

201Response

{
  "prenotazione": {
    "codice": "T4MZ", "data": "2026-12-03", "ora": "10:00", "persone": 1,
    "nome": "Verdi", "telefono": "+393331234567", "note": null,
    "servizio": "Igiene", "operatore": "Dottor Neri", "durata_min": 45,
    "stato": "confermata", "origine": "api", "creata": "2026-11-22T18:04:11Z"
  },
  "stato": "confermata",
  "riepilogo": "giovedì 3 dicembre alle 10:00, Igiene con Dottor Neri (45 min), a nome Verdi"
}

If the time is taken you get 409 (or disponibile: false) with alternative: up to three free times close by on the same day, each with its operatore, or the first free time in the next 7 days. Every booking carries servizio, operatore and durata_min (null for tables), webhooks included. A booking in richiesta status with an exact time holds its slot in the calendar until the business confirms or cancels it, so no double bookings are created.

409Response

{
  "errore": {
    "codice": "non_disponibile",
    "messaggio": "giovedì 3 dicembre alle 10:00 non c'è posto per Igiene (45 min).",
    "alternative": [
      { "data": "2026-12-03", "ora": "09:00", "operatore": "Dottor Neri" },
      { "data": "2026-12-03", "ora": "11:00", "operatore": "Dottor Neri" }
    ]
  }
}

Availability

GET/api/v1/disponibilita

Is there availability? Answers with the same rules as Sofia, without booking anything.

Query parameters

  • datastringrequired

    Day, in YYYY-MM-DD format.

  • orastringrequired

    Time, in HH:MM format.

  • personeintegerrequired

    Integer from 1 to 60.

  • serviziostringoptional

    Appointment-based businesses only: the service from the price list, up to 60 characters.

  • operatorestringoptional

    Appointment-based businesses only: who does it, among the staff in agenda. If missing, askher picks a free staff member.

  • durata_minintegeroptional

    Appointment-based businesses only: minutes from 5 to 1440, for a service not on the price list. Services on the price list use the listed length.

If there is no availability, alternative suggests the nearest free times. With solo_su_richiesta: true the party exceeds the business's limit: it can be booked, but the booking still needs confirmation. messaggio is the same sentence Sofia would say.

curl "https://askher.it/api/v1/disponibilita?data=2026-12-05&ora=20%3A30&persone=4" \
  -H "Authorization: Bearer $ASKHER_CHIAVE"

200Response

{
  "data": "2026-12-05",
  "ora": "20:30",
  "persone": 4,
  "disponibile": false,
  "solo_su_richiesta": false,
  "messaggio": "sabato 5 dicembre alle 20:30 è al completo per 4.",
  "alternative": [{ "data": "2026-12-05", "ora": "21:30" }]
}

Create a booking

POST/api/v1/prenotazioni

Creates a booking, with the same anti-overbooking checks as the phone.

Body fields (JSON)

  • datastringrequired

    Day, in YYYY-MM-DD format.

  • orastringrequired

    Time, in HH:MM format.

  • personeintegerrequired

    Integer from 1 to 60.

  • nomestringrequired

    Name of the person booking, up to 80 characters.

  • telefonostringoptional

    6 to 15 digits, with an optional leading +; spaces, dots, dashes and brackets are removed.

  • notestringoptional

    Up to 300 characters.

  • serviziostringoptional

    Appointment-based businesses only: the service from the price list, up to 60 characters.

  • operatorestringoptional

    Appointment-based businesses only: who does it, among the staff in agenda. If missing, askher picks a free staff member.

  • durata_minintegeroptional

    Appointment-based businesses only: minutes from 5 to 1440, for a service not on the price list. Services on the price list use the listed length.

Headers

  • Idempotency-Keystringoptional

    8 to 80 characters among letters, digits, - and _. It is valid for 24 hours per business: with the same body it returns the same response, with Idempotent-Replayed: true, without booking twice; with a different body it returns 422 (idempotency_key_riusata); if the first request is still in progress, 409 (richiesta_in_corso). If the first one fails with 502 or 503, the key can be reused.

Response 201 with the booking codice and its stato: confermata, or richiesta for groups awaiting confirmation. If there is no availability: 409 with alternatives.

Extra fields are rejected with 400, invalid values with 422.

curl -X POST https://askher.it/api/v1/prenotazioni \
  -H "Authorization: Bearer $ASKHER_CHIAVE" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: ordine-2291" \
  -d '{"data":"2026-12-05","ora":"20:00","persone":2,"nome":"Rossi","telefono":"+39 333 1234567"}'

201Response

{
  "prenotazione": {
    "codice": "K7P2", "data": "2026-12-05", "ora": "20:00", "persone": 2,
    "nome": "Rossi", "telefono": "+393331234567", "note": null,
    "servizio": null, "operatore": null, "durata_min": null,
    "stato": "confermata", "origine": "api", "creata": "2026-11-22T18:04:11Z"
  },
  "stato": "confermata",
  "riepilogo": "sabato 5 dicembre alle 20:00, 2 persone, a nome Rossi"
}

409Response

{
  "errore": {
    "codice": "non_disponibile",
    "messaggio": "sabato 5 dicembre alle 20:00 è al completo per 2.",
    "alternative": [{ "data": "2026-12-05", "ora": "21:30" }]
  }
}

List bookings

GET/api/v1/prenotazioni

The business's bookings from any source: phone, website, API and management console.

Query parameters

  • dalstringoptional

    First day, YYYY-MM-DD. Defaults to today.

  • alstringoptional

    Last day included, YYYY-MM-DD, equal to or after dal. If omitted, all later bookings.

Sorted from the furthest to the nearest. stato is confermata, richiesta, arrivati or annullata; origine is telefono, sito, api or gestore.

curl "https://askher.it/api/v1/prenotazioni?dal=2026-12-01&al=2026-12-07" \
  -H "Authorization: Bearer $ASKHER_CHIAVE"

200Response

{
  "prenotazioni": [
    {
      "codice": "K7P2", "data": "2026-12-05", "ora": "20:00", "persone": 2,
      "nome": "Rossi", "telefono": "+393331234567", "note": null,
      "servizio": null, "operatore": null, "durata_min": null,
      "stato": "confermata", "origine": "api", "creata": "2026-11-22T18:04:11Z"
    },
    {
      "codice": "M3QX", "data": "2026-12-03", "ora": "13:00", "persone": 4,
      "nome": "Bianchi", "telefono": null, "note": "Un seggiolone",
      "servizio": null, "operatore": null, "durata_min": null,
      "stato": "confermata", "origine": "telefono", "creata": "2026-11-20T09:12:40Z"
    }
  ]
}

Retrieve a booking

GET/api/v1/prenotazioni/{codice}

A booking for today, in the future or from the last 30 days. Otherwise 404.

Path parameters

  • codicestringrequired

    The booking code (e.g. K7P2), upper or lower case.

curl https://askher.it/api/v1/prenotazioni/K7P2 \
  -H "Authorization: Bearer $ASKHER_CHIAVE"

200Response

{
  "prenotazione": {
    "codice": "K7P2", "data": "2026-12-05", "ora": "20:00", "persone": 2,
    "nome": "Rossi", "telefono": "+393331234567", "note": null,
    "servizio": null, "operatore": null, "durata_min": null,
    "stato": "confermata", "origine": "api", "creata": "2026-11-22T18:04:11Z"
  }
}

Update a booking

PATCH/api/v1/prenotazioni/{codice}

Changes only the fields you send: at least one, otherwise 422 with nessun_cambio. Name and phone cannot be changed. Availability is re-checked as for a new booking: if there is no room, 409 with alternatives and the booking stays as it was.

Body fields (JSON)

  • datastringoptional

    New day, YYYY-MM-DD.

  • orastringoptional

    New time, HH:MM.

  • personeintegeroptional

    Integer from 1 to 60.

  • notestringoptional

    1 to 300 characters: they replace the previous notes.

  • serviziostringoptional

    Appointment-based businesses only: the service from the price list, up to 60 characters.

  • operatorestringoptional

    Appointment-based businesses only: who does it, among the staff in agenda. If missing, askher picks a free staff member.

  • durata_minintegeroptional

    Appointment-based businesses only: minutes from 5 to 1440, for a service not on the price list. Services on the price list use the listed length.

Response 200 with the updated booking, its stato and the riepilogo.

curl -X PATCH https://askher.it/api/v1/prenotazioni/K7P2 \
  -H "Authorization: Bearer $ASKHER_CHIAVE" \
  -H "Content-Type: application/json" \
  -d '{"persone":3}'

200Response

{
  "prenotazione": {
    "codice": "K7P2", "data": "2026-12-05", "ora": "20:00", "persone": 3,
    "nome": "Rossi", "telefono": "+393331234567", "note": null,
    "servizio": null, "operatore": null, "durata_min": null,
    "stato": "confermata", "origine": "api", "creata": "2026-11-22T18:04:11Z"
  },
  "stato": "confermata",
  "riepilogo": "sabato 5 dicembre alle 20:00, 3 persone, a nome Rossi"
}

Cancel a booking

DELETE/api/v1/prenotazioni/{codice}

Cancels the booking. Response 200 with the booking and stato: "annullata"; 404 if the code does not exist.

curl -X DELETE https://askher.it/api/v1/prenotazioni/K7P2 \
  -H "Authorization: Bearer $ASKHER_CHIAVE"

200Response

{
  "prenotazione": {
    "codice": "K7P2", "data": "2026-12-05", "ora": "20:00", "persone": 2,
    "nome": "Rossi", "telefono": "+393331234567", "note": null,
    "servizio": null, "operatore": null, "durata_min": null,
    "stato": "annullata", "origine": "api", "creata": "2026-11-22T18:04:11Z"
  },
  "stato": "annullata"
}

Webhooks and website

Webhooks

In the management console, under Sul tuo sito → Webhook (“On your site → Webhooks”), enter a public https:// address. askher sends a JSON POST when a booking comes from the website button, the API or the management console. Bookings taken by phone can be read with GET /api/v1/prenotazioni.

Events: prenotazione.creata, prenotazione.modificata, prenotazione.annullata, and prova when you send a test event from the management console. dati holds the booking, with the same fields as the API.

Body

{
  "id": "evt_9f2c41d07a6be3a1",
  "evento": "prenotazione.creata",
  "locale": "osteria-del-borgo",
  "creato": "2026-11-22T18:04:12.511Z",
  "dati": {
    "codice": "K7P2", "data": "2026-12-05", "ora": "20:00", "persone": 2,
    "nome": "Rossi", "telefono": "+393331234567", "note": null,
    "servizio": null, "operatore": null, "durata_min": null,
    "stato": "confermata", "origine": "api", "creata": "2026-11-22T18:04:11Z"
  }
}

Every delivery carries the askher-evento header (the event name) and askher-firma, with User-Agent: askher-webhook/1.

Reply 2xx within 5 seconds. If your server does not respond or returns 5xx, we retry once after 2 seconds; redirects are not followed.

Verifying the signature

askher-firma: t=<seconds>,v1=<signature>: the signature is the hex-encoded HMAC-SHA256 of ${t}.${corpo}, computed with the webhook secret (it starts with whsec_) over the body exactly as received, before parsing it.

Discard events whose t is older than 5 minutes, and compare signatures in constant time.

import { createHmac, timingSafeEqual } from "node:crypto";

export function firmaValida(corpo, intestazione, segreto) {
  const parti = Object.fromEntries(intestazione.split(",").map((x) => x.split("=")));
  const t = Number(parti.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const attesa = createHmac("sha256", segreto).update(`${parti.t}.${corpo}`).digest("hex");
  const ricevuta = String(parti.v1 ?? "");
  return ricevuta.length === attesa.length && timingSafeEqual(Buffer.from(attesa), Buffer.from(ricevuta));
}

The “Ask askher” button for your website

One line before </body>: a button appears at the bottom right that opens Sofia in a chat. It answers questions about hours, services and prices (and, for restaurants, menu and allergens) using the business's profile, and books with the same rules as the phone. It states right away that it is an artificial intelligence. It is a single file, with no cookies, lives in a shadow DOM that does not touch your site's styles, works with the keyboard and screen readers, and opens full screen on phones.

HTML

<script src="https://askher.it/widget/v1.js" data-locale="ID-DEL-LOCALE" async></script>

The code with the right id is already prepared in the management console. The button only responds on the allowed sites you list there; colour and greeting can be changed from the same page, with a live preview. To prevent abuse there are limits per visitor and per business.