REST API

Content

Generate, list, retrieve, rename, and delete game content from your servers. Each endpoint has an interactive console below — paste your API key and try it.

The content endpoints are the server-side equivalent of Hub → Content. Use them to back automation: generating puzzles from your CMS, archiving completed campaigns, syncing publication state with your warehouse.

List content

Page through your workspace's content. Filter by status, game, or language.

GET/api/v2/contentscope · content:read
Parameters
limit query
Max results (1–100)
status query
Filter by status
game_type query
Game id, e.g. trivia
language query
Language code
curl -X GET 'https://hub.playgent.com/api/v2/content'
Response
Send the request to see the response. Your key is stored in this browser only.

The response shape:

json
{
  "object": "list",
  "data": [
    {
      "id": "65f…",
      "content": "pub_history_42",
      "game_type": "trivia",
      "language": "en",
      "title": "Curious Minds",
      "status": "published",
      "source_input_type": "topic",
      "source_input": "History of Science",
      "preview_url": "https://static.playgent.com/play/v2/?game=trivia&mode=pinned&content=pub_history_42",
      "created_at": "2026-05-06T10:30:00.000Z",
      "updated_at": "2026-05-06T10:35:00.000Z",
      "published_at": "2026-05-06T10:35:00.000Z"
    }
  ]
}

Create content

Generate a new puzzle from a topic, URL, or pasted text. The result is published to the CDN automatically — the returned preview_url is ready to embed.

POST/api/v2/contentscope · content:write
Parameters
input_type body·req
input body·req
game_type body·req
language body
title body
curl -X POST 'https://hub.playgent.com/api/v2/content' \
  -H 'Content-Type: application/json' \
  --data '{"input_type":"topic","input":"History of Science","game_type":"trivia"}'
Response
Send the request to see the response. Your key is stored in this browser only.

input_type decides how input is interpreted:

  • topic — a short subject ("History of Science"). The generator picks the angle.
  • url — a public URL. The generator fetches and reads the page.
  • text — pasted text. Useful when the source isn't on the public web (intranet, paywalled, etc.).

Retrieve

http
GET /api/v2/content/{content}
GET/api/v2/content/{content}scope · content:read
Parameters
content path·req
curl -X GET 'https://hub.playgent.com/api/v2/content/pub_abc123'
Response
Send the request to see the response. Your key is stored in this browser only.

Returns the same metadata shape as list. The underlying game payload is internal and isn't exposed through the API.

Rename

Update the displayed title. title is the only editable field.

PATCH/api/v2/content/{content}scope · content:write
Parameters
content path·req
title body·req
curl -X PATCH 'https://hub.playgent.com/api/v2/content/pub_abc123' \
  -H 'Content-Type: application/json' \
  --data '{"title":"New title"}'
Response
Send the request to see the response. Your key is stored in this browser only.
json
{ "title": "New title" }

Delete

http
DELETE /api/v2/content/{content}
DELETE/api/v2/content/{content}scope · content:delete
Parameters
content path·req
curl -X DELETE 'https://hub.playgent.com/api/v2/content/pub_abc123'
Response
Send the request to see the response. Your key is stored in this browser only.

Permanently removes the content and revokes the CDN copy.

json
{ "deleted": true, "content": "pub_history_42" }

Leaderboard

Read the top scores submitted by players for a piece of content. Use this to surface a custom leaderboard inside your own dashboard or pipe scores into a downstream system.

GET/api/v2/content/{content}/leaderboardscope · content:read
Parameters
content path·req
difficulty query
Difficulty bucket to read (default: 'default').
curl -X GET 'https://hub.playgent.com/api/v2/content/pub_abc123/leaderboard'
Response
Send the request to see the response. Your key is stored in this browser only.
json
{
  "object": "list",
  "content": "pub_history_42",
  "game_type": "trivia",
  "difficulty": "default",
  "entries": [
    {
      "rank": 1,
      "player_id": "p_8mY2…",
      "username": "alex",
      "time_ms": 41200,
      "hints_used": 0,
      "score": 940,
      "moves": null,
      "updated_at": 1746628800
    }
  ]
}

How the bucket is selected:

  • Pinned content (created via POST /api/v2/content): one cumulative leaderboard per (content, difficulty).
  • Daily content (scheduled into a channel by date): one leaderboard per (content, date, difficulty). The endpoint resolves the date from the publication automatically — you don't pass it.

difficulty defaults to default. For games with multiple difficulties (e.g. wordsearch's mini / easy), pass the bucket you want with ?difficulty=mini.

player_id here is the leaderboard player identifier (a stable per-browser id) — it is not the Player embed configuration.