레퍼런스HTTP APIAgents

Pin the agent to its Slack app's install in one team

POST
/v1/agents/{id}/identities

Slack events from that app and team then resolve to this agent and no other; events from another app, or after the identity or the install is revoked, are dropped. The install must be verified for the workspace (409 SLACK_NOT_INSTALLED); one already pinned to another agent answers 409 AGENT_IDENTITY_TAKEN, and to this agent 409 ALREADY_EXISTS. credential_ref names the bot token in the secret store, never its value, and is this identity's alone: a name bound to an agent or another identity answers 409 CREDENTIAL_REF_IN_USE, and the name is freed when the identity is revoked. Owners, admins and the agent's admins; API keys are refused. Writes a link_agent_identity 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
provider*"slack_bot"
Value in"slack_bot"
app_id*string
Match^[A-Z0-9]+$
Length1 <= length <= 64
team_id*string
Match^[A-Z0-9]+$
Length1 <= length <= 64
credential_ref*string
Match^[a-z0-9][a-z0-9._:/-]{0,127}$

Response Body

Success

application/json
  1. response
agent_identity*
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 POST 'https://example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/identities' \  -H 'Content-Type: application/json' \  -d '{  "provider": "slack_bot",  "app_id": "string",  "team_id": "string",  "credential_ref": "string"}'
Example Response
{  "agent_identity": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978",    "provider": "slack_bot",    "app_id": "string",    "team_id": "string",    "bot_user_id": "string",    "credential_ref": "string",    "status": "active",    "revision": 0,    "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",    "created_at": "2019-08-24T14:15:22Z",    "revoked_at": "2019-08-24T14:15:22Z"  },  "receipt_id": "64d0a161-468e-472a-b00e-a06ee9ab7de7"}