---
search:
  tags:
    - Viewers
    - POST
seo:
  description: >-
    Takes unused sub-reward credits away from a viewer. Only unused… Reference
    for the POST /viewers/{user}/credits/revoke endpoint in the TipPage
    Developer API.
sidebar:
  label: Revoke credits
  badge: POST
title: Revoke credits
type: openapi-operation
---
Takes unused sub-reward credits away from a viewer. Only unused credits are revocable - credits already spent on a message are gone. Asking for more than the viewer has available revokes nothing and answers `400 insufficient_credits` with the actual available count. Requires `viewers:manage`.

`POST /viewers/{user}/credits/revoke`

**Request body** (`application/json`, required)

- `amount` (integer, required) — Credits to revoke.

Request body example:

```json
{
  "amount": 1
}
```

**Responses**

- `200` — Revoked; the fresh balance is returned.
- `400` — Bad \`amount\` (\`bad\_request\`), or more than the viewer's unused balance (\`insufficient\_credits\` - the response includes \`available\`).
- `401` — Missing or invalid credential (\`missing\_api\_key\` / \`invalid\_api\_key\`, or \`invalid\_token\` for an expired/revoked OAuth access token).
- `403` — The key lacks the required scope (\`missing\_scope\`).
- `404` — No viewer with that name or id has ever signed in to this tip page (\`viewer\_not\_signed\_in\`). Signing in on the tip page (Twitch or Kick) is what creates a viewer - until then they can't be looked up or granted credits.
- `409` — More than one signed-in viewer matches (\`ambiguous\_viewer\`) - two people share that name, or a bare id exists on both platforms. Retry with \`\<platform\>:\<id\>\`.
- `429` — Rate limit exceeded - check the \`RateLimit-\*\` headers.

Response example, 200:

```json
{
  "success": true,
  "revoked": 0,
  "viewer": {
    "platform": "twitch",
    "platform_user_id": "123456789",
    "login": "gigachad42",
    "display_name": "GigaChad42",
    "profile_image_url": "http://example.com",
    "subscriber_tier": 0,
    "first_signed_in_at": "2019-08-24T14:15:22Z",
    "last_active_at": "2019-08-24T14:15:22Z",
    "linked_accounts": [
      {
        "platform": "twitch",
        "platform_user_id": "string",
        "login": "string",
        "display_name": "string"
      }
    ]
  },
  "credits": {
    "available": 0,
    "total": 0,
    "used": 0
  }
}
```
