Set the Slack webhook
Sets the webhook URL (stored encrypted, never returned) or switches it on or off. Setting a URL or switching it on needs revenue:read too (403 otherwise), since the webhook then receives every sale. Whoever sets the URL is recorded: once that member or API key can no longer read the site's revenue (or is deleted), the webhook gets nothing and its lastError says so until the URL is set again. 400 for a URL that is not the service's incoming webhook URL, or for switching before a URL is set.
Requires site:update on the site (an API key, or a signed-in member's role). Share links: 401.
x-api-key<token>An organization API key (ak_…), with the permissions and the sites it was created with. For servers and scripts: no cookie and no Origin check. Also accepted as Authorization: Bearer ak_… (apiKeyBearer). A request carries one credential: a key sent with a share token or a live session cookie is 400 (details.reason: ambiguous_credentials).
Scope: site:update
siteId*stringapplication/json- body
url?stringA Slack incoming webhook URL (https://hooks.slack.com/services/…); stored encrypted, never returned
length <= 512enabled?booleanOff keeps the webhook but sends nothing (default on with a new URL)
OK
application/json- response
data*curl -X PUT 'https://pilotfox.app/api/v1/sites/string/notifications/slack' \ -H 'Content-Type: application/json' \ -d '{}'{ "data": { "recipients": [ "string" ], "members": [ { "userId": "string", "name": "string", "email": "string" } ], "webhooks": [ { "kind": "slack", "connected": true, "enabled": true, "urlHint": "string", "lastError": "string", "lastSentAt": "string" } ] }}