Swaru

Help

Your own APIs

Let the chat read a signed-in customer's own records from your systems, such as an order's status.

This is on Scale, and an admin adds them on the Integrations page. It needs signed-in visitors.

How it works

You describe one read-only request. When a signed-in customer's question needs it, the AI chooses that lookup. The service calls your API with that customer's own email or ID, and the AI answers from the fields you listed.

  • It only sends GET requests. It can read from your systems but never change them.
  • The email or ID comes from the signature your server made, never from what the customer typed or what the AI wrote. So nobody can ask about someone else's records.
  • It runs only for customers your own server signed in. It doesn't run for anonymous visitors, email senders, or customers of a site connected with a plugin.
  • The AI reads only the fields you list. Card numbers and secret keys are removed from them first.
  • Your API's responses aren't stored. They're held in memory for 5 minutes, to save calls.
  • What the AI tells the customer is kept like any chat, so anything it quotes from your API is kept with it for 90 days, and your team can read it.

Add one

  1. On the Integrations page, find Your own APIs.
  2. Give it a name, and say in a sentence when the AI should use it.
  3. Enter the address, with {email} or {user_id} where the customer's details go. For example, https://api.example.com/orders?email={email}.
  4. Enter the header that authorises the request, such as Authorization, and its value. The value is stored encrypted and never shown again.
  5. List the fields the AI may read, one a line.
  6. Press Add it, then Test with a customer's email. The test shows the names of the fields in the answer, never their values.

Writing the fields

  • order.status reads status inside order.
  • items[].name reads name from each of the first 5 items in a list.
  • [].status reads status from an answer that is a list.

A field must hold a plain value: text, a number, or yes or no. A field that holds an object or a list gives nothing, so name the values inside it.

Limits

  • 5 APIs a company, and 30 fields each.
  • The address must be https on the standard port, use a domain name, and point to the public internet. Redirects aren't followed.
  • Your API has 5 seconds to answer, up to 256 KB of JSON. A 404 means nothing on record.
  • 2 lookups for one question, 2,000 calls a day, and 20 tests a day.

When a lookup fails, the chat offers a person, and the Integrations page shows what went wrong.

Who can see what

Adding one sends customers' details to the address you typed, so your team email is told who added it and where it points. It's removed if that person leaves your team.

Still stuck? Write to hello@getswaru.com.