---
title: "Issue an integration grant for a demo account (admins only)."
method: POST
path: "/admin/demo-accounts/{userId}/capture-grants"
tags: ["Admin"]
---

# Issue an integration grant for a demo account (admins only).

`POST /admin/demo-accounts/{userId}/capture-grants`

## Request

- Base URL: `https://docs.sleeperhit.studio/api/v1`
- URL: `https://docs.sleeperhit.studio/api/v1/admin/demo-accounts/{userId}/capture-grants`
- Auth: HTTP bearer

The one credential a recorder needs to provision this allow-listed demo account's capture sessions through the `sleeper.capture/1` API (`/api/capture/v1`) with no human sign-in. The `token` is answered ONCE and only its SHA-256 is kept: write it to a mode-600 file or a secret store and never print it. Lasts `days` (default 90, at most 365) or until revoked. Not idempotent (a replay would hand the token out again), so it takes no Idempotency-Key. 403 `demo_account_not_allowed` unless the account is a usable demo account. Audited. Scope: `account:write`. Free.

## Request body

- CaptureGrantIssueRequest
  - `days` integer: How long the grant lasts. Default 90.
  - `label` string: What to call it in a list ("CI recorder").

## Response `201`

The grant, and its token (a secret, answered once).

- CaptureGrantIssue
  - `grant` CaptureGrant, required
    - `id` string, required
    - `demoUserId` string, required
    - `label` string, nullable, required
    - `createdAt` string, date-time, required
    - `expiresAt` string, date-time, required
    - `revokedAt` string, date-time, nullable, required
  - `token` string, required: The integration grant (`sleeper_capture_grant_…`). A SECRET answered once: never printed or logged.

## Other responses

- `401`: Missing, malformed, revoked, or expired API key.
- `403`: API key is valid but lacks the scope, is blocked by IP allowlist, or the account is disabled.
- `429`: Rate limit for this API key + IP + route family was exceeded.
- `500`: The API failed unexpectedly. Safe to retry with the same Idempotency-Key.

---

[API](https://skmtc.dev/sleeperhit/apis/sleeper-hit-studio-story-api.md) · [All operations](https://skmtc.dev/sleeperhit/apis/sleeper-hit-studio-story-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sleeperhit/apis/sleeper-hit-studio-story-api/revisions/64c1102ccb2f?raw)
