Skip to main content
Dev now; Staging and Production next release.
The Apps screen in the admin console is not on Dev yet. It arrives on Dev with the next admin console release. The steps on this page that happen in the console can’t be done until then.
Your company can build its own App, for example a script that posts sales alerts into a channel, without asking Octogle to register it. A company admin registers the App in the admin console and gets its credentials there. Only your company can install it. A company App uses the same OAuth install, bot user, token, scopes, rate limits and callbacks as any other App, and calls the same API. Everything else in these docs applies to it.

Who can register an App

Company admins with the apps.manage permission. The company admin role and the super admin have it. A custom role can’t be given it. Any company admin can approve the install on the consent screen, as for any App.

How a company App differs from an Octogle App

Octogle registers Apps that any company can install, such as Leadey. Your company registers its own. To any other company, your App doesn’t exist. Its admins get the same error on the consent screen as for an unknown client_id (invalid_client), so they can’t install it. If an admin of several companies opens your install link while another company is selected, they get that error too. They can switch to your company in Workchats and open the link again.

Where things are

The examples below use Production. Until company Apps reach Production, use https://app.dev.workchats.com and https://public-api.dev.workchats.com instead.

Register the App

In the admin console, open Apps and choose Register an app. Fill in: You can edit every field later. An edit that changes nothing is not recorded.

Save the secrets

Registering shows three values:
  • Client ID, app_…. Not secret. It’s always shown on the App’s page, and GET /v1/auth/test returns it as app_id.
  • Client secret, wc_cs_…. Your App sends it with the client_id to exchange an install code for a token.
  • Signing secret, whsec_…. Your App uses it to verify callbacks.
The client secret and the signing secret are shown once, in this dialog. Workchats can’t show them again. Store them where your App reads its configuration before you close the dialog. If you lose one, rotate it.

Install it in your company

A company admin installs the App through the consent screen, the same OAuth install as any App. Send the admin to:
URL-encode each value. The admin picks the groups and channels the bot joins and approves. Workchats redirects to redirect_uri with code and state, and your App exchanges the code for a bot token on POST /oauth/token. Each App has one installation in your company, and its bot user. To change the bot’s groups, its push setting, or to uninstall it, a company admin uses Settings → Apps in Workchats, as for any App.

Install without a web server

A script or a scheduled job has no web server to receive the redirect. Use a static page that shows the code instead, then exchange the code yourself with curl. There’s no install button in the admin console.
  1. Host this page at an https:// address your company controls, such as GitHub Pages or a storage bucket behind HTTPS, and add its address to the App’s redirect URIs.
    Keep analytics and other third-party scripts off this page. The code is in its address.
  2. Open the authorize URL above in a browser, signed in as a company admin, with this page as redirect_uri. Approve.
  3. The page shows code and state. Check state is the value you sent.
  4. Within 10 minutes, exchange the code:
    On a shared machine, -u shows the secret to anyone who lists processes while curl runs. Put user = "CLIENT_ID:CLIENT_SECRET" in a file only you can read and pass it with -K <file> instead. REDIRECT_URI is the static page’s address, exactly as registered. The answer carries access_token. Store it where your script reads its configuration. It doesn’t expire.
  5. Check it:
    app_id in the answer is your client_id.
A code is single-use and works only with your client secret, so a code left in the browser history or the page host’s logs is useless to anyone else. Installing again later issues a new token, and the old one stops working.

Rotate a secret

On the App’s page, rotate either secret. The new one is shown once, like at registration. See Callbacks & signature verification for checking two signatures.

Disable, enable and delete

Limits

Your company can have at most 10 Apps. Disabled Apps count. A deleted App doesn’t. The Apps screen shows whether your company can register another App. It reads one of four states, checked in this order: In every state you can still edit, rotate, disable, enable and delete the Apps your company already has. Every registration, edit, rotation, disable, enable and delete is recorded in your company’s audit log, with the admin who did it. No entry contains a secret.