Skava Skava / Wiki

Custom Elements: API

An API interface is a form whose filled values Skava sends as JSON to an address you specify (your backend). This way you can connect Skava securely with your own systems.

i

You manage API interfaces in the Webapp under Custom Elements → toggle API Interfaces. Creating and editing is reserved for company admins; released interfaces can then be triggered by all members of the company.

Set up an API interface

An interface consists of input fields (they form the JSON), the target address, and authentication.

  1. Create fields: Each field gets a JSON key. On the right you see live the JSON preview, which is sent to your backend exactly this way.
  2. Address (URL): the https:// address of your backend. Only HTTPS and publicly accessible addresses are allowed (see Security below).
  3. Method: POST (default), PUT, PATCH, or GET. With GET the values are appended as query parameters instead of being sent in the body.
  4. Authentication: Set the header name (e.g. Authorization) and value prefix (e.g. Bearer ), then save the token. Optionally set an expiration date.
  5. Response fields (optional): Define by path which values from the backend response should be displayed : e.g. order.id or items[0].sku.
  6. Check with Ping and Test Request, then Release.
Skava webapp: Fields tab of an API interface. At the top the automatically included context values (user name, company, project …), below the custom fields with JSON key, on the right the form preview and the live JSON preview.
The Fields tab: each field gets a JSON key. At the top, context values like user, company and project name are included automatically. On the right you see the form and the JSON live : exactly what is sent to your backend.
Skava webapp: Endpoint tab of an API interface with fields for URL, method POST, timeout, auth header, value prefix Bearer and the input for the encrypted token.
The Endpoint tab: target address (HTTPS only), method, timeout, and auth header plus value prefix. The token is stored encrypted and never delivered to clients.
Skava webapp: Response tab of an API interface. A response field with JSON key Success is set up, on the right a preview of how the result will look in chat.
The Response tab (optional): define by path which values from the backend response are displayed. On the right, the preview of the result card as it later appears in chat.

Store token securely

The token is stored encrypted and never returned to clients : the app only shows whether a token is set and when it expires. When sending, Skava appends it server-side to the configured header. If you set an expiration date, Skava refuses the call after expiration and asks you to renew the token.

Testing: Ping and Test Request

  • Ping : a light reachability check. It only checks whether your address responds, and does not send token or form data in the process. Shows reachability, status, and response time. Ideal as a first step.
  • Test Request : the real trial run: sends sample data including token to your address and shows you the complete response as well as the extracted response fields.

As an admin, you can run both while still in draft mode to verify the integration before release.

Skava webapp: Test tab of an API interface with the Ping and Test Request buttons, the result Status 200 OK, the response time, and the complete JSON response from the backend.
The Test tab: Ping and Test Request side by side. Here with status 200, response time, and the complete backend response as JSON.

Draft and Release

Each interface starts as a draft and can be freely edited. Once everything is ready, you release it with Release.

!

Released interfaces are immutable. This is intentional: so that after release no one can secretly swap the target address or token. If you want to change something, create a new version.

Security

i

To prevent the interface from being misused, strict rules apply: only HTTPS addresses are allowed, and the address must point to a public target address : internal addresses (e.g. localhost, private networks, or cloud metadata) are rejected. Skava checks this on every call, connects exactly to the verified address, follows no redirects, and limits timeout and response size.

How the team uses a released interface

Once an interface is released, all company members can trigger it directly from a chat : no editor needed. The flow is the same as with document templates: select, fill in, send.

  1. In the chat, tap Plus at the bottom and choose Custom Element.
  2. Pick the desired template or interface from the list.
  3. Fill in the form and Send.
  4. The result appears as a card in the chat : visible to everyone in the chat.
Skava webapp: the plus menu in the chat input field with the entries Attach file, Photo/Video, Create todo, Create service item and Custom Element.
Step 1: via the Plus menu in the chat, choose Custom Element.
Skava webapp: Choose Custom Element dialog above the chat, offering the released API action Material order; result cards already sent in the background.
Step 2: select the desired template or interface : here the API action Material order.
Skava webapp: fillable form of the API action Material order with the fields article number, description, quantity, unit, requested delivery date and remark, plus the note about automatically included values.
Step 3: fill in the form. The note at the bottom shows which values are included automatically.
Skava webapp: result card of the API action Material order in the chat with status 200, the entered values, and the backend response (order number, status, delivery date) plus expandable raw data.
Step 4: the result card in the chat, with the inputs and your backend's response.

Let the AI build an element

As a company admin you do not have to use the editor yourself. Tell the Skava assistant in the chat, for example "build me an order form for my catalog with quantity and delivery address". It creates a draft from that, can change fields one at a time later, and it knows your uploaded article catalog: for orders it suggests the product picker rather than a text field for the article number.

What it may also set: endpoint and method as well as the audience ("company members only" or "also outsiders in the same chat"). For the audience it asks first instead of just setting it, because it decides who may run something from outside.

What it explicitly does not touch: the access token. It never asks for one and never accepts one, because chat messages are stored. You enter it yourself in the editor, otherwise no call goes out. And it cannot publish: the last step stays with you, so nothing becomes visible to customers unchecked.

Who may run it

The "Endpoint" tab says who may use an element. The default is the members of your company. The second setting opens it up to outsiders, but only in a chat where someone from your company is present too: exactly the case it is meant for, the customer ordering from you. When your company leaves the chat, the permission ends by itself.

Products from your own catalog

Once you have uploaded your article catalog, the builder offers a product picker block. There are no options to maintain: the list is your catalog. The person ordering searches it, sees the image, name and article number, and your backend receives the article number. Skava rejects a number that is not in your catalog. For the quantity, put a normal number field next to it.

Define the card yourself

Your backend decides what the card says. Skava only checks shape, size and safety, never meaning: it knows neither order states nor field names. To do that, answer with a card object:

{"card": {"v": 1, "title": "Order 10001", "state": "pending", "status_text": "Being picked", "fields": [{"label": "Tracking number", "value": "DPD123456789"}]}}

  • v must be the integer 1. Without it the answer does not count as a card and the response mapping configured in the element applies.
  • state is colour and icon only: ok, pending, warn or error. Anything that carries meaning goes into status_text as free text.
  • fields is a list of label and value, at most 20 entries. Values that are too long get shortened rather than rejected, so an order never fails over a detail.

The user's inputs belong to the server: they stay untouched no matter what your backend sends. They are the record in the chat of what was actually submitted.

Reporting the status later

When the element runs, Skava sends two extra values: callback_url and callback_token. Report a new state there later and a new card appears in the chat, on the phone too, while someone is looking. The previous one stays, so it is readable when which state was reported. Send the same card object as above, via POST with the header Authorization: Bearer <callback_token>. Three optional values go next to the card:

  • seq: your own counter. A report with a smaller or equal value is discarded, so two reports cannot overtake each other.
  • final: closes the interaction. The token becomes invalid and the card is final.
  • notify: set to false to post the card quietly, with no unread count and no notification. For intermediate steps that should not wake anyone. Without it, the card is a perfectly normal message.

An interaction may post at most 50 cards. The same report twice does not produce a second card.

Skava answers with 200 and a list of hints if anything was shortened or dropped, and with 422 if the card was unusable. An interaction accepts reports for 90 days.

The cards are posted by Skava's system sender, not by the person who ran the element and not by an account of your own company. Whose system is writing is stated in the card's title.

A complete example to copy lives in the repository under example_order_server/ and runs at api.skava.io.

Related

Do you instead want to build a fillable document template? See Custom Elements: Documents.

Frequently Asked Questions

What is an API interface in Skava?

A form whose filled values Skava sends as JSON to an address you specify (your backend) : handy for connecting Skava with your own systems.

Who is allowed to create and trigger API interfaces?

Creating and editing is reserved for company admins. A released interface can then be triggered by all members of the company.

What is the difference between "Ping" and "Test Request"?

Ping only checks whether the address is reachable : without token and without data. Test Request sends sample data including token and shows the complete response.

Is my API token secure?

Yes. The token is stored encrypted and never delivered to clients. The app only shows whether a token is set and when it expires.

Which addresses are allowed as endpoints?

Only publicly accessible https:// addresses. Internal targets like localhost, private networks, or cloud metadata are rejected : this protects against misuse of the interface.

Why can I no longer change a released interface?

Released interfaces are intentionally immutable : so that after release no one can swap the target address or token. For changes, you create a new version.