# Allow or deny a CLI sign-in

Source: https://immiscible.fly.dev/docs/api/post-api-me-device

`POST /api/me/device`

`decision` is `approve` or `deny`. Allowing needs a workspace the person belongs to, and passes the same sign-in rules as the console (address allowlist, allowed sign-in methods, single sign-on, two-factor).

## 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.

## Request

curl:

```bash
curl -X POST "https://immiscible.fly.dev/api/me/device" \
  -H "cookie: __Host-sid=$IMMISCIBLE_SESSION" \
  -H "x-immiscible-csrf: 1" \
  -H "content-type: application/json" \
  -d '{
    "code": "BCDF-GHJK",
    "workspaceId": "ws_7f3a",
    "decision": "approve"
  }'
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/api/me/device', {
  method: 'POST',
  headers: {
    cookie: `__Host-sid=${process.env.IMMISCIBLE_SESSION}`,
    'x-immiscible-csrf': '1',
    'content-type': 'application/json',
  },
  body: JSON.stringify({
    code: 'BCDF-GHJK',
    workspaceId: 'ws_7f3a',
    decision: 'approve',
  }),
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.post(
    "https://immiscible.fly.dev/api/me/device",
    headers={
        "cookie": f"__Host-sid={os.environ['IMMISCIBLE_SESSION']}",
        "x-immiscible-csrf": "1",
        "content-type": "application/json",
    },
    json={
        "code": "BCDF-GHJK",
        "workspaceId": "ws_7f3a",
        "decision": "approve",
    },
)
print(res.status_code, res.json())
```
