Skip to main content
This page is a contract reference for the v2 account routes behind the Settings → Messaging apps pane. V3 has no tool for these routes yet. The setup steps for each provider are in Talk to Apostra in Slack, Teams, Discord, or WhatsApp.

Routes

The /api/v2/messaging-apps routes below are the public account REST surface behind the secure setup pane (Settings → Messaging apps, reached from the Listing page’s Distribution tabs for seller accounts). They provision customer-owned apps, install locations, credentials, and identity links. They are separate from the provider-facing webhook endpoints returned during provisioning. Every account endpoint requires a directly authenticated, active administrator from a human WorkOS-backed Apostra session and an account enrolled in the messaging-apps pilot, with one exception: checking shared Slack availability is not pilot-gated. API keys, service tokens, simulated sessions, staff impersonation, and a linked provider identity are not administrator credentials for this surface. Requests are scoped to the administrator’s authenticated account; definitionId and installationId are UUIDs. An account that is not enrolled receives FEATURE_NOT_ENABLED (HTTP 403), which is an availability result rather than an empty app list. Provider and Apostra authentication stay distinct: Provider credentials are supplied only in create or rotation request bodies, encrypted at rest, and never returned. The webhook paths do not accept an Apostra administrator session as a substitute for provider authentication.

Inspect configured apps

GET /api/v2/messaging-apps/discord, GET /api/v2/messaging-apps/teams, and GET /api/v2/messaging-apps/whatsapp each return { definitions: [...] } for one provider. The result is sanitized: it never contains provider credentials, raw provider actor IDs or their digests, message content, or webhook payloads.

Create an app definition

Use POST /api/v2/messaging-apps/discord, POST /api/v2/messaging-apps/teams, or POST /api/v2/messaging-apps/whatsapp. Each response returns definition (the sanitized definition above) and the provider-specific endpoint (interactionEndpoint, messagingEndpoint, or webhookEndpoint). The request body is strict: do not send fields for another provider. Provider secrets are accepted only in the request, encrypted, and never returned by any endpoint. Replacing an app definition does not turn it into a shared app; each definition is the customer’s own provider registration.

Register and manage locations

After configuring the endpoint with the provider, register each permitted location with one of the following strict request bodies. Each successful registration returns { installation }, using the installation fields in the inspection table above. Suspending or uninstalling a location stops new inbound work and revokes saved proactive targets. A Teams removal event also suspends its matching installation automatically; the control does not depend on a provider token continuing to work after removal. PUT /api/v2/messaging-apps/{definitionId}/installations/{installationId}/identity links one provider actor to an active member of the authenticated account. Send the strict body { externalActorId, userId }, where externalActorId is the trimmed provider user ID (1–255 characters) and userId is a positive Apostra member ID. It returns { linked: true, userId }. The secure setup pane lists each linked Apostra person, email, membership state, and link status so an administrator can audit who has access. It deliberately does not display the raw provider user ID: that identifier is not needed for routine access review and must not be exposed through a diagnostic response. Each audited link instead carries an opaque bindingId. To remove that exact mapping, send DELETE /api/v2/messaging-apps/{definitionId}/installations/{installationId}/identity with { bindingId }; the server scopes the handle again to the authenticated account, definition, installation, and provider before revoking it. Clients that do not have the audit response may continue to send { externalActorId } instead. Send exactly one selector. The response is { revoked: boolean }; the next provider interaction fails closed before the agent runs.

Rotate credentials or retire an app

The secure setup pane offers both controls directly on each branded app: Rotate credentials opens the same credential fields used at setup (never prefilled — the pane never displays an existing secret), and Retire app asks for confirmation before it stops the app for good. Both need an account administrator; the REST calls behind them are: PUT /api/v2/messaging-apps/{definitionId}/credentials replaces credentials and returns { definition, rotated: true }. Its strict body declares provider and only that provider’s credential fields: To retire the entire app, send PATCH /api/v2/messaging-apps/{definitionId} with { status: "retired" }. It returns { definition }. Retirement prevents new work for the app; use the location controls when only one provider location should stop.

Pause an active app

The pilot enrollment flag makes the secure setup pane and the account API available; it is not a runtime stop for an app that is already installed. Keep the account enrolled while an administrator applies a lifecycle control.
  • To stop one location, suspend its installation in the secure setup pane, or send PATCH /api/v2/messaging-apps/{definitionId}/installations/{installationId} with { status: "suspended" }. New inbound work stops at that location and its saved proactive targets are revoked.
  • To stop every location for a branded app, select Retire app in the secure setup pane and confirm, or send PATCH /api/v2/messaging-apps/{definitionId} with { status: "retired" }. New work for that definition stops and its credentials are queued for cleanup.
After either action, refresh the provider list and confirm the expected suspended, uninstalled, or retired state. If an account was removed from the pilot before this action, an administrator must have its enrollment restored first so that they can apply the lifecycle control. Do not remove provider credentials as an emergency stop; use the audited lifecycle controls.

Check shared Slack availability

GET /api/v2/messaging-apps/slack returns { available: boolean, installUrl: string | null } for the shared Apostra Slack app described in Open messaging destinations. Unlike every other endpoint on this page, it does not require the account to be enrolled in the messaging-apps pilot: the shared Slack app is not a pilot feature, so any authenticated member of the account can read whether it can be installed right now. available is true, with installUrl set, only once Apostra’s shared Slack app is publicly available; otherwise installUrl is null and the secure setup pane shows Coming soon instead of a working link.