# Revoke a pending invitation.

> `id` is Clerk's invitation id (`inv_...`).
> https://koi.dog/docs/api/invitations/revoke-invite/

`POST /api/v1/invites/{id}/revoke` · Scope: `approve`

The sign-up link stops working. Clerk refuses an invitation that was accepted or already revoked, and that refusal is passed on as `502 clerk_error` with Clerk's reason. Records `invite.revoked` with who revoked it. When an API key calls it, the timeline records who did what and the outcome. No query parameters, and no body.

## Path parameters.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | yes | The Clerk invitation's id. |

## Headers.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | `string` | no | Makes a retry safe: the same key with the same request returns the first answer and does nothing else. |

## Response.

200 OK: a JSON object. The example has placeholder values.

## Request.

```sh
curl -X POST "https://app.koi.dog/api/v1/invites/$ID/revoke" \
    -H "Authorization: Bearer $KOIDOG_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)"
```

```js
const res = await fetch(`https://app.koi.dog/api/v1/invites/${process.env.ID}/revoke`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KOIDOG_API_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
  },
});
console.log(await res.json());
```

```python
import os
import uuid

import requests

r = requests.post(
    f"https://app.koi.dog/api/v1/invites/{os.environ['ID']}/revoke",
    headers={
        "Authorization": f"Bearer {os.environ['KOIDOG_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
r.raise_for_status()
print(r.json())
```

## Response example.

```json
{
  "invite": {
    "email": "string",
    "state": "requested",
    "requestedAt": "string",
    "requestState": "string",
    "invitation": { … }
  },
  "marked": false,
  "markError": "string"
}
```
