Duck Float
All posts
7 min read

A support API: when website forms are no longer enough

A website form works great as long as all your customers arrive through the website and describe their problem in their own words. But the moment a business grows past a simple landing page — a mobile app appears, a backend that "knows" about problems itself, internal dashboards for the support team — forms stop being enough. That's when a support API steps in: a way to create and manage requests programmatically, from any of your systems, with no human filling in fields by hand.

The difference isn't cosmetic. A form waits for the customer to show up and describe the problem in their own words, often missing important technical details. An API lets your own system initiate a request the moment it notices something — and attach all the relevant context right away.

What a support API gives you

An API is the interface through which your code can do the same things a person does by hand in an admin panel: create a ticket, add a message to an existing conversation, change a status, fetch a customer's request history. The difference is that it happens automatically and at the right moment, with no human on your side involved.

In practice, this means a support request stops being something that only ever starts with a customer's action. It can start with an event in your own system: a failed payment, an exhausted limit, a broken integration. Sometimes the customer doesn't even get a chance to complain — a ticket with the details is already waiting in the support team's inbox.

The second important point is data consistency. When requests are created manually through different forms, it's easy to lose part of the context — the app version, the customer's plan, the error code. When your code creates them via the API, those fields are always passed, following the same template, without gaps caused by human error.

When website forms aren't enough

  • Requests from the backend. Your system noticed a failure for a customer — a payment didn't go through, a partner webhook failed, a sync got stuck — and files a ticket with the details itself, without waiting for the customer to write to you first.
  • A mobile app. A "Support" button in the app creates a request via the API instead of sending users to an external page with a form they have to fill in by hand.
  • Internal tools. Your admin panel or CRM files a request on the customer's behalf when other channels are already talking to them — by phone, in a sales chat, during a meeting.
  • Bulk events. A service outage happened, or planned maintenance is coming — you need to notify a group of customers and collect their replies into manageable, individual tickets rather than one endless thread.
  • Scripts and automations. A periodic check of customer account health finds an anomaly — and instead of a Slack alert someone might miss, the system files a ticket with a clear owner and status.

In every one of these scenarios, one thing is common: the request is born not because a customer visited a contact page, but because your own system decided a person needs help.

Example: a request from the backend

Picture a typical situation. Your backend processes payments and sees the customer's card declined three times in a row. Instead of waiting for the customer to write "my payment isn't going through," the code creates a request right away — illustratively, something like this:

POST /api/tickets
{
  "customer_id": "usr_48213",
  "subject": "Recurring payment failure",
  "message": "Card declined three times in a row, error code 51",
  "context": { "plan": "pro", "attempts": 3 }
}

The operator sees a ready-made ticket in the inbox explaining what happened before the customer even sent their first message. The AI draft already accounts for these details when preparing a reply.

What to account for when working with the API

  • Customer identification. Pass a stable identifier (for example, an internal user ID or email) so requests from different sources — the website, the app, the backend — link to the same person instead of creating duplicate profiles.
  • Context. The more useful data you pass with a request — the customer's plan, the app version, an error code or message — the better and more precise the operator's or the AI draft's reply will be.
  • Key security. Keep API keys on the server, not in open client-side code: your mobile app's or frontend's code shouldn't contain a key that can create or read other people's requests.
  • Request idempotency. If your code might retry a request after a network failure, make sure a retry doesn't create a second identical ticket — this matters especially for automated scenarios with no human in the loop.
  • Rate limits. Bulk events and automations can generate many requests in a short time — plan for how your system should behave if ticket creation is temporarily throttled.

The API and webhooks work as a pair

The API lets you initiate actions, and webhooks let you learn what happened in response. Together they're a closed loop: you created a ticket via the API, and when the customer or the operator replied — your system found out via a webhook and reacted: updated the status in its own database, unlocked a feature, notified the right person.

Without this second half, the API stays a one-way channel: "write, but never hear the response." It's the combination of creating requests via the API and subscribing to events via webhooks that lets you fully automate the loop — from spotting a problem to resolving it and closing the ticket. On the other half of this loop, see the article on webhooks.

Tickets look the same regardless of source

An important detail: a request created via the API looks and behaves the same way inside the support system as a request from chat or Telegram. It has a message history, a status, tags, and a source label. An operator opening the ticket doesn't have to think "ah, this came from code, so it's special" — the interface and the workflow are the same.

This matters especially when a support team is simultaneously talking to people through the chat widget on the website (more on this in the article on the embedded widget) and handling automated requests from the backend. Both streams flow into the same inbox, and the operator never has to switch between different tools or different logic.

How it works in Duck Float

In Duck Float the public API is a full-fledged third channel alongside the Telegram bot and the chat widget on your website. Requests created via the API from your backend, mobile app, or internal tools land in the same inbox and become tickets with history, statuses, and tags — just like requests from the other channels.

AI drafts work on these tickets the same way: the model takes your product description, filled in once in the settings, and the history of the specific conversation, then prepares a draft in the customer's language right in the reply field. The operator sees it immediately and can accept it with the Tab key, edit it, or write their own reply — nothing goes to the customer automatically without a human looking at it first. For more on how these drafts work, see the article on AI drafts.

And webhooks together with the event log notify your system of every change to a ticket — a new reply, a status change, a new tag — so your backend can react without constantly polling the API. On all three channels together, see the article on one inbox.

Duck Float is free during the beta. If you have questions about the API, webhooks, or how to connect all of this to your system — message us through the widget on this site, and we'll answer personally.

Try Duck Float with your team

Free while in beta. Setup takes a few minutes.

Create an account