Developer reference

Connected Websites API

Everything a developer needs to connect a site or app to NEXTOSA: authentication, the APIs NEXTOSA hosts, the endpoints you host, signed commands, errors and limits. New to the idea? Start with the overview.

Overview

An integration runs in one of two directions. Your site to NEXTOSA uses APIs NEXTOSA hosts: live chat, events, product sync and the Booking API. NEXTOSA to your site uses endpoints you host and map on the connection: NEXTOSA calls them when an AI agent or automation needs live data.

The examples use https://YOUR-NEXTOSA-SERVER, YOUR_CONNECTION_ID and YOUR_ORGANIZATION_ID as placeholders. Inside NEXTOSA, on Connected Websites, the Developer Hub shows the real values for the connection you pick, ready to copy.
Your website category decides which endpoints NEXTOSA can call on your site. The APIs NEXTOSA hosts are not tied to a category: any connection can use them.

Authentication

Each connected website has its own inbound API key. Generate it on Connected Websites with Generate Inbound API Key. It is shown once, so store it in an environment variable on your server. Regenerating it invalidates the old key immediately.

Send it as x-api-key. The Booking API also accepts Authorization: Bearer KEY; the Events and Product sync endpoints accept only x-api-key.

Keep the key on your server. Never put it in browser code, a mobile app or a public repository. The live chat is the one exception: it needs no key, so it can run in the browser.
CredentialWhere you set itUsed for
Inbound API keyGenerated in NEXTOSA. Shown once.Your calls to the Booking API, Product sync and Events. It also signs (HMAC) every command and webhook NEXTOSA sends you.
Connection headersYou enter them on the connection, for example Authorization: Bearer ...Sent by NEXTOSA on every call to the endpoints you host.
Session idNothing to set up.The live chat API, which uses your organization id plus the visitor's session id.

Calls NEXTOSA makes to endpoints you host are not signed: protect them with the connection headers. Only commands and webhooks sent to your Outbound webhook URL carry x-nextosa-signature.

Limits

WhatLimitApplies to
Booking API, reads120 per minuteper connection
Booking API, writes30 per minuteper connection
Events and product sync30 per minuteper connection, shared by both
Live chat15 per minuteper visitor IP, shared by the three chat endpoints
Request bodies you sendabout 100 KBper request
Endpoints you host8 second timeout, first 20,000 characters readper call; public https addresses only

Going over a rate limit returns 429. Wait a moment and retry. Failed authentication attempts count toward the limit too.

Error conventions

  • Booking API: JSON { "error": "...", "details": { "code": "..." } }. Branch on details.code, not the message. Full table under the Booking API.
  • Events and product sync: authentication failures (401, 403, 404) return the status code only, with no JSON body. Product sync validation errors return JSON.
  • Live chat: JSON { "error": "..." }.

Live chat

Three ways to get a visitor into NEXTOSA as a lead. The live chat is hosted by NEXTOSA and called straight from the visitor's browser: the visitor gives an email, becomes a real contact, and chats with your AI assistant.

No API key. The sessionId it returns is the visitor's only credential, so treat it like a secret and do not log it. Limit: 15 requests per minute per visitor IP, shared across the three chat endpoints.

Start a chat session

POST/api/public/ai-chat/session

Starts a conversation for one visitor. Their email makes them a lead: an existing contact with that email is matched, otherwise a new contact is created (source: web chat) using the name you send, or "Website Visitor".

Body

organizationIdrequiredstringYour NEXTOSA organization id.
emailrequiredstringThe visitor's email. Stored lowercase.
namestring (max 200)The visitor's name.
connectionIdstringStrongly recommended. Tags the lead, and any deal or appointment the assistant creates in the chat, with this website. A wrong id is rejected rather than ignored.

Returns 201 with sessionId. Errors: 400; 404 for an unknown organization or an unknown connectionId (details.code: UNKNOWN_CONNECTION); 403 if the connection is switched off (CONNECTION_DISABLED); 429.

A lead is attributed to the website that first brought them in and is never re-attributed. This endpoint runs in the visitor's browser, so connectionId is a label your page supplies: a determined visitor could send a different one of your connection ids. When attribution must be tamper-proof, send the lead from your server as an event instead.
Request
curl -X POST "https://YOUR-NEXTOSA-SERVER/api/public/ai-chat/session" \
  -H "content-type: application/json" \
  -d '{"organizationId":"YOUR_ORGANIZATION_ID","email":"asha@example.com","name":"Asha Verma","connectionId":"YOUR_CONNECTION_ID"}'
Response201 Created
{
  "sessionId": "cmvq7k2x90002uk0c4a5b6c7d"
}

Send a chat message

POST/api/public/ai-chat/message

Sends the visitor's message and waits for the assistant's reply, returned as plain text. Replies can take a few seconds, so show a typing indicator.

Body

organizationIdrequiredstringYour organization id.
sessionIdrequiredstringFrom Start a chat session.
messagerequiredstring (1-4000)What the visitor typed.

Returns 200 with the reply's id and content. Errors: 400, 404 Chat session not found, 429.

Request
curl -X POST "https://YOUR-NEXTOSA-SERVER/api/public/ai-chat/message" \
  -H "content-type: application/json" \
  -d '{"organizationId":"YOUR_ORGANIZATION_ID","sessionId":"SESSION_ID","message":"Do you have a 3BHK available?"}'
Response200 OK
{
  "id": "cmvq7k2x90003uk0c8d9e0f1a",
  "content": "Yes - we have two 3BHK units open right now. Would you like details?"
}

Chat history

GET/api/public/ai-chat/session/:sessionId/messages

Returns the visible conversation so far, for restoring the chat after a page reload. Only the visitor's messages and the assistant's replies are included. Pass organizationId as a query parameter.

Returns 200. Errors: 400, 404 Chat session not found, 429.

Request
curl "https://YOUR-NEXTOSA-SERVER/api/public/ai-chat/session/SESSION_ID/messages?organizationId=YOUR_ORGANIZATION_ID"

Two more ways to capture a lead: post a form submission from your server as an event (next section), and, for Simple Website and Portfolio sites, map a Form submissions endpoint that NEXTOSA reads on demand (see Endpoints you host).

Send an event

Send an event

POST/api/webhooks/connected-apps/:connectionId

Posts one event from your server. NEXTOSA resolves the contact, then starts every active automation whose Connected software event trigger points at this connection, each as its own durable run. Works for every category.

Send a unique event id on every event. Add X-Event-Id: <your id> (or Idempotency-Key), for example your own lead or order id. NEXTOSA runs each id once per 24 hours: a retry or replay with the same id is acknowledged with 200 but not processed again, so your automations never fire twice. Without an id there is no deduplication, so a retry runs the automation again. Ids can be up to 200 characters and are scoped to this connection.

Headers

x-api-keyrequiredheaderThis connection's API key. A Bearer header is not accepted here.
X-Event-IdheaderYour unique id for this event (or send Idempotency-Key). Max 200 characters.
Content-Typeheaderapplication/json

Body (a JSON object)

phonestringIdentifies the contact. Send international format, for example +919876543210. It must match how the contact is stored to find them; anything else creates a new lead.
contactIdstringA NEXTOSA contact id, if you have one. Takes priority over phone.
namestring (max 200)Saved on a new lead or a contact with no real name yet. Never overwrites a name already on record.
emailstringSaved lowercase when the contact has none. Never replaces an existing one. Ignored if it is not a valid address.
eventTypestring (max 100)Your own label, for example lead.created or order.paid. An automation can be set to run only for one eventType.
(any other fields)anyPassed through untouched to your automations as {{trigger.payload.fieldName}}. The event label is {{trigger.eventType}}.

You must send phone or contactId: with neither, the event is acknowledged but nothing runs. An automation with an eventType filter only runs for events carrying exactly that value; one with no filter runs for every event on the connection.

Returns 200 (plain OK) once authenticated, even if processing fails internally (that is logged on NEXTOSA's side so your sender does not needlessly retry). 401 wrong key, 403 connection off, 404 unknown connection or no key generated (status only, no body), 429 rate limited.

Limit: 30 requests per minute per connection, shared with product sync. Bodies over about 100 KB are rejected.
Request
curl -X POST "https://YOUR-NEXTOSA-SERVER/api/webhooks/connected-apps/YOUR_CONNECTION_ID" \
  -H "x-api-key: $NEXTOSA_API_KEY" \
  -H "x-event-id: lead-10234" \
  -H "content-type: application/json" \
  -d '{"eventType":"lead.created","phone":"+919876543210","name":"Asha Verma","email":"asha@example.com","message":"Interested in the 3BHK on Lake Road","source":"contact-form"}'

Receive commands

When an automation runs Send command to connected software, NEXTOSA POSTs to the Outbound webhook URL you set on the connection. The command name is whatever the automation's author chose (NEXTOSA has no fixed list) and the rest of the body is the payload they wrote.

What your endpoint receives
{
  "command": "assign_plan",
  "userId": "usr_204",
  "plan": "pro"
}

Headers

x-nextosa-signaturerequiredheaderHMAC-SHA256 of the raw body, signed with this connection's API key, as sha256=<hex>. Always verify it.
Idempotency-KeyheaderStable for one automation step, even if it is re-run. Use it to skip a command you already handled.
Content-Typeheaderapplication/json
Verify the signature
import crypto from "node:crypto";
import express from "express";

const app = express();

// Verify against the RAW body: re-serialized JSON will not match the signature.
app.post("/nextosa-commands", express.raw({ type: "application/json" }), (req, res) => {
  const expected =
    "sha256=" + crypto.createHmac("sha256", process.env.NEXTOSA_API_KEY).update(req.body).digest("hex");
  const given = req.header("x-nextosa-signature") ?? "";
  const valid = given.length === expected.length && crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
  if (!valid) return res.sendStatus(401);

  const { command, ...params } = JSON.parse(req.body.toString("utf8"));
  // Skip commands you already handled: req.header("idempotency-key")
  res.json({ ok: true }); // reply 2xx within 8 seconds
});
The URL must be https:// and public. Reply with a 2xx within 8 seconds: a JSON reply is handed to the next automation step; a non-2xx reply or a timeout marks that step as failed. Nothing is sent until you have generated an API key for the connection, since it signs every command.

Product sync (E-Commerce)

Your store pushes its catalog into NEXTOSA, and the WhatsApp AI Sales Agent then answers product, price and stock questions from real data. Link the connection to a WhatsApp number to turn this on; only one connected store can have it on at a time.

Sync products

POST/api/webhooks/sync-products/:connectionId

Products are matched on your own externalProductId, so sending a product again updates it instead of duplicating it. Products you leave out of a request are left as they are: sync never deletes. Authenticate with x-api-key from your store's server, on each change or on a schedule.

Body

productsrequiredarray (1-500)The products to create or update.

Each product

externalProductIdrequiredstring (1-200)Your store's own product id: the update key.
namerequiredstring (1-300)Product name.
pricerequirednumber (0 or more)Unit price.
currencystring (3 letters)ISO currency code, for example INR or USD. Defaults to INR.
inventoryinteger or nullStock on hand. null means you do not track stock; 0 means genuinely out of stock, and the AI says so rather than offering it.
descriptionstring (max 5000)Shown to the AI so it can describe the product.
imageUrlstring (URL)Product image URL.
skustring (max 200)Your SKU.

Returns 200 with { "ok": true, "synced": N }. Errors: 400 (JSON, error: "Invalid request" with details.fieldErrors); 401 wrong key, 403 connection off, 404 unknown connection or no key (status only); 429.

Up to 500 products and about 100 KB per request: split a large catalog into batches. 30 requests per minute per connection, shared with the Events endpoint.
Request
curl -X POST "https://YOUR-NEXTOSA-SERVER/api/webhooks/sync-products/YOUR_CONNECTION_ID" \
  -H "x-api-key: $NEXTOSA_API_KEY" \
  -H "content-type: application/json" \
  -d '{"products":[{"externalProductId":"sku-1001","name":"Linen Shirt","description":"Breathable linen, relaxed fit.","price":1499,"currency":"INR","inventory":12,"sku":"LS-1001","imageUrl":"https://cdn.example.com/ls-1001.jpg"}]}'
Response200 OK
{
  "ok": true,
  "synced": 1
}

Booking API

Hosted by NEXTOSA. Your site reads open slots and books straight into the Upcoming column, and double-booking is prevented. Base URL:

https://YOUR-NEXTOSA-SERVER/api/public/v1/booking/YOUR_CONNECTION_ID

Prerequisites on the NEXTOSA side: online booking availability is switched on (opening hours set) in the Online Booking Availability card on Connected Websites, the connection has an inbound API key, and its Booking API switch is on.

Call the API from your server, never from the visitor's browser. The key would be exposed, and browser requests are blocked on purpose.

How availability works

  • Slots sit on a grid (for example every 30 minutes) anchored to midnight in the business's timezone, within its weekly opening hours. An appointment must finish by closing time.
  • The business sets a minimum notice and a booking window. Times outside them are never offered.
  • Capacity is how many appointments may overlap. A slot is open while fewer than that many active appointments occupy it.
  • Upcoming, in-progress and pending-approval appointments all count, including ones the team typed in by hand and bookings from other connected websites. Back-to-back appointments do not conflict.
  • GET /availability is a preview. The real decision happens when you POST: it is re-checked atomically, so always handle 409 SLOT_UNAVAILABLE.
  • Times are ISO 8601 in UTC (startsAt). localTime is the same moment on the business's clock, for display.

Get availability

GET/availability

Lists every open start time in a date range, grouped by calendar day in the business's timezone. Days with no openings come back with an empty slots array.

Query parameters

fromrequiredYYYY-MM-DDFirst day, as a calendar date in the business's timezone.
toYYYY-MM-DDLast day, inclusive. Defaults to from. The range can span at most 31 days.
durationMinutesinteger (5-480)Appointment length to check. Defaults to the business's default length. Only slots long enough are returned.

Returns 200. Errors: 400, 401, 403, 409 BOOKING_NOT_ENABLED.

Request
curl "https://YOUR-NEXTOSA-SERVER/api/public/v1/booking/YOUR_CONNECTION_ID/availability?from=2027-05-03&to=2027-05-05&durationMinutes=30" \
  -H "x-api-key: $NEXTOSA_API_KEY"
Response200 OK
{
  "timezone": "Asia/Kolkata",
  "durationMinutes": 30,
  "slotMinutes": 30,
  "days": [
    {
      "date": "2027-05-03",
      "slots": [
        {
          "startsAt": "2027-05-03T03:30:00.000Z",
          "endsAt": "2027-05-03T04:00:00.000Z",
          "localTime": "09:00"
        },
        {
          "startsAt": "2027-05-03T04:00:00.000Z",
          "endsAt": "2027-05-03T04:30:00.000Z",
          "localTime": "09:30"
        }
      ]
    },
    {
      "date": "2027-05-04",
      "slots": []
    }
  ]
}

Create a booking

POST/bookings

Books a slot. The customer is matched to an existing client by phone number, or added as a new lead. The booking appears in the Upcoming column straight away.

Safe to retry. Send your own unique externalBookingId. If a request times out and you send it again, you get the original booking back (200 with an Idempotent-Replay: true header) instead of a duplicate.

Body

externalBookingIdrequiredstring (1-200)Your own unique id. Also your handle for GET, PATCH and DELETE.
startsAtrequiredISO 8601Start time with an explicit UTC offset, for example 2027-05-03T04:30:00.000Z or 2027-05-03T10:00:00+05:30. Must be a slot you were offered.
servicerequiredstring (1-300)What is being booked. Shown as the appointment title.
customer.namerequiredstring (1-200)The customer's name.
customer.phonerequiredstring (5-30)With country code, for example +919876543210. Identifies the customer.
customer.emailstringCustomer email address.
durationMinutesinteger (5-480)Defaults to the business's default appointment length.
notesstring (max 2000)Free-text notes shown on the appointment.
extraobjectUp to 20 flat key/value pairs (string, number or boolean) stored on the appointment, for example a campaign or party size.

Returns 201 (or 200 on a replay) with { "booking": ... }. Errors: 409 SLOT_UNAVAILABLE, 409 IDEMPOTENCY_CONFLICT, 409 BOOKING_CANCELLED, 422 INVALID_SLOT, 422 INVALID_PHONE.

Request
curl -X POST "https://YOUR-NEXTOSA-SERVER/api/public/v1/booking/YOUR_CONNECTION_ID/bookings" \
  -H "x-api-key: $NEXTOSA_API_KEY" \
  -H "content-type: application/json" \
  -d '{"externalBookingId":"order-1042","startsAt":"2027-05-03T04:30:00.000Z","service":"Consultation","durationMinutes":30,"customer":{"name":"Asha Verma","phone":"+919876543210","email":"asha@example.com"},"notes":"First visit"}'
Response201 Created
{
  "booking": {
    "id": "cmvq7k2x90001uk0c8h1d2e3f",
    "externalBookingId": "order-1042",
    "status": "UPCOMING",
    "service": "Consultation",
    "startsAt": "2027-05-03T04:30:00.000Z",
    "endsAt": "2027-05-03T05:00:00.000Z",
    "durationMinutes": 30,
    "notes": null,
    "customer": {
      "name": "Asha Verma",
      "phone": "+919876543210",
      "email": "asha@example.com"
    },
    "createdAt": "2027-05-01T09:12:44.000Z",
    "updatedAt": "2027-05-01T09:12:44.000Z"
  }
}
If the slot was just taken409 Conflict
{
  "error": "That time slot is no longer available.",
  "details": {
    "code": "SLOT_UNAVAILABLE",
    "alternatives": [
      {
        "startsAt": "2027-05-03T04:00:00.000Z",
        "endsAt": "2027-05-03T04:30:00.000Z"
      },
      {
        "startsAt": "2027-05-03T05:00:00.000Z",
        "endsAt": "2027-05-03T05:30:00.000Z"
      }
    ]
  }
}

Retrieve a booking

GET/bookings/:externalBookingId

Fetches a booking you made through this connection, with its current status, which changes as the business works through it (for example to COMPLETED). You can only see bookings made through your own connection.

Returns 200. Errors: 404 BOOKING_NOT_FOUND.

Request
curl "https://YOUR-NEXTOSA-SERVER/api/public/v1/booking/YOUR_CONNECTION_ID/bookings/order-1042" \
  -H "x-api-key: $NEXTOSA_API_KEY"

Reschedule a booking

PATCH/bookings/:externalBookingId

Moves an upcoming booking to a new time. The new slot goes through the same atomic check as a new booking, and the booking's own current slot never counts against it.

Body

startsAtrequiredISO 8601The new start time, with a UTC offset.
durationMinutesinteger (5-480)A new length. Defaults to the booking's current length.

Returns 200. Errors: 404 BOOKING_NOT_FOUND, 409 SLOT_UNAVAILABLE (with alternatives), 409 BOOKING_NOT_MODIFIABLE, 422 INVALID_SLOT.

Request
curl -X PATCH "https://YOUR-NEXTOSA-SERVER/api/public/v1/booking/YOUR_CONNECTION_ID/bookings/order-1042" \
  -H "x-api-key: $NEXTOSA_API_KEY" \
  -H "content-type: application/json" \
  -d '{"startsAt":"2027-05-03T05:30:00.000Z"}'
Response200 OK
{
  "booking": {
    "id": "cmvq7k2x90001uk0c8h1d2e3f",
    "externalBookingId": "order-1042",
    "status": "UPCOMING",
    "service": "Consultation",
    "startsAt": "2027-05-03T05:30:00.000Z",
    "endsAt": "2027-05-03T06:00:00.000Z",
    "durationMinutes": 30,
    "notes": null,
    "customer": {
      "name": "Asha Verma",
      "phone": "+919876543210",
      "email": "asha@example.com"
    },
    "createdAt": "2027-05-01T09:12:44.000Z",
    "updatedAt": "2027-05-01T10:02:10.000Z"
  }
}

Cancel a booking

DELETE/bookings/:externalBookingId

Cancels an upcoming booking and frees its slot immediately. Cancelling twice is harmless: you get the cancelled booking back both times.

A cancelled externalBookingId cannot be reused. To book the customer again, use a new id.

Returns 200. Errors: 404 BOOKING_NOT_FOUND, 409 BOOKING_NOT_MODIFIABLE (already in progress or finished).

Request
curl -X DELETE "https://YOUR-NEXTOSA-SERVER/api/public/v1/booking/YOUR_CONNECTION_ID/bookings/order-1042" \
  -H "x-api-key: $NEXTOSA_API_KEY"
Response200 OK
{
  "booking": {
    "id": "cmvq7k2x90001uk0c8h1d2e3f",
    "externalBookingId": "order-1042",
    "status": "CANCELLED",
    "service": "Consultation",
    "startsAt": "2027-05-03T04:30:00.000Z",
    "endsAt": "2027-05-03T05:00:00.000Z",
    "durationMinutes": 30,
    "notes": null,
    "customer": {
      "name": "Asha Verma",
      "phone": "+919876543210",
      "email": "asha@example.com"
    },
    "createdAt": "2027-05-01T09:12:44.000Z",
    "updatedAt": "2027-05-01T10:15:31.000Z"
  }
}

The booking object

Fields

idstringNEXTOSA's internal id for the appointment.
externalBookingIdstringYour id, as sent when creating it.
statusstringUPCOMING, IN_PROGRESS, COMPLETED, CANCELLED. Rarely PENDING_APPROVAL or WAITLISTED.
servicestringWhat was booked.
startsAt / endsAtISO 8601, UTCThe appointment's start and end.
durationMinutesintegerLength of the appointment.
customerobjectname, phone (E.164) and email (or null).
createdAt / updatedAtISO 8601, UTCWhen it was made and last changed.

Booking webhooks

Set an Outbound webhook URL on the connection and NEXTOSA POSTs to it whenever a booking made through that connection is created, rescheduled or cancelled.

Request body
{
  "command": "booking.created",
  "booking": {
    "id": "cmvq7k2x90001uk0c8h1d2e3f",
    "externalBookingId": "order-1042",
    "status": "UPCOMING",
    "service": "Consultation",
    "startsAt": "2027-05-03T04:30:00.000Z",
    "endsAt": "2027-05-03T05:00:00.000Z",
    "durationMinutes": 30,
    "notes": null,
    "customer": {
      "name": "Asha Verma",
      "phone": "+919876543210",
      "email": "asha@example.com"
    },
    "createdAt": "2027-05-01T09:12:44.000Z",
    "updatedAt": "2027-05-01T09:12:44.000Z"
  }
}

What you receive

commandstringbooking.created, booking.rescheduled or booking.cancelled.
bookingobjectThe full booking object.
x-nextosa-signatureheaderHMAC-SHA256 of the raw body, signed with your API key, as sha256=<hex>. Always verify it.
Idempotency-KeyheaderStable per event. Use it to ignore a delivery you already handled.

Verify the signature exactly as shown under Receive commands.

The URL must be https:// and publicly reachable. Reply with a 2xx within 8 seconds; otherwise the delivery is retried (up to 3 attempts, with increasing delays). The same events are also available as the Connected software event trigger in the Automation Builder.

Booking errors

StatusCodeMeaning
400(Invalid request)The body or query failed validation. details.fieldErrors lists each problem.
400INVALID_DATEfrom or to is not a real YYYY-MM-DD date, or to is before from.
400RANGE_TOO_LARGEThe availability range spans more than 31 days.
400INVALID_DURATIONdurationMinutes must be a whole number from 5 to 480.
401UNAUTHORIZEDMissing or wrong API key, or the connection id does not exist. The two are deliberately indistinguishable.
403CONNECTION_DISABLEDThe connection is switched off in NEXTOSA.
403BOOKING_API_DISABLEDThe connection's Booking API switch is off.
404BOOKING_NOT_FOUNDNo booking with that externalBookingId was made through this connection.
409BOOKING_NOT_ENABLEDThe business has not turned on online booking, or has not configured availability yet.
409SLOT_UNAVAILABLEThat time was taken. details.alternatives lists the nearest open slots.
409IDEMPOTENCY_CONFLICTThat externalBookingId already exists with a different start time. Use PATCH to move it.
409BOOKING_CANCELLEDThat externalBookingId belonged to a booking that was cancelled. Use a new id to book again.
409BOOKING_NOT_MODIFIABLEOnly an upcoming booking can be rescheduled or cancelled. This one has started or finished.
422INVALID_SLOTThat start and duration could never be offered: off the slot grid, closed, outside hours, too soon or too far ahead.
422INVALID_PHONEcustomer.phone is not a valid number. Include the country code, for example +919876543210.
422UNSUPPORTED_BUSINESS_TYPERestaurants and salons use their own booking engines and cannot use this API.
429(rate limited)Too many requests. See the limits table.

Practical advice: use your own order or reservation id as externalBookingId so a retry can never double-book; treat availability as a hint and show returned alternatives on a 409; always send an explicit UTC offset and display times using localTime; verify every webhook signature and make your handler idempotent.

Your own booking system

Prefer to keep your own scheduling system as the source of truth? Choose the Booking / Appointments category, map the two URLs below under the connection's Settings tab, and NEXTOSA calls your endpoints when an AI agent, an automation or the connection's dashboard wants to create a booking or look up open times.

In this mode your system decides whether a slot is free. NEXTOSA's own double-booking protection only applies to the Booking API above.

The two endpoints (Create booking, Open slots) are described in the next section.

Endpoints you host

Map a URL per endpoint under the connection's Settings tab, and add the headers NEXTOSA should send. NEXTOSA calls them when an AI agent, an automation or the connection's dashboard needs the data, and reads the answer without keeping a copy.

What NEXTOSA expects. A public https:// URL (private and internal addresses are blocked) that answers within 8 seconds with a 2xx and a JSON body. Only the first 20,000 characters are read, so a longer body is cut off mid-JSON and cannot be parsed: return recent or summarised data, not your whole database. Calls are not signed, so protect the endpoint with the header(s) you add on the connection. The response shapes below are recommended, not enforced.

Create booking

POSTBooking / Appointments

NEXTOSA sends: JSON body: customerName (required), startTime (as the caller supplied it, usually ISO 8601: parse defensively), customerPhone and notes (empty strings when unknown).

Recommended response200 OK
{
  "id": "bk_7781",
  "status": "confirmed"
}

Open slots

GETBooking / Appointments

NEXTOSA sends: Optional query parameter daysAhead (an integer), only when the caller supplies it.

Recommended response200 OK
{
  "slots": [
    {
      "start": "2027-05-03T10:00:00+05:30",
      "end": "2027-05-03T10:30:00+05:30",
      "available": true
    },
    {
      "start": "2027-05-03T10:30:00+05:30",
      "end": "2027-05-03T11:00:00+05:30",
      "available": false
    }
  ]
}

Orders

GETE-Commerce

NEXTOSA sends: Optional query parameter daysBack (an integer), only when the caller supplies it.

Recommended response200 OK
{
  "orders": [
    {
      "id": "1001",
      "createdAt": "2027-04-28T10:15:00.000Z",
      "status": "paid",
      "total": 2998,
      "currency": "INR",
      "items": [
        {
          "title": "Linen Shirt",
          "quantity": 2,
          "price": 1499
        }
      ],
      "customer": {
        "name": "Asha Verma",
        "email": "asha@example.com"
      }
    }
  ]
}

Create product

POSTE-Commerce

NEXTOSA sends: JSON body: title and price (required), description and sku (empty strings when blank).

Recommended response200 OK
{
  "id": "p_5521",
  "url": "https://shop.example.com/products/linen-shirt"
}

Form submissions

GETSimple Website and Portfolio

NEXTOSA sends: Optional query parameter daysBack (an integer), only when the caller supplies it.

Recommended response200 OK
{
  "leads": [
    {
      "id": "ld_310",
      "name": "Asha Verma",
      "email": "asha@example.com",
      "phone": "+919876543210",
      "message": "Interested in your services",
      "submittedAt": "2027-04-29T08:41:00.000Z"
    }
  ]
}

Listings

GETReal Estate

NEXTOSA sends: Nothing: a plain GET.

Recommended response200 OK
{
  "listings": [
    {
      "id": "L-2041",
      "title": "3BHK apartment, Lake Road",
      "type": "apartment",
      "status": "for-sale",
      "price": 8900000,
      "currency": "INR",
      "bedrooms": 3,
      "city": "Pune"
    }
  ]
}

Courses

GETEdTech / Courses

NEXTOSA sends: Nothing: a plain GET.

Recommended response200 OK
{
  "courses": [
    {
      "id": "crs_88",
      "title": "Data Analysis with Python",
      "level": "beginner",
      "price": 4999,
      "currency": "INR",
      "durationHours": 24
    }
  ]
}

Usage

GETSaaS

NEXTOSA sends: Nothing: a plain GET.

Recommended response200 OK
{
  "period": "2027-04",
  "totals": {
    "accounts": 148,
    "activeUsers": 1210,
    "apiCalls": 2840000
  },
  "accounts": [
    {
      "id": "acc_901",
      "plan": "pro",
      "seats": 12,
      "activeUsers": 9,
      "apiCalls": 41000,
      "status": "active"
    }
  ]
}

A minimal handler, shown for the orders endpoint (every endpoint follows the same shape):

Example handler
import express from "express";

const app = express();

app.get("/api/nextosa/orders", async (req, res) => {
  // The header you configured under Headers on the connection.
  if (req.header("authorization") !== `Bearer ${process.env.NEXTOSA_TOKEN}`) return res.sendStatus(401);
  const daysBack = Number(req.query.daysBack ?? 30);
  const orders = await db.orders.findRecent({ daysBack, limit: 50 }); // your own data layer
  res.json({ orders }); // keep it under 20,000 characters
});

Simple Website and Portfolio connections share the one Form submissions endpoint.

Go-live checklist

  • The inbound API key is stored in a server-side environment variable, not in browser code or a repository.
  • Every event carries a unique X-Event-Id, so a retry cannot run an automation twice.
  • Every command and webhook handler verifies x-nextosa-signature against the raw body and answers within 8 seconds.
  • Booking calls use your own externalBookingId and handle 409 SLOT_UNAVAILABLE by offering the alternatives.
  • Phone numbers are in international format, so the right contact is found instead of a new lead being created.
  • Endpoints you host are public https, protected by a header, and keep their answer under 20,000 characters.
  • Large catalogs are synced in batches of at most 500 products.

Questions about a specific integration? Contact us. For the non-technical picture, see the Connected Websites overview.

Ready to run your entire business on one platform?

Join businesses using NEXTOSA to manage billing, staff, and compliance, and automate client communication on WhatsApp — all from one AI operating system.