# Revoke access

`POST https://api.tentary.com/v1/access/revoke`

Source: https://tentary.com/de/help/api/revoke-access/
Area: Kund:innen und Zugänge
MCP tool: `revoke_access`. Changes data at once.

---

Takes away access that was granted: by [`POST /v1/access/grant`](https://tentary.com/de/help/api/grant-access/), an import, Zapier or the Tentary app.

- Access from a purchase stays. To end it, use [`POST /v1/orders/{order_id}/refund`](https://tentary.com/de/help/api/refund-order/), or [`POST /v1/orders/{order_id}/cancel-subscription`](https://tentary.com/de/help/api/cancel-subscription/) with `access` `now`. Both need confirmation.
- The customer and their learning progress stay. A later [`POST /v1/access/grant`](https://tentary.com/de/help/api/grant-access/) gives the access back.

## Authorization

`Authorization: Bearer <API key>`

A personal API key (tnt_...). Create it in the Tentary app on the page AI & API.

## Request body

- `email` (string, required): The customer's e-mail address. Limits: minLength 3, maxLength 255.
- `product_id` (integer, required): The id from list_products. Limits: min 1.
- `variant_id` (integer): Only the grant of this variant. Leave out for all variants of the product. Limits: min 0.

## Response

- `status` (string): The status. Allowed values: `revoked`, `not_found`.
- `message` (string): What happened, in words for the seller.
- `revoked_grants` (integer): Number of grants that were revoked.
- `customer_id` (integer, can be null): The customer ID.

## Example request

```bash
curl -X POST "https://api.tentary.com/v1/access/revoke" \
  -H "Authorization: Bearer $TENTARY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "jonas.wolf@example.com",
  "product_id": 101
}'
```

## Example response

```json
{
  "status": "revoked",
  "message": "Access revoked. Access from purchases stays: use refund_order, or cancel_subscription with access now, for that.",
  "revoked_grants": 1,
  "customer_id": 404
}
```
