---
title: "PlaySocket Puzzle & Brain Games API"
slug: playsocket-game-engine
url: https://apyhub.com/gyanesh5009/service/playsocket-game-engine
provider: gyanesh kumar
categories: [Smart Generation]
tags: [games, graphql, sudoku, brain-training, education, developer-tools, java, spring-boot]
auth: api_key
version: v1
service_type: sync
endpoints: 1
atoms: 3
mcp: true
---

# PlaySocket Puzzle & Brain Games API

Generate Sudoku puzzles and Schulte tables via GraphQL. Returns puzzle grids, solutions, difficulty levels, and randomized board layouts.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games` | What it does Executes a GraphQL query against the PlaySocket GraphQL Gateway and returns the corres… | 3 |

## Endpoint reference

### Generate Sudoku & Schulte Board

`POST https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games` · 3 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `query` | body | string | yes | The GraphQL query document to execute. Example: `query { newSudokuBoard(limit: 1, difficulty: "HARD", size: 9) { grids { value s…`. |
| `variables` | body | object | no | Optional map of GraphQL variables referenced in the query. Example: `{"size":5}`. |
| `operationName` | body | string | no | Optional name of the operation to execute if the query contains multiple named operations. Example: `NewSchulteTable`. |

#### Quickstart

Run a GraphQL query to generate a **Sudoku board**, **Schulte Table**, or **Stroop Test table**.

##### Generate a Sudoku Board

```bash
curl -X POST "https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { newSudokuBoard(limit: 1, difficulty: \"HARD\", size: 9) { grids { value solution difficulty } results message } }"
  }'
```

##### Generate a Schulte Table

```bash
curl -X POST "https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { newSchulteTable(size: 5) { schulteBoard message } }"
  }'
```

##### Generate a Stroop Test

```bash
curl -X POST "https://api.eu.apyhub.com/gyanesh5009/playsocket-game-engine/api/games" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { newStroopTable(size: 5, difficulty: \"HARD\") { stroopBoard { colorName actualColor } difficulty message } }"
  }'
```

#### What you'll get back

The API returns a JSON object with optional `data` and `errors` fields. On success, `data` contains the result of the selected GraphQL query.

##### Sudoku Response

The `newSudokuBoard` field contains `grids`, an array of generated puzzle objects, `results`, the number of grids returned, and `message`, a status string.

```json
{
  "data": {
    "newSudokuBoard": {
      "grids": [
        {
          "value": [["1", " ", "3"]],
          "solution": [["1", "2", "3"]],
          "difficulty": "HARD"
        }
      ],
      "results": 1,
      "message": "Data fetched successfully."
    }
  }
}
```

##### Schulte Table Response

The `newSchulteTable` field contains `schulteBoard`, a two-dimensional array of integers, and `message`.

```json
{
  "data": {
    "newSchulteTable": {
      "schulteBoard": [
        [1, 8, 15, 22, 9],
        [19, 4, 12, 25, 2],
        [7, 21, 14, 5, 18],
        [23, 10, 3, 16, 24],
        [11, 6, 20, 13, 17]
      ],
      "message": "Data fetched successfully."
    }
  }
}
```

##### Stroop Test Response

The `newStroopTable` field contains `stroopBoard`, a two-dimensional array of `Color` objects. Each color object contains `colorName` and `actualColor`, along with the selected `difficulty` and a status `message`.

```json
{
  "data": {
    "newStroopTable": {
      "stroopBoard": [
        [
          {
            "colorName": "RED",
            "actualColor": "BLUE"
          },
          {
            "colorName": "GREEN",
            "actualColor": "GREEN"
          }
        ],
        [
          {
            "colorName": "BLUE",
            "actualColor": "RED"
          },
          {
            "colorName": "YELLOW",
            "actualColor": "GREEN"
          }
        ]
      ],
      "difficulty": "HARD",
      "message": "Data fetched successfully."
    }
  }
}
```

#### Available GraphQL Queries

| Query             | Parameters                    | Returns             |
| ----------------- | ----------------------------- | ------------------- |
| `newSudokuBoard`  | `limit`, `difficulty`, `size` | Sudoku puzzle grids |
| `newSchulteTable` | `size`                        | Schulte Table       |
| `newStroopTable`  | `size`, `difficulty`          | Stroop Test table   |

All three games can be requested through the same **PlaySocket GraphQL Gateway** by selecting the appropriate query and fields.

## About

## What it does

PlaySocket Game Generator gives you a **GraphQL endpoint** that creates puzzle and brain-game boards for **Sudoku, Schulte Table, and Stroop Table** use cases. Send a query in `body.query`, and optionally pass `body.variables` and `body.operationName` when your GraphQL document uses variables or multiple named operations.

For **Sudoku**, `newSudokuBoard` returns a wrapper with `results`, `message`, and `grids`. Each grid includes a `value` 2D array for the puzzle, a `solution` 2D array for the solved board, and a `difficulty` value of `EASY`, `MEDIUM`, or `HARD`. This makes it useful when you need generated puzzle content for games, training exercises, or quiz-style experiences.

For **Schulte Tables**, `newSchulteTable` returns a `message` and a randomized `schulteBoard` 2D integer grid sized according to the request. You can use it anywhere you need a generated layout for attention, timing, visual search, or brain-training gameplay.

For the **Stroop Test**, `newStroopTable` generates a randomized Stroop Table board based on the requested `size` and `difficulty`. It returns a `stroopBoard` containing color entries, where each entry provides a `colorName` and its `actualColor`. This allows you to create cognitive-training gameplay that tests attention, response inhibition, and cognitive flexibility.

The response is **GraphQL-shaped**: successful payloads come back under `data`, while validation or execution issues appear in `errors` with optional `path` and `locations`.

Use PlaySocket Game Generator when your application needs dynamically generated **puzzle, attention, and brain-training game content** without having to build the underlying generation logic yourself.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/gyanesh5009/service/playsocket-game-engine
