リファレンスHTTP APIAgents

Set how the agent answers in one Slack channel or its DMs

PUT
/v1/agents/{id}/slack-bindings

Replaces the binding of channel_id in the agent's Slack app install, or the install's one DM binding when channel_id is null, creating it the first time. The channel's kind is what Slack's conversations.info answers with the bot token; channel_kind, when sent, only has to agree on whether this is the DM row (400 when Slack names a DM or does not know the channel, 503 when Slack cannot be read). mode is off (the channel takes nothing; a mention there is refused) or on (in use; the agent's mention_only setting says whether it also answers a top-level message without a mention).home: true makes this channel the agent's home and clears the previous one; a DM is never home. A missing ceiling is the default: every Slack action, shown in full. The agent needs a live Slack app identity (409 SLACK_NOT_INSTALLED); a concurrent change to the same channel or home answers 409 REVISION_CONFLICT. The bot does not join the channel here. A binding that is left stays left when saved for its private channel (its mode and ceiling are edited, home: true answers 400); saved for a channel Slack now calls public, it is ready again. Owners, admins and the agent's admins; API keys are refused. Writes a set_surface_binding receipt.

Auth: cookie session only; no scope. Idempotency-Key: ignored.

Authorization

cookieSession
cookie__Host-werft_session<token>

For the web console: the browser session cookie set by POST /v1/auth/login. It holds the scopes of the user's workspace role (owner: all; admin and member: all but sessions:recover). Requests other than GET must also send X-Requested-With: werft-web.

Path Parameters

id*string

The agent's id.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Header Parameters

X-Requested-With?"werft-web"

Required with a cookie session: the literal werft-web.

Value in"werft-web"

Request Body

application/json
  1. body
channel_id*|null
channel_kind?string
Value in"public_channel""private_channel""dm"
mode*string
Value in"off""on"
home?boolean
Defaultfalse
ceiling?

Response Body

Success

application/json
  1. response
slack_binding*
receipt_id*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
Example Request
curl -X PUT 'https://example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/slack-bindings' \  -H 'Content-Type: application/json' \  -d '{  "channel_id": "string",  "mode": "off"}'
Example Response
{  "slack_binding": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",    "owner_id": "string",    "surface": "web",    "installation_id": "91166175-c6a9-4caf-88e9-3147ffc9c934",    "external_surface_id": "string",    "surface_kind": "public_channel",    "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",    "mode": "off",    "ceiling": {      "actions": [        "session.read"      ],      "disclosure": "full"    },    "home": true,    "memory_write_policy": "deny",    "status": "ready",    "approved_at": "2019-08-24T14:15:22Z",    "membership": {      "state": "joined",      "error": "string"    },    "muted": true,    "revision": 0,    "created_at": "2019-08-24T14:15:22Z",    "revoked_at": "2019-08-24T14:15:22Z"  },  "receipt_id": "64d0a161-468e-472a-b00e-a06ee9ab7de7"}