Switchly API Get an API keyZískat API klíčAPI-Schlüssel holenConsigue una clave API

api.switchly.ai

Your booking engine,
as an API.
Váš rezervační systém,
jako API.
Ihr Buchungssystem,
als API.
Tu motor de reservas,
como API.

Check availability, book appointments and send confirmations straight from your own product. The same engine that answers the phone, without the phone.Zjišťujte volné termíny, rezervujte a posílejte potvrzení přímo z vlastního produktu. Stejný systém, který zvedá telefon, jen bez telefonu.Prüfen Sie freie Termine, buchen Sie und versenden Sie Bestätigungen direkt aus Ihrem eigenen Produkt. Dasselbe System, das ans Telefon geht, nur ohne Telefon.Consulta disponibilidad, reserva citas y envía confirmaciones directamente desde tu propio producto. El mismo motor que contesta el teléfono, sin el teléfono.

REST over HTTPSREST přes HTTPSREST über HTTPSREST sobre HTTPS JSON in, JSON outJSON dovnitř, JSON venJSON rein, JSON rausJSON entra, JSON sale Versioned /v1Verze /v1Versioniert /v1Versionada /v1

booking a haircutrezervace střihuHaarschnitt buchenreservar un corte one calljedno voláníein Aufrufuna llamada
  1. 1

    Ask what's freeZjistit, co je volnéFragen, was frei istPregunta qué hay libre

    GET/v1/availability?service_id=svc_cut&date=2026-06-13

    "days": [{ "date": "2026-06-13", "slots": [
      { "start": "2026-06-13T10:30:00+02:00" },
      { "start": "2026-06-13T11:15:00+02:00" }
    ]}]
  2. 2

    Take the slotZarezervovat termínTermin buchenReserva la hora

    POST/v1/appointments

    "service_id": "svc_cut",
    "start_time": "2026-06-13T10:30:00+02:00",
    "customer_name": "Tony Marek",
    "customer_mobile": "+420777123456"
  3. 3

    Booked and confirmedZarezervováno a potvrzenoGebucht und bestätigtReservada y confirmada

    201Created

    "status": "booked",
    "secure_id": "4KQ2",
    "start_time": "2026-06-13T10:30:00+02:00",
    "duration_minutes": 45

    Confirmation SMS sent to the customer. 4KQ2 is the Secure ID they quote to change it.Zákazník dostal potvrzující SMS. Secure ID 4KQ2 uvede, když bude chtít termín změnit.Der Kunde hat die Bestätigungs-SMS erhalten. Mit der Secure ID 4KQ2 weist er sich aus, wenn er den Termin ändern will.El cliente ha recibido el SMS de confirmación. 4KQ2 es el Secure ID que da para cambiar la cita.

Why build on itProč na tom stavětWarum darauf aufbauenPor qué construir sobre ella

The booking rules live on our sidePravidla rezervací hlídáme myDie Buchungsregeln liegen bei unsLas reglas de reserva viven de nuestro lado

Opening hours, service durations, calendar conflicts, confirmation messages. Your integration sends a start time and gets an answer, not a pile of edge cases.Otevírací doba, délky služeb, kolize v kalendáři, potvrzovací zprávy. Vaše integrace pošle čas začátku a dostane odpověď, ne hromadu okrajových případů.Öffnungszeiten, Dauer der Leistungen, Kalenderkonflikte, Bestätigungsnachrichten. Ihre Integration sendet eine Startzeit und bekommt eine Antwort, keinen Haufen Sonderfälle.Horarios, duración de los servicios, conflictos de calendario, mensajes de confirmación. Tu integración envía una hora de inicio y recibe una respuesta, no un montón de casos límite.

One engine, every channelJeden systém, všechny kanályEin System, alle KanäleUn motor, todos los canales

API bookings run through the same code as the AI receptionist. A booking made over the phone and one made over HTTP cannot disagree.Rezervace přes API běží stejným kódem jako AI recepční. Rezervace po telefonu a rezervace přes HTTP si nemůžou odporovat.API-Buchungen laufen durch denselben Code wie die KI-Rezeption. Eine telefonische Buchung und eine über HTTP können sich nicht widersprechen.Las reservas por API pasan por el mismo código que la recepcionista con IA. Una reserva por teléfono y otra por HTTP no pueden contradecirse.

No double bookingsŽádné dvojité rezervaceKeine DoppelbuchungenSin reservas duplicadas

The availability check and the write happen under one lock per business, so two callers racing for the last slot get one winner and one clear 409 response.Kontrola volného termínu i zápis probíhají pod jedním zámkem pro každý podnik. Dva klienti, kteří se přetahují o poslední termín, tak dostanou jednoho vítěze a jednu jasnou odpověď 409.Verfügbarkeitsprüfung und Schreibvorgang laufen unter einer Sperre pro Unternehmen. Zwei Clients, die um den letzten Termin konkurrieren, bekommen einen Gewinner und eine klare Antwort 409.La comprobación de disponibilidad y la escritura ocurren bajo un único bloqueo por negocio, así que dos clientes que compiten por la última hora obtienen un ganador y una respuesta 409 clara.

Confirmations includedPotvrzení v ceněBestätigungen inklusiveConfirmaciones incluidas

Every booking sends the customer their SMS confirmation and notifies the business owner. Nothing extra to wire up.Každá rezervace pošle zákazníkovi potvrzující SMS a dá vědět majiteli podniku. Nic dalšího nemusíte napojovat.Jede Buchung schickt dem Kunden seine SMS-Bestätigung und benachrichtigt den Inhaber. Nichts weiter anzubinden.Cada reserva envía al cliente su SMS de confirmación y avisa al dueño del negocio. Nada más que conectar.

Errors you can branch onChyby, podle kterých se dá větvitFehler, auf die Sie reagieren könnenErrores con los que puedes ramificar

Every failure returns a stable key and a plain message. Handle CONFLICT once and you have handled a taken slot.Každá chyba vrací stálý klíč a srozumitelnou zprávu. Stačí jednou ošetřit CONFLICT a máte vyřešený obsazený termín.Jeder Fehler liefert einen stabilen Schlüssel und eine klare Meldung. Behandeln Sie CONFLICT einmal, und ein belegter Termin ist erledigt.Cada fallo devuelve una clave estable y un mensaje claro. Gestiona CONFLICT una vez y ya tienes resuelta la hora ocupada.

ReferencePřehledReferenzReferencia

Ten endpoints. That's the surface.Deset endpointů. To je celé API.Zehn Endpunkte. Das ist die ganze Schnittstelle.Diez endpoints. Esa es toda la superficie.

Everything under /v1 is scoped to the business behind your API key. You cannot read or touch anyone else's data.Vše pod /v1 se týká jen podniku, ke kterému patří váš API klíč. Cizí data nepřečtete ani nezměníte.Alles unter /v1 gilt nur für das Unternehmen hinter Ihrem API-Schlüssel. Fremde Daten können Sie weder lesen noch ändern.Todo lo que está bajo /v1 se limita al negocio de tu clave API. No puedes leer ni tocar datos de nadie más.

EndpointEndpointEndpunktEndpointWhat it doesCo děláWas er tutQué hace
GET/v1/me The account and the assistant behind your API key.Účet a asistent, ke kterým patří váš API klíč.Das Konto und der Assistent hinter Ihrem API-Schlüssel.La cuenta y el asistente de tu clave API.
GET/v1/assistant Business profile: name, timezone, currency, opening hours, phone numbers.Profil podniku: název, časové pásmo, měna, otevírací doba, telefonní čísla.Unternehmensprofil: Name, Zeitzone, Währung, Öffnungszeiten, Telefonnummern.Perfil del negocio: nombre, zona horaria, moneda, horario, teléfonos.
GET/v1/assistant/services Bookable services with duration and price. The IDs you book against.Rezervovatelné služby s délkou a cenou. ID, na která rezervujete.Buchbare Leistungen mit Dauer und Preis. Die IDs, auf die Sie buchen.Servicios reservables con duración y precio. Los IDs con los que reservas.
GET/v1/assistant/calendars The calendars you can book into, one per person or chair. Their IDs are what calendar_id takes.Kalendáře, do kterých lze rezervovat, jeden na osobu nebo křeslo. Jejich ID bere parametr calendar_id.Die Kalender, in die gebucht werden kann, einer pro Person oder Stuhl. Ihre IDs erwartet calendar_id.Los calendarios en los que se puede reservar, uno por persona o sillón. Sus IDs son los que acepta calendar_id.
GET/v1/availability Free start times for one service, day by day for up to 31 days, already filtered by opening hours and existing bookings.Volné časy začátku pro jednu službu, den po dni až na 31 dní, už očištěné o otevírací dobu a existující rezervace.Freie Startzeiten für eine Leistung, Tag für Tag für bis zu 31 Tage, bereits nach Öffnungszeiten und bestehenden Buchungen gefiltert.Horas de inicio libres para un servicio, día a día hasta 31 días, ya filtradas por horario y reservas existentes.
GET/v1/appointments List bookings. Filter by date range, status or calendar; paginated.Seznam rezervací. Filtr podle období, stavu nebo kalendáře; stránkovaný.Buchungen auflisten. Filter nach Zeitraum, Status oder Kalender; paginiert.Lista de reservas. Filtra por rango de fechas, estado o calendario; paginada.
POST/v1/appointments Book a slot. Returns the appointment and its Secure ID.Zarezervuje termín. Vrátí rezervaci a její Secure ID.Bucht einen Termin. Liefert die Buchung und ihre Secure ID.Reserva una hora. Devuelve la cita y su Secure ID.
GET/v1/appointments/{id} One booking, including cancellation and modification history.Jedna rezervace včetně historie zrušení a změn.Eine Buchung, samt Storno- und Änderungsverlauf.Una reserva, con su historial de cancelaciones y cambios.
PATCH/v1/appointments/{id} Move a booking to another time or service. The customer gets the change by SMS.Přesune rezervaci na jiný čas nebo službu. Zákazník dostane změnu v SMS.Verschiebt eine Buchung auf eine andere Zeit oder Leistung. Der Kunde bekommt die Änderung per SMS.Mueve una reserva a otra hora o servicio. El cliente recibe el cambio por SMS.
DELETE/v1/appointments/{id} Cancel a booking. The customer gets the cancellation SMS automatically.Zruší rezervaci. Zákazník automaticky dostane SMS o zrušení.Storniert eine Buchung. Der Kunde bekommt die Storno-SMS automatisch.Cancela una reserva. El cliente recibe el SMS de cancelación automáticamente.

ExamplesPříkladyBeispieleEjemplos

Find a slot, book it, move it, cancel itNajít termín, zarezervovat, přesunout, zrušitTermin finden, buchen, verschieben, stornierenEncuentra una hora, resérvala, muévela, cancélala

The whole flow in curl, JavaScript, Python and Go. Each one runs as it is once SWITCHLY_API_KEY holds your key, and shows how to handle the 409 you get when somebody else takes the slot first.Celý postup v curl, JavaScriptu, Pythonu a Go. Každý příklad funguje tak, jak je, stačí do SWITCHLY_API_KEY dát váš klíč. Ukazuje i, jak ošetřit 409, když vám termín někdo vezme dřív.Der ganze Ablauf in curl, JavaScript, Python und Go. Jedes Beispiel läuft so, wie es ist, sobald SWITCHLY_API_KEY Ihren Schlüssel enthält, und zeigt, wie Sie das 409 behandeln, wenn jemand anderes den Termin zuerst nimmt.Todo el flujo en curl, JavaScript, Python y Go. Cada ejemplo funciona tal cual en cuanto SWITCHLY_API_KEY contiene tu clave, y muestra cómo gestionar el 409 que recibes cuando otra persona toma la hora antes.

# Your key from Settings → API keys in the Switchly dashboard.
export SWITCHLY_API_KEY="ak_live_..."
API="https://api.switchly.ai"

# 1. The services, with the IDs you book against
curl -s "$API/v1/assistant/services" -H "X-API-Key: $SWITCHLY_API_KEY"

# 2. Free starts for one service, day by day (up to 31 days)
curl -s "$API/v1/availability?service_id=SERVICE_ID&from=2026-10-05&to=2026-10-11" \
  -H "X-API-Key: $SWITCHLY_API_KEY"

# 3. Book one of them. 409 CONFLICT means somebody was faster: ask again.
curl -s -X POST "$API/v1/appointments" \
  -H "X-API-Key: $SWITCHLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "service_id": "SERVICE_ID",
    "start_time": "2026-10-05T09:00:00+02:00",
    "customer_name": "Jana Nováková",
    "customer_mobile": "+420777123456"
  }'

# 4. Move it to another free start
curl -s -X PATCH "$API/v1/appointments/APPOINTMENT_ID" \
  -H "X-API-Key: $SWITCHLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "start_time": "2026-10-05T11:00:00+02:00" }'

# 5. Cancel it
curl -s -X DELETE "$API/v1/appointments/APPOINTMENT_ID" \
  -H "X-API-Key: $SWITCHLY_API_KEY"

AuthenticationPřihlášeníAuthentifizierungAutenticación

One header, then you're inJedna hlavička a jste uvnitřEin Header, und Sie sind drinUna cabecera y estás dentro

Create a key in the dashboard and send it on every request. There is no OAuth dance and no token to refresh.Vytvořte si klíč v dashboardu a posílejte ho s každým požadavkem. Žádné kolečko s OAuth, žádný token k obnovování.Erstellen Sie im Dashboard einen Schlüssel und senden Sie ihn bei jeder Anfrage mit. Kein OAuth-Tanz, kein Token zum Erneuern.Crea una clave en el panel y envíala en cada petición. Sin baile de OAuth y sin token que renovar.

# Book a slot
curl -X POST https://api.switchly.ai/v1/appointments \
  -H "X-API-Key: $SWITCHLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "service_id": "svc_cut",
    "start_time": "2026-06-13T10:30:00+02:00",
    "customer_name": "Tony Marek",
    "customer_mobile": "+420777123456"
  }'
  • Getting a keyJak získat klíčSo bekommen Sie einen SchlüsselCómo conseguir una clave API keys come with the Team plan. In the dashboard open Settings → API keys and create one. The key is shown once; keep it on your server.API klíče jsou součástí tarifu Team. V dashboardu otevřete Settings → API keys a vytvořte si klíč. Zobrazí se jen jednou, uložte si ho na svůj server.API-Schlüssel gibt es im Team-Tarif. Öffnen Sie im Dashboard Settings → API keys und erstellen Sie einen. Der Schlüssel wird nur einmal angezeigt; bewahren Sie ihn auf Ihrem Server auf.Las claves API vienen con el plan Team. En el panel abre Settings → API keys y crea una. La clave se muestra una sola vez; guárdala en tu servidor.
  • X-API-Key, or a bearer tokenX-API-Key, nebo bearer tokenX-API-Key oder ein Bearer-TokenX-API-Key, o un bearer token Authorization: Bearer <key> works too, whichever your HTTP client makes easier.Funguje i Authorization: Bearer <key>, podle toho, co vašemu HTTP klientovi vyhovuje.Authorization: Bearer <key> geht auch, je nachdem, was Ihr HTTP-Client leichter macht.Authorization: Bearer <key> también funciona, lo que le resulte más fácil a tu cliente HTTP.
  • Rate limited per keyLimit požadavků na klíčRate-Limit pro jeden SchlüsselLímite de peticiones por clave 120 requests a minute by default. Over the limit you get 429 with the key RATE_LIMITED.Standardně 120 požadavků za minutu. Nad limitem dostanete 429 s klíčem RATE_LIMITED.Standardmäßig 120 Anfragen pro Minute. Darüber bekommen Sie 429 mit dem Schlüssel RATE_LIMITED.120 peticiones por minuto por defecto. Por encima recibes 429 con la clave RATE_LIMITED.
  • Timestamps are RFC 3339Časy ve formátu RFC 3339Zeitstempel im Format RFC 3339Marcas de tiempo en RFC 3339 Send an offset and we keep it. Days and durations are resolved in the business timezone.Pošlete posun od UTC a my ho zachováme. Dny a délky se počítají v časovém pásmu podniku.Senden Sie einen Offset, und wir behalten ihn bei. Tage und Dauern werden in der Zeitzone des Unternehmens berechnet.Envía un desfase y lo conservamos. Los días y las duraciones se calculan en la zona horaria del negocio.
  • Keys belong to one businessKlíč patří jednomu podnikuSchlüssel gehören zu einem UnternehmenLas claves pertenecen a un negocio Every response is already scoped. There is no account ID to pass and no way to widen it.Každá odpověď už je omezená na váš podnik. Neposíláte žádné ID účtu a rozsah nejde rozšířit.Jede Antwort ist bereits eingegrenzt. Es gibt keine Konto-ID zu übergeben und keinen Weg, den Umfang zu erweitern.Cada respuesta ya está acotada. No hay ID de cuenta que pasar ni forma de ampliarla.

Failure modesChybové stavyFehlerfälleCasos de error

What goes wrong, and what you get backCo se může pokazit a co dostanete zpětWas schiefgehen kann, und was Sie zurückbekommenQué puede fallar y qué recibes

Every error arrives in one shape: a stable key you branch on, and a message for your logs. Nothing to parse out of prose.Každá chyba má stejný tvar: stálý key, podle kterého se rozhodujete, a message do logu. Nic se nemusí vyčítat z textu.Jeder Fehler hat dieselbe Form: einen stabilen key, auf den Sie reagieren, und eine message für Ihre Logs. Nichts aus Fließtext herauszulesen.Cada error llega con la misma forma: una key estable con la que decides, y un message para tus logs. Nada que sacar de un texto.

StatusStavStatusEstadoKeyKlíčSchlüsselClaveWhenKdyWannCuándo
400BAD_REQUESTThe body is not valid JSON.Tělo požadavku není platný JSON.Der Body ist kein gültiges JSON.El cuerpo no es un JSON válido.
400VALIDATION_ERRORA field is missing or malformed, or the start time is in the past.Pole chybí nebo má špatný formát, případně je čas začátku v minulosti.Ein Feld fehlt oder ist fehlerhaft, oder die Startzeit liegt in der Vergangenheit.Falta un campo o tiene un formato incorrecto, o la hora de inicio ya pasó.
401UNAUTHORIZEDThe key is missing, unknown or no longer active.Klíč chybí, neznáme ho, nebo už není aktivní.Der Schlüssel fehlt, ist unbekannt oder nicht mehr aktiv.La clave falta, es desconocida o ya no está activa.
403FORBIDDENThe key is valid, but the plan no longer includes API access. Switch to Team under Settings → Billing in the dashboard.Klíč je platný, ale tarif už přístup k API nezahrnuje. Přejděte na Team v dashboardu v Settings → Billing.Der Schlüssel ist gültig, aber der Tarif enthält keinen API-Zugang mehr. Wechseln Sie im Dashboard unter Settings → Billing zu Team.La clave es válida, pero el plan ya no incluye acceso a la API. Cambia a Team en el panel, en Settings → Billing.
404NOT_FOUNDUnknown service, calendar or appointment.Neznámá služba, kalendář nebo rezervace.Unbekannte Leistung, Kalender oder Buchung.Servicio, calendario o cita desconocidos.
409CONFLICTThe slot is taken or outside opening hours, another booking got there first, or the appointment is already cancelled or over.Termín je obsazený nebo mimo otevírací dobu, jiná rezervace byla rychlejší, nebo je rezervace už zrušená či proběhlá.Der Termin ist belegt oder außerhalb der Öffnungszeiten, eine andere Buchung war schneller, oder die Buchung ist bereits storniert oder vorbei.La hora está ocupada o fuera de horario, otra reserva llegó antes, o la cita ya está cancelada o ha pasado.
429RATE_LIMITEDToo many requests on this key. Back off and retry.Příliš mnoho požadavků na tento klíč. Počkejte a zkuste to znovu.Zu viele Anfragen mit diesem Schlüssel. Warten Sie und versuchen Sie es erneut.Demasiadas peticiones con esta clave. Espera y vuelve a intentarlo.
500INTERNAL_ERRORSomething failed on our side. Reads are safe to retry.Chyba na naší straně. Čtení můžete bezpečně zopakovat.Bei uns ist etwas schiefgegangen. Lesende Anfragen können Sie gefahrlos wiederholen.Algo falló de nuestro lado. Las lecturas se pueden reintentar sin riesgo.

Start booking from your own systemRezervujte z vlastního systémuBuchen Sie aus Ihrem eigenen SystemEmpieza a reservar desde tu propio sistema

Create a key in the dashboard and make your first call in the time it takes to read this page.Vytvořte si klíč v dashboardu a první volání zvládnete za dobu, než dočtete tuhle stránku.Erstellen Sie im Dashboard einen Schlüssel und machen Sie Ihren ersten Aufruf in der Zeit, die das Lesen dieser Seite dauert.Crea una clave en el panel y haz tu primera llamada en lo que tardas en leer esta página.

Get an API keyZískat API klíčAPI-Schlüssel holenConsigue una clave API