Can I start builds directly from Slack using slash commands?

Last updated: July 23, 2026

Context

You may want to trigger Codemagic builds directly from Slack using slash commands, similar to how other tools like Linear allow you to create items with commands like "/linear create". This would eliminate the need to navigate to the Codemagic website to start builds manually.

Answer

Codemagic does not provide a built-in Slack slash command integration. However, you can build your own using the Codemagic REST API. The setup has three parts: a Slack app, a small server to receive the command, and a call to the Codemagic API.

1. Get your Codemagic credentials

  • API token: Account settings → API token → Show

  • App ID: open your app in Codemagic and copy the ID from the URL (`https://codemagic.io/app/<appId>`)

  • Workflow ID: the workflow name in codemagic.yaml, or the workflow ID shown in the UI

2. Create the Slack app

  • Go to https://api.slack.com/apps and click Create New App → From scratch

  • Name it (e.g. "Codemagic") and pick your workspace

  • In the sidebar, open Slash Commands → Create New Command

    • Command: /codemagic

    • Request URL: the public URL of the endpoint you'll create in step 3

    • Short description: "Trigger a Codemagic build"

    • Usage hint: [workflow] [branch]

  • Under OAuth & Permissions, add the commands and chat:write bot token scopes

  • Click Install to Workspace and authorise

  • Copy the Signing Secret from Basic Information, you'll use it to verify that incoming requests really come from Slack

3. Create the endpoint that handles the command

Slack sends a POST request to your Request URL each time someone runs the command. Your endpoint needs to:

  • Verify the request signature using the signing secret

  • Respond to Slack within 3 seconds (otherwise Slack shows a timeout error) — reply immediately with an acknowledgement, then do the Codemagic call

  • Call the Codemagic API to start the build

    The Codemagic call itself:

    curl -X POST https://api.codemagic.io/builds \
      -H "Content-Type: application/json" \
      -H "x-auth-token: <your-api-token>" \
      -d '{
        "appId": "<your-app-id>",
        "workflowId": "<your-workflow-id>",
        "branch": "main"
      }'

The response contains a buildId, which you can post back into the Slack channel as a link to the build:

https://codemagic.io/app/<appId>/build/<buildId>

You can host this endpoint anywhere that accepts HTTP requests — a small Node or Python service, a serverless function (AWS Lambda, Cloud Functions, Vercel), or a workflow tool like Zapier or n8n if you'd rather not write code.

Related documentation