Skip to Content
Levain LabsLevain Labs
ApiIntegrations

Create Slack Pr Watch

Post a Slack card for each open pull request into a base branch.

Post a Slack card for each open pull request into a base branch.

Each pull request gets one message in the channel, posted when it opens and updated in place on every push, edit and close. Its card shows the title, a link, and the description's "What this deploys" section once the description names the pull request's current head commit.

Requires active GitHub and Slack integrations in the workspace (409 otherwise). Returns 422 when the Levain GitHub App is not installed on the repository, or the Levain app is not in the channel. A repository and base branch can be watched once per workspace; watching it again returns 409.

POST
/api/v1/slack-pr-watches

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Header Parameters

X-API-Key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.levainlabs.com/api/v1/slack-pr-watches" \  -H "Content-Type: application/json" \  -d '{    "repository": "string",    "base_branch": "string",    "slack_channel_id": "string"  }'
{
  "id": "string",
  "repository": "string",
  "base_branch": "string",
  "slack_channel_id": "string",
  "created_at": "string"
}