# Install the Slack app

Source: https://immiscible.fly.dev/docs/api/get-slack-install

`GET /slack/install`

Starts Slack's OAuth v2 install for a workspace (`?workspace=<id>`). The link is bound to the person who started it, works once and lasts ten minutes. See [set up Slack](https://immiscible.fly.dev/docs/guides/slack.md).

## Authentication

Session cookie. A signed-in person: the console's session cookie. Every state-changing request also carries the header `x-immiscible-csrf: 1`, and the member's role decides what it may do. Bearer tokens are ignored on these routes, so no machine credential can reach them. A browser redirect for an owner or admin, signed in.

## Request

curl:

```bash
curl "https://immiscible.fly.dev/slack/install" \
  -H "cookie: __Host-sid=$IMMISCIBLE_SESSION"
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/slack/install', {
  headers: {
    cookie: `__Host-sid=${process.env.IMMISCIBLE_SESSION}`,
  },
});
console.log(res.status, await res.text());
```

Python:

```python
import os
import requests

res = requests.get(
    "https://immiscible.fly.dev/slack/install",
    headers={
        "cookie": f"__Host-sid={os.environ['IMMISCIBLE_SESSION']}",
    },
)
print(res.status_code, res.text)
```
