# Start Slack OAuth (admin)

Begin admin Slack channel connect — returns Slack authorize URL.

Source: https://statusdashboard.com/docs/api/integrations/slack/channels/oauth-start

`POST /app/integrations/slack/channels/oauth/start`

Creates an OAuth intent and returns `{ authorizeUrl }` for browser redirect. After Slack authorization and channel selection, the channel row is created **verified** (admin path).

There is **no** URL POST create for Slack — use this endpoint, then complete the flow in the admin console OAuth callback.

Requires the `admin` or `subscriber` role and the **integrations** feature entitlement.

***

## Request
See [API Basics](/docs/api) for required headers.

### Request body
| Field             | Type    | Required | Description                                                        |
| ----------------- | ------- | -------- | ------------------------------------------------------------------ |
| `dashboardId`     | uuid    | Yes      | Target status dashboard.                                           |
| `managementEmail` | string  | Yes      | Failure alerts and manage links for this channel.                  |
| `componentIds`    | uuid\[] | Yes      | At least one dashboard component UUID to notify.                   |
| `locked`          | boolean | No       | Admin-managed flag. Defaults to `true` for admin-created channels. |

***

## Sample request
```bash
curl -X POST https://api.statusdashboard.com/app/integrations/slack/channels/oauth/start \
  -H "Authorization: Bearer bcf847abf5c6:def456" \
  -H "Content-Type: application/json" \
  -d '{
    "dashboardId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "managementEmail": "ops@acme.com",
    "componentIds": ["b2c3d4e5-f6a7-8901-bcde-f12345678901"],
    "locked": true
  }'
```

## Sample response
**Status: `200 OK`**

```json
{
  "authorizeUrl": "https://slack.com/oauth/v2/authorize?client_id=…&state=…"
}
```

Redirect the user's browser to `authorizeUrl`. After Slack authorization, complete channel selection in the admin console to finish provisioning.

***

## Error responses
| Status | When                                                                                       |
| ------ | ------------------------------------------------------------------------------------------ |
| `400`  | Validation failure — invalid dashboard, email, or component list.                          |
| `403`  | Requires admin or subscriber role, integrations disabled, or unique-channel limit reached. |
| `404`  | Dashboard not found.                                                                       |
