Webhooks and white label

Have Orkosi call your own server when a task finishes, a message arrives or a call ends, check the signature of each call and read the delivery log. Put your own name, logo and colours on the page where your users connect their social accounts, and make the links that open it.

This guide covers two pages that are meant for a business with a developer, or with software of its own: Settings › Webhooks (Orkosi calls your server when something happens in your workspace) and Whitelabel, a group of its own in the left bar with one page (the page where your own users connect a social account carries your name, logo and colours).

Both pages are listed in the sidebar for the owner and the admins of a workspace, and both carry the badge Whole organization: what you set applies to the whole workspace, not only to you.

Webhooks

A webhook is an address on your own server. When something happens in your workspace, for example a task finishes, a message arrives or a call ends, Orkosi sends the event to that address as a POST request with a JSON body. Your order system, your CRM or any other software can then react at once, without asking Orkosi again and again.

Settings › Webhooks lists the webhooks of the workspace: Name, Endpoint, Status, Events, Health and Last delivery. Once you have one, a search (by name or address) and a status filter appear. The line under the list says how many webhooks the workspace has and how many it may have. At the limit, Create webhook is disabled and the page says to delete one to add another.

Status What it means
Active Events are sent to the address.
Paused You paused it. Events that happen while it is paused are not sent later.
Switched off Orkosi switched it off after repeated failures. Nothing is sent until you switch it on again.
Health What it means
Healthy Recent deliveries arrived. The line under it says how many of the last ones.
Failing Recent deliveries did not arrive.
No deliveries yet Nothing was sent to this address yet.

Create a webhook

Choose Create webhook. The panel asks one thing at a time:

  1. Name and address. The Name is only for you, for example "Order system". The Address is a public https address on your server. An address that does not start with https://, or that is not public, is refused.
  2. Choose the events. See the events below.
  3. Extra headers (optional). Add them only if your server asks for them, for example an API key. Choose Add a header and fill in the Header name and the Value. Values are stored encrypted and are never shown again. Host, Content-Length and the signature headers are set by Orkosi and cannot be replaced.
  4. Webhook created. The panel shows the Signing secret and how to check a signature in Node and in Python. This is the only time the secret is shown. Copy it, keep it where your server can read it, then choose I have copied the secret.

The events

You choose the events in one of two ways:

  • Every event, including ones added later. Your server gets everything Orkosi can send, and each new kind of event from the day it exists.
  • Or one by one: tick single events, or Select all in a group. Search events finds one by name.

The list of events comes from Orkosi itself, in groups, with one plain line for each event:

Group What it is about
Tasks Work your AI team does for you.
Messages Conversations in the inbox, on every channel.
Calls Phone calls on your numbers.
Phone numbers Numbers you buy, release or change.
Registrations Reviews by carriers and operators.
WhatsApp Templates, flows and the state of your senders.
iMessage Your iMessage lines and who agreed to hear from you.
Social Connected accounts and published posts.
Contacts People in your contact list.
Webhooks A test you send yourself, to check your server answers.

Every event on the list is sent today. When an event is added before the feature behind it is finished, it is listed with the mark Not sent yet so you see what is coming, and it cannot be ticked on its own, because it would never arrive. The page is always the list to trust.

What your server receives

Each delivery is a POST with a JSON body. The body names the event, when it occurred, an id of the event and, under data, what happened.

Every request is signed, so your server can tell that it came from Orkosi. The panel that shows the signing secret gives the exact header names and a ready example. In short:

  • Every request carries a signature header and a timestamp header.
  • The signed text is the timestamp, a dot, then the body exactly as it arrived.
  • The signature is v1= followed by the HMAC of that text with SHA-256 and your signing secret.
  • Refuse a request whose timestamp is too far from now. The example states the number of minutes.
  • The delivery header is different for every delivery and stays the same when a delivery is tried again, so your server can ignore one it already handled.

Answer with a success status as soon as you have the event. When your server does not answer or answers with an error, Orkosi tries again later, several times. The log shows each delivery as attempt so many of so many.

One webhook in detail

Open a webhook to see its address, its Status, its Events, its Extra headers (names only), its Health, its Last delivery and when it was Created.

Action What it does
Send a test event Sends the example of an event you pick to the address now, signed like a real one, and shows what your server answered. A test is sent once, and it does not count towards switching the webhook off.
Edit Changes the name, the address, the events and the extra headers. Changes apply to the next delivery.
Pause Stops sending. Events that happen while it is paused are not sent later. Deliveries that were already waiting are sent when you choose Resume.
Switch on again Shown on a webhook Orkosi switched off. Use it when your server answers again.
New signing secret Makes a new secret and shows it once. The page says for how many hours your server may keep using the previous one. During that time every delivery carries two signatures, one for each secret, so nothing is lost while you switch.
Delete Orkosi stops calling the address and its delivery log is removed. This cannot be undone.

The values of extra headers are never shown again after they are saved. Edit lists their names and offers Keep the headers as they are or Replace the headers. Replacing starts from an empty list: enter every header your server needs again.

A webhook that Orkosi switched off says when, and the last problem it met.

The delivery log

Under the details, Delivery log lists every event sent to the address, newest first: When, Event, Result, Answer, Duration and Attempts. The heading says for how many days deliveries are kept. Filter by event, by result and by day, and choose Refresh to read the log again.

Result What it means
Delivered Your server accepted it.
Retrying An attempt failed. Orkosi tries again; the delivery says when.
Failed Every attempt failed. It is not tried again by itself.
Waiting It is queued and was not sent yet.

Answer is the status your server gave, such as HTTP 200, or No answer when it gave none. A delivery marked Test was a test event, and one marked Sent again repeats an earlier one.

Open a delivery to see What Orkosi sent (the request headers and body) and What your server answered (the status, the headers and the first part of the body). The signature and the values of your extra headers are never kept in the log. Only the first part of a long answer is kept, and anything that looks like a secret is masked.

  • Send again on one delivery makes a new delivery with the same body.
  • Send the failed ones again queues every failed delivery of the days you chose. They are sent within a minute, with the same body and event id as the first time. Nothing is sent while the webhook is off.

Other ways to be notified

Under the list, Other ways to be notified holds two older ways that keep working for whoever set them up:

  • Simple Webhook: one address that receives task.completed, task.failed, deploy.success and credits.low as JSON. Saving it shows a signing secret once. You can send a test event to it and remove it.
  • Advanced Notification Endpoints: choose Add endpoint, pick a Channel (Webhook, Slack, Discord or Email), give it a label and an address (or a list of e-mail addresses separated by commas) and tick the events. All events takes the events about agents, tasks, deploys and credits. The events under Your business carry personal details of your own visitors and customers, so they are sent only to an endpoint that ticks them. Each endpoint shows its Recent deliveries, and a failed one can be sent again with Redeliver.

For a new integration, use Create webhook above: it has the full list of events, the delivery log and the signing secret that can be replaced without losing a delivery.

Whitelabel

If you build a product of your own on Orkosi, your users may need to connect one of their social accounts to it. They do that on a page Orkosi hosts. The Whitelabel page gives that page your name, logo, colours and words, lists the sites a person may be sent back to, and shows the links that lead to the page. White label is about that one page: it changes nothing else, and it is not a way to offer Orkosi itself under your own name.

The page has a form on the left and a Live preview on the right (under the form on a narrow screen). The preview is the real page, drawn from what is in the form right now, saved or not. Its tabs show the four screens (Welcome, Form, Connected, Not connected) and a picker shows the page for each network. The buttons of the preview do nothing.

Set up the page

Group What you set
Welcome screen Show on every connect link. The welcome screen says who is asking before the person goes on. Switched on, every link your server creates shows it. A test link made on this page always shows it.
Branding The App title (your product's name, which replaces Orkosi in the heading), the Logo, the Terms link and the Privacy link, shown as small links at the bottom of every screen.
Brand The Accent colour, the Banner behind the two logos, the First line icon and Second line icon, the Button colour and Button text, the Corner radius and the Page background.
Texts The sentences of the Welcome screen, Connected and Not connected screens. Write {app} where your app title goes and {network} where the network's name goes. An empty field uses the usual wording.
Return sites The sites a link may send a person back to. See Return sites and the signing secret.

Things to know:

  • Logo. A square PNG, JPEG or WebP, within the size the field states. Choose Upload logo, or paste the https address of an image and choose Use this image. Orkosi makes its own copy. The logo is saved the moment it is accepted, apart from the Save button. Without a logo, the tile shows the first letter of your app title.
  • Button colour. The form shows the contrast between the button and its text and refuses a button nobody can read. Switch the Button text or choose another colour.
  • Links. The terms link, the privacy link and each return site must be full addresses that start with https://.
  • Secured by Orkosi. This line stays on the page and cannot be switched off. Right after this page, the network's own sign-in page names the Orkosi app that asks for access, so the person is told here first.
Button What it does
Save Saves the whole form. A refused value is printed next to its field, and nothing is saved until every field passes. Every new and open link shows the saved look.
Discard changes Goes back to what was last saved.
Reset to the Orkosi look Asks first. The app title, logo, links, colours, icons and texts go back to the Orkosi look. Your return sites and your signing secret stay as they are.

A connect link opens the hosted page once, for one person. Your server makes the links with the API, using a key that has the connect:write permission. Keys are created on Integrations › API; see Your keys in the workspace. The card Connect links states how many links a workspace may make in an hour.

The card lists the newest links, made by the API or by hand on this page:

Column What it shows
Network The network the link connects.
Reference Your own id for the person, when the link was made with one.
State See the table below.
Made by This page for a test link, API for a link your server made.
Made When the link was made.
Finished or expires When it finished, or when it runs out.
Actions Revoke, on a link that has not finished.
State What it means
Created The link exists and nobody opened it yet.
Opened The person opened the page.
Completed The account was connected.
Failed The account could not be connected.
Expired The link ran out before it was used.
Revoked You revoked it.

The list never shows the address of a link. Orkosi keeps no readable copy of it.

Create a test link makes one link by hand, so you can walk through the page as one of your users would. It asks what the API asks:

Field What to put
The network Which network the person connects.
Kind of account The kind of account, for a network that has several.
Your reference (optional) Your own id for the person, for example their user id in your product. It comes back to you with the result and is never shown on the page.
Send the person back to (optional) Where the person goes after connecting. It must be on one of your return sites.
Product (optional) The slug of the product the account will belong to. Empty means the account belongs to the workspace.
Expires after (minutes) How long the link lives, up to the number the field states. A short life is safer.

The dialog then shows Your test link. Copy it now: it is shown this once, works once and expires at the time shown. Open the page opens it.

What your users see

The hosted page has no Orkosi navigation. It shows your logo next to the logo of the network, and one screen at a time:

  1. The welcome screen, when it is on: a heading such as "{app} wants to connect to your {network}", two lines of reassurance, Continue and Cancel.
  2. The sign-in. For most networks the person signs in on the network's own page, then comes back. A network without a sign-in page of its own shows a form instead: the person types the details the network gave them. They are sent once, over a secure connection, and never shown again. The form says how many tries are left on the link.
  3. Which account, when the sign-in gives access to more than one page or channel.
  4. Connected or Not connected, in your words, with a button back to your product when the link has a return address. The page says it is taking the person back and does so after a few seconds.

A link that cannot be used shows a plain page that says why:

What the person sees What it means
This link does not work The address is not a connect link.
This link has expired Connect links only work for a short time.
This link was already used A connect link works once.
This link was cancelled You revoked the link.

In each case the person is told to go back to the app that sent them and ask for a new link.

Return sites and the signing secret

After connecting, a link may send the person back to your site with the result. It may only go to a site listed under Return sites. A link that names any other address is refused when it is made, and checked again when the person goes back. Choose Add a site, type the address of your site with https:// and save. The form says how many sites you can list. Until you add one, a link shows its result and the person closes the page.

When a person goes back to your site, the address carries the result: the link id, your reference, the state and the id of the connected account, with a signature. The card Signing secret holds the secret your server checks that signature with (HMAC-SHA256) before it trusts the result. Keep it on your server, never in a page or an app.

  • Show the secret reads it when you ask. Hide removes it from the page again.
  • Make a new secret asks first. The old secret stops working at once: until your server has the new one, it cannot check the results people come back with.

When something does not work

What you see What it means and what to do
"The address must start with https://" A webhook is only sent to a secure address. Use the https address of your server.
"Enter a public address, such as https://example.com/hooks" The address is not one Orkosi can reach from outside. A private or internal address is refused.
Create webhook is disabled The workspace has as many webhooks as it may have. Delete one to add another.
Not sent yet on an event Orkosi does not send this event yet. It cannot be chosen on its own.
Failing under Health Recent deliveries did not arrive. Open the webhook, open a failed delivery and read what your server answered.
Switched off Orkosi stopped sending after repeated failures. Fix your server, then choose Switch on again and Send the failed ones again.
"The test did not arrive. See below what came back." Your server refused the test or did not answer. The panel shows the answer.
Your server refuses the signature after a new secret Give your server the new secret. The previous one keeps working only for the hours the page states.
The signing secret was not copied It is shown once. Choose New signing secret to make another.
"Fix the marked fields to save." A value of the white label form was refused. The reason is printed next to the field.
A test link cannot send the person back You have no return site saved yet. Add one under Return sites and save.
A link is refused when your server makes it It names a return address that is not on one of your return sites, or the workspace made more links in the hour than it may.
This link has expired on the hosted page The link ran out. Make a new one, with a longer life if people need more time.

For anything else, write to us through Support with the name of the webhook or the reference of the link and the message you saw.

This page as Markdown: /docs/webhooks-white-label.md. All documentation in one file: /llms-full.txt.