Getting started

Create a world, point your Slack app at it, and drive it from the UI or the API.

Create a world

Create an API key in Settings, then create a world (or create one on the Worlds page). Each world is separate and keeps its state until you archive it.

curl -X POST https://makeworlds.dev/api/worlds \
  -H "Authorization: Bearer $WORLDS_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "My first world",
    "slack": {
      "team": { "name": "Acme", "domain": "acme" },
      "users": [{ "name": "alice", "real_name": "Alice Tester", "email": "alice@acme.test" }],
      "channels": [{ "name": "general", "members": ["alice"] }],
      "apps": [{
        "manifest": {
          "display_information": { "name": "My app" },
          "oauth_config": { "scopes": { "bot": ["app_mentions:read", "chat:write"] } },
          "settings": {
            "event_subscriptions": {
              "request_url": "https://example.com/slack/events",
              "bot_events": ["app_mention"]
            }
          }
        },
        "install": { "installer": "alice", "channels": ["general"] }
      }]
    }
  }'

A world has the services you give a spec for, and at least one. The slack spec describes everything in the workspace: the team (its name and domain are required), users, channels with their members and messages, and apps defined by standard Slack app manifests. Ids, credentials and tokens you leave out are generated; pin them (a team id, a user token, an app's client secret or a bot token) to match what your app already stores. Nothing else is filled in for you: a world without a slack spec has no Slack, and its Slack URLs are null.

The response has the world's Slack URLs (slack.api_url, slack.oauth_authorize_url, slack.ui_url) and slack.spec: the spec with everything generated filled in, also at GET /api/worlds/:id/spec. A world never changes its spec; to change it, create a new world. Worlds are cheap.

Point your app at a world

Use the world's slack.api_url as your Slack base URL. With @slack/web-api:

const client = new WebClient(token, {
  slackApiUrl: world.slack.api_url,
});

Install your app

Apps with an install (naming the installer) are installed already. Otherwise send users to the world's slack.oauth_authorize_url instead of slack.com. Redirect URIs match the manifest's redirect_urls the way Slack matches them (same scheme, host and port; the path equal or below). Worlds also accepts a * in the host, such as https://*-preview.example.com/oauth/callback, for preview deployments. oauth.v2.access exchanges the code for a bot token as usual.

apps.manifest.export and validate work as on Slack. create, update and delete answer restricted_action: a world's apps come from its spec.

Receive events

The world posts the events your manifest subscribes to (settings.event_subscriptions.bot_events) to its request_url, signed with the app's signing secret, for every app installed in the world. A non-2xx response, a connection failure or no answer within 3 seconds is retried with X-Slack-Retry-Num right away, after 1 minute and after 5 minutes.

Jira

A world with a jira spec has a Jira Cloud site. The spec names the site and describes its users, projects, issues (each with a reporter) and OAuth 2.0 (3LO) apps (name, callback_urls, scopes, optional pinned credentials). Like Atlassian, the site answers on three hosts, returned as jira.auth_url (in place of auth.atlassian.com), jira.api_url (api.atlassian.com) and jira.site_url (your-site.atlassian.net). Point your app's two Atlassian base URLs at the first two; it learns the site URL and cloud id from /oauth/token/accessible-resources, as it would in production.

Supported: /authorize (a consent page where you pick the user), /oauth/token with rotating refresh tokens, and under /ex/jira/{cloudId}/rest/api/3: GET issue, POST issue/{key}/comment, GET user, GET myself and dynamic webhooks (GET/POST/DELETE webhook, PUT webhook/refresh). Webhook JQL supports labels, project, status, issuekey, assignee and reporter with =, !=, in and not in, joined by AND. Deliveries are signed with a JWT (HS256, the app's client secret) and retried up to 5 times, 5 to 15 minutes apart, on 408, 409, 425, 429, 5xx or no answer within 10 seconds.

Worlds API

Create an API key in Settings and send it as Authorization: Bearer <key>.

curl https://makeworlds.dev/api/teams \
  -H "Authorization: Bearer $WORLDS_API_KEY"

Every endpoint is in the API reference, generated from /api/openapi.json.

From TypeScript, the makeworlds package is a typed client for the same API (built on openapi-fetch), with types for every request and response, named as on the Types page (WorldCreate, SlackSpec, SlackState).

npm install makeworlds
import { createClient, type SlackSpec } from "makeworlds";

const worlds = createClient({ apiKey: process.env.WORLDS_API_KEY });

const slack: SlackSpec = {
  team: { name: "Acme", domain: "acme" },
  users: [
    { name: "alice", real_name: "Alice Tester", email: "alice@acme.test" },
    { name: "bob", real_name: "Bob Tester", email: "bob@acme.test" },
  ],
  channels: [{ name: "general", members: ["alice", "bob"] }],
};

const { data: world, error } = await worlds.POST("/api/worlds", {
  body: { name: "My first world", slack },
});

World controls

Routes on a world's own hosts drive it from outside, the way its users would: get a user's Slack token, call Slack methods as a user (an @mention of your app sends the event), share files, and create, change, comment on and delete Jira issues, which sends the webhooks Jira would.

They take your team's API key as Authorization: Bearer <key>, or your makeworlds.dev session. user names who acts, by name or id. Errors have the same shape as the Worlds API. Every route is in the API reference, under Slack world and Jira world, and in the makeworlds types: point a client at the world's host.

if (!world.jira) {
  throw new Error("This world has no Jira.");
}

const jira = createClient({
  apiKey: process.env.WORLDS_API_KEY,
  baseUrl: world.jira.site_url,
});

await jira.POST("/_worlds/jira/issues", {
  body: {
    user: "alice",
    project: "ACME",
    summary: "Checkout fails",
    status: "To Do",
    labels: ["triage"],
  },
});

Archive a world with POST /api/worlds/:id/archive. Archiving takes it offline for good.