# Propose revoking a key at its vendor

Source: https://immiscible.fly.dev/docs/api/post-api-w-wid-discovery-items-id-revoke

`POST /api/w/:wid/discovery/items/:id/revoke`

Owners. Files a proposal; nothing changes at the vendor until another owner confirms. OpenAI does not let an admin key delete a key owned by a service account, so that is refused with `vendor_cannot_revoke`.

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

## Path parameters

- `wid` (string, required): Workspace id
- `id` (string, required): Object id

## Request

curl:

```bash
curl -X POST "https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/discovery/items/act_7Qm2c1f0/revoke" \
  -H "cookie: __Host-sid=$IMMISCIBLE_SESSION" \
  -H "x-immiscible-csrf: 1" \
  -H "content-type: application/json" \
  -d '{
    "reason": "a personal key billed to the company"
  }'
```

Node:

```ts
const res = await fetch('https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/discovery/items/act_7Qm2c1f0/revoke', {
  method: 'POST',
  headers: {
    cookie: `__Host-sid=${process.env.IMMISCIBLE_SESSION}`,
    'x-immiscible-csrf': '1',
    'content-type': 'application/json',
  },
  body: JSON.stringify({
    reason: 'a personal key billed to the company',
  }),
});
const data = await res.json();
console.log(res.status, data);
```

Python:

```python
import os
import requests

res = requests.post(
    "https://immiscible.fly.dev/api/w/$IMMISCIBLE_WORKSPACE/discovery/items/act_7Qm2c1f0/revoke",
    headers={
        "cookie": f"__Host-sid={os.environ['IMMISCIBLE_SESSION']}",
        "x-immiscible-csrf": "1",
        "content-type": "application/json",
    },
    json={
        "reason": "a personal key billed to the company",
    },
)
print(res.status_code, res.json())
```
