1. Settings Management
Adventists - API Doc
  • Overall
  • v2.5 Updates
  • Quick Start
  • TCP - Chat With Voice
    • Emoji Mode Integration Guide
    • Connect with TCP
    • Connect with VAD
    • Connect with MCP
    • Get Token
      POST
  • Settings Management
    • Args Description
    • Hippo - Character Memory Management Microservice
    • Device / Character Block Management
    • Template
      • Query Public Template List
      • Query Current Org Template (including private and public template)
      • Create Template
      • Query Template By ID
      • Modify Template
      • Delete Template
      • Send Memories To Template
    • NPC
      • Create Npc With Template
      • Create Npc Without Template
      • Query Npc By Id
      • Modify Npc
      • Delete Npc
      • Send Memories To Npc
      • Query Memories From Npc
    • Skills Book
      • Query Skills Book List
      • Start Create Skills Book Task
      • Upload Skills Book Content
      • Finish Create Skills Book Task
      • Query Progress Of Create Skills Book Task
    • Voice Texture
      • Upload Voice Texture
        • Upload Voice
        • Query Status Of Uploading Voice
      • Query Voice List
    • Hippo - API
      • Get the Personal Knowledge Graph (PKG) of the specified character
      • Retrieve relationship data for the specified character.
      • Retrieve diary data for the specified character.
      • Update the character's PKG.
      • Trigger Dream
      • Dialogue Memory API
      • Read Conversation Memory
    • Device / Character Block- API
      • Device/Character Ban
      • Device/Character Unban
      • Query Ban List
      • Query Single Ban Status
  • Other Chat Functions
    • Upload Pictures
      POST
  1. Settings Management

Device / Character Block Management

The Device/Character Block feature allows partners to manage block statuses for their devices and characters via API. Blocked devices or characters will be rejected when calling init_npc.
Base URL:
Route Prefix: /api
Data Format: JSON
Encoding: UTF-8

Authentication#

All management APIs authenticate via HTTP Headers:
HeaderTypeRequiredDescription
api_keystringYes32-character API key
org_idstringYes6-character Organization ID
Failed authentication returns 401:
{
  "message": "Invalid API KEY or ORG ID"
}

API Summary#

MethodPathDescription
POST/api/device/blockBlock a device or character
POST/api/device/unblockUnblock a device or character
GET/api/device/blocklistQuery block list
GET/api/device/block/checkCheck individual block status

Block Device / Character#

Add a block record. Blocked devices or characters will be rejected during init_npc.
POST /api/device/block

Request Body#

{
  "type": "device",
  "identifier": "ABC123",
  "reason": "Policy violation"
}
ParameterTypeRequiredDescription
typestringYes"device" or "npc"
identifierstringYesDevice ID or character ID (npcid)
reasonstringNoBlock reason
When type is "npc", the identifier must belong to the current organization (i.e., the first 6 characters of identifier must match org_id), otherwise 403 is returned.

Success Response (200)#

{
  "ok": true,
  "block_key": "device:ABC123"
}

Error Responses#

400 - Invalid Parameters
{
  "ok": false,
  "error": "Missing required field: type"
}
403 - Forbidden
{
  "ok": false,
  "error": "Cannot block NPC belonging to another org"
}

cURL Example#


Unblock Device / Character#

Remove a block record. Only unblocks records created by the current organization.
POST /api/device/unblock

Request Body#

{
  "type": "device",
  "identifier": "ABC123"
}
ParameterTypeRequiredDescription
typestringYes"device" or "npc"
identifierstringYesDevice ID or character ID

Success Response (200)#

{
  "ok": true
}

Error Responses#

404 - Record Not Found
{
  "ok": false,
  "error": "Block record not found"
}
403 - Forbidden
{
  "ok": false,
  "error": "Cannot unblock record owned by another org"
}

cURL Example#


Query Block List#

Query all block records for the current organization, with optional type filtering.
GET /api/device/blocklist

Query Parameters#

ParameterTypeRequiredDescription
typestringNoFilter by type: "device" or "npc". If omitted, returns all records

Success Response (200)#

{
  "ok": true,
  "items": [
    {
      "block_key": "device:ABC123",
      "type": "device",
      "identifier": "ABC123",
      "created_at": "2026-04-10T15:30:00Z",
      "created_by": "WOQSOC",
      "reason": "Policy violation"
    },
    {
      "block_key": "npc:WOQSOC7a8b9c1d2e3f4a5b6c7d8e9f0a1b2c3d",
      "type": "npc",
      "identifier": "WOQSOC7a8b9c1d2e3f4a5b6c7d8e9f0a1b2c3d",
      "created_at": "2026-04-10T16:00:00Z",
      "created_by": "WOQSOC",
      "reason": "Character deactivated"
    }
  ]
}

cURL Examples#


Check Individual Block Status#

Check whether a specified device or character is blocked.
GET /api/device/block/check

Query Parameters#

ParameterTypeRequiredDescription
typestringYes"device" or "npc"
identifierstringYesDevice ID or character ID

Blocked Response (200)#

{
  "ok": true,
  "blocked": true,
  "detail": {
    "reason": "Policy violation",
    "created_at": "2026-04-10T15:30:00Z",
    "created_by": "WOQSOC"
  }
}

Not Blocked Response (200)#

{
  "ok": true,
  "blocked": false
}

cURL Example#


init_npc Behavior Changes#

The init_npc API has a new optional parameter device_id and now performs a block check before initialization.

New Request Parameters#

ParameterTypeRequiredDescription
npcidstringYesCharacter ID
langstringNoLanguage setting
device_idstringNoDevice ID (newly added; when omitted, device-level block check is skipped)

Block Check Order#

1.
If device_id is provided, check whether the device is blocked
2.
Check whether npcid is blocked
3.
Proceed with original initialization logic only if both checks pass

Blocked Response#

When a device or character is blocked, init_npc returns (HTTP 200):
{
  "status": "blocked",
  "reason": "Device has been blocked"
}
The TCP side determines connection rejection by checking if the status field value is "blocked".
Normal initialization response remains unchanged:
{
  "message": "NPC xxx initialized successfully",
  "status": "success",
  "code": 200
}

Error Codes Summary#

HTTP Status CodeDescription
200Request successful
400Invalid parameters (missing type or identifier, invalid type value)
401Invalid api_key or org_id
403Forbidden (attempting to operate on NPC of another organization)
404Not found (block record does not exist during unblock)
500Server error
修改于 2026-04-23 03:51:15
上一页
Hippo - Character Memory Management Microservice
下一页
Query Public Template List
Built with