Authentication
Every call requires a workspace API key with usage developer_api.
- Open the MANTYX dashboard.
- Go to Settings → API keys.
- Click Create key, scope it to the right workspace and (optionally) restrict the
agentIdsallowlist to the persisted agents you want this key to be able to trigger. An empty allowlist means “any agent in the workspace”. - Copy the key. The dashboard only shows it once.
The SDKs send the key as Authorization: Bearer <key> (you can also use X-API-Key: <key> if you call the HTTP API directly).
Required environment
Section titled “Required environment”The examples in this site assume two environment variables:
export MANTYX_API_KEY=mtx_live_...export MANTYX_WORKSPACE_SLUG=acme-corpThe workspace slug is the URL component you see in the dashboard (e.g. https://app.mantyx.com/acme-corp). The slug in the Authorization header’s tenant must match the slug you pass to the SDK constructor; mismatches return 404 not_found.
Self-hosted MANTYX
Section titled “Self-hosted MANTYX”Override the base URL when constructing the client:
const client = new MantyxClient({ apiKey: process.env.MANTYX_API_KEY!, workspaceSlug: "acme-corp", baseUrl: "https://mantyx.internal.acme.com",});