# PUT /api/v1/advisory-firms/{firm_id}/slack

> Save firm Slack webhook

- **Tag:** advisory-firms
- **Operation ID:** `save_firm_slack_webhook_api_v1_advisory_firms__firm_id__slack_put`

## Description

Configure a Slack Incoming Webhook URL for the advisory firm.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `firm_id` (path, string, required)

## Request body

Schema: `SlackWebhookSaveRequest`

- `slack_webhook_url` (string) — Slack Incoming Webhook URL, or empty/null to disconnect
- `channel_name` (string) — Optional name for the channel or webhook
- `preferences` (object) — Optional per-category enabled flags for the new webhook. Omitted categories default to enabled.

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_SlackIntegrationStatus_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (SlackIntegrationStatus)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/slack' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "slack_webhook_url": "string",
  "channel_name": "string",
  "preferences": {}
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/slack', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "slack_webhook_url": "string",
  "channel_name": "string",
  "preferences": {}
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "slack_webhook_url": "string",
  "channel_name": "string",
  "preferences": {}
}

response = httpx.put("https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/slack", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/advisory-firms/save-firm-slack-webhook
- OpenAPI slice: https://www.ondayzero.com/docs/reference/advisory-firms/save-firm-slack-webhook/openapi.json
- Other endpoints in **advisory-firms**: https://www.ondayzero.com/docs/reference/advisory-firms
