---
title: "Revoke Referral Grant"
method: POST
path: "/api/v1/admin/referrals/{grant_id}/revoke"
tags: ["admin-referrals"]
---

# Revoke Referral Grant

`POST /api/v1/admin/referrals/{grant_id}/revoke`

## Request

- Base URL: `https://memory.kagura-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://memory.kagura-ai.com/api/v1/admin/referrals/{grant_id}/revoke`
- Auth: none declared

Revoke a grant and recompute both sides' referral bonuses.

Idempotent: revoking an already-revoked grant is a no-op that still returns
the row, so an admin retry (or a double-click) is harmless.

Args:
    grant_id: The ledger row to revoke.
    payload: Revocation reason.
    user: Authenticated system admin.
    db: Database session.

Returns:
    The revoked grant.

Raises:
    HTTPException: 404 if no such grant exists.

## Path parameters

- `grant_id` string, uuid, required

## Request body

- RevokeRequest: Revocation payload. ``reason`` is required — not optional-with-a-default. Revoking shrinks a live quota, so there is no non-destructive case in which an empty reason would be acceptable (contrast ``admin.py``'s conditional-reason rule for ``workspace_slot_bonus``, where a non-negative delta is harmless).
  - `reason` string, required

## Response `200`

Successful Response

- AdminReferralGrantResponse: A ledger row with both sides visible.
  - `id` unknown, required
  - `referrer_user_id` unknown, required
  - `referrer_workspace_id` unknown, required
  - `referred_user_id` unknown, required
  - `referred_workspace_id` unknown, required
  - `referrer_bonus_memories` unknown, required
  - `referred_bonus_memories` unknown, required
  - `granted_at` unknown, required
  - `revoked_at` unknown, required
  - `revoked_reason` unknown, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud.md) · [All operations](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/kagura-ai/apis/kagura-memory-cloud/revisions/09f17f5ada29?raw)
