---
search:
  tags:
    - Viewers
    - POST
seo:
  description: >-
    Grants sub-reward credits to a signed-in viewer - the same… Reference for
    the POST /viewers/{user}/credits/grant endpoint in the TipPage Developer
    API.
sidebar:
  label: Grant credits
  badge: POST
title: Grant credits
type: openapi-operation
---
Grants sub-reward credits to a signed-in viewer - the same operation as the dashboard's grant form; the credits appear on the viewer's tip page immediately. Credits can only be granted to viewers who have signed in at least once: an unknown name or id answers `404 viewer_not_signed_in`, and nothing is granted. Requires `viewers:manage`.

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

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

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

Request body example:

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

**Responses**

- `200` — Granted; the fresh balance is returned.
- `400` — \`amount\` isn't an integer from 1 to 100 (\`bad\_request\`).
- `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,
  "granted": 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
  }
}
```
