Pett.ai WebSocket API 1.1.0

API for interacting with virtual pets via a single WebSocket connection. Authentication is required for the first message, then actions can be performed directly.

Message Flow

  1. Connect to the WebSocket server
  2. Send an AUTH message with credentials (Telegram or Privy)
  3. Receive an auth_result message with pet information
  4. Send action messages (RUB, SHOWER, etc.) as needed
  5. Receive pet_update messages after actions affect the pet's state

Message Format Examples

Authentication Message Examples:

Telegram Authentication:

{
    "type": "AUTH",
    "data": {
        "params": {
            "authHash": {
                "id": 123456789,
                "first_name": "name",
                "username": "username",
                "auth_date": 123456789,
                "hash": "hash"
            },
            "authType": "telegram"
        }
    }
}

Privy Authentication:

{
    "type": "AUTH",
    "data": {
        "params": {
            "authHash": {
                "hash": "privy_auth_token"
            },
            "authType": "privy"
        }
    }
}

Registration Message Examples:

Privy Registration:

{
    "type": "REGISTER",
    "data": {
        "params": {
            "registerHash": {
                "name": "Pet Name",
                "hash": "privy_auth_token"
            },
            "authType": "privy"
        }
    }
}

Simple Action (no parameters):

{
    "type": "RUB",
    "data": {}
}

Action with Parameters:

{
    "type": "ACCESSORY_USE",
    "data": {
        "params": {
            "accessoryId": "CROWN"
        }
    }
}
  • #pett-api

Servers

  • ws://petbot-monorepo-websocket-333713154917.europe-west1.run.appwsdevelopment

    Development server

Operations

  • SUB clientToServer

    Channel for client messages to server

    Send a message to the server (authentication or action)

    Operation IDsendClientMessage

    Available only on servers:

    Accepts the following message:

    clientMessage

    Client message

    Message IDclientMessage

    Message from client to server (auth or action)

    object

    Type of message to send to the server, can be an action or an authentication/registration message

    Examples

  • PUB serverToClient

    Channel for server messages to client

    Publish various server-to-client messages (auth results, updates, errors, data)

    Operation IDreceiveServerMessages

    Available only on servers:

    Accepts one of the following messages:

    • #0authResultMessage

      Authentication result

      Message IDauthResultMessage

      Response to authentication request

      object

      Examples

    • #1petUpdateMessage

      Pet update

      Message IDpetUpdateMessage

      Pet state update

      object

      Examples

    • #2errorMessage

      Error message

      Message IDerrorMessage

      Error notification

      object

      Examples

    • #3dataMessage

      Data message

      Message IDdataMessage

      General data response

      object

      Examples

Messages

  • #1clientMessage

    Client message

    Message IDclientMessage

    Message from client to server (auth or action)

    object

    Type of message to send to the server, can be an action or an authentication/registration message

  • #2authResultMessage

    Authentication result

    Message IDauthResultMessage

    Response to authentication request

    object
  • #3petUpdateMessage

    Pet update

    Message IDpetUpdateMessage

    Pet state update

    object
  • #4errorMessage

    Error message

    Message IDerrorMessage

    Error notification

    object
  • #5dataMessage

    Data message

    Message IDdataMessage

    General data response

    object

Schemas

  • object

    Type of message to send to the server, can be an action or an authentication/registration message

  • ConsumableID
    string

    Identifier for each consumable item

      Allowed values:
    • "BURGER"
    • "SALAD"
    • "STEAK"
    • "COOKIE"
    • "PIZZA"
    • "SUSHI"
    • "ENERGIZER"
    • "POTION"
    • "XP_POTION"
    • "SUPER_XP_POTION"
    • "SMALL_POTION"
    • "LARGE_POTION"
    • "REVIVE_POTION"
    • "POISONOUS_ARROW"
    • "REINFORCED_SHIELD"
    • "BATTLE_SWORD"
    • "ACCOUNTANT"
  • AccessoryBlueprintID
    string

    Identifier for accessory blueprints

      Allowed values:
    • "CROWN"
    • "HALO"
    • "DEVIL_HORNS"
    • "UNICORN_HORN"
    • "PARTY_HAT"
    • "MUSHROOMS"
    • "STEM"
    • "BEANIE_BEIJE"
    • "CAP_GREEN"
    • "SAMURAI_HELMET"
    • "BALLOON_ETH"
    • "BALLOON_BASE"
    • "BALLOON_BTC"
    • "KITE_BLUE"
    • "RACKET_PADEL"
    • "BALLOON_RED"
    • "WINGS_ANGEL"
    • "WINGS_DEVIL"
    • "WINGS_FAIRY"
    • "WINGS_BAT"
    • "TOY_BULL"
    • "TOY_BEAR"
    • "TOY_FROG"
    • "TOY_CRAB"
    • "WORLD_ID"
    • "CAP_DS"
    • "HALLOWEEN"
    • "IVAN_ON_TECH"
    • "BEANIE_MOCHI"
    • "CAP_PAAL"
    • "BEANIE_DIAMOND"
    • "HAT_AFRICA"
    • "BEANIE_NEIRO"
    • "HAT_CHINA"
    • "GOGGLES_MILITARY"
    • "HAT_ELF"
    • "HAT_SANTA"
    • "HAT_THANKSGIVING"
    • "PARTY_HAT_NEW_YEARS"
    • "VEST_PATAGONIA"
    • "ROBE_SECRET"
  • AchievementBlueprintID
    string

    Identifier for each achievement blueprint

      Allowed values:
    • "LEVEL_5"
    • "LEVEL_10"
    • "LEVEL_25"
    • "LEVEL_50"
    • "LEVEL_75"
    • "LEVEL_100"
    • "SPEND_25K"
    • "SPEND_75K"
    • "SPEND_250K"
    • "SPEND_750K"
    • "SPEND_2_5M"
    • "SPEND_10M"
    • "HOTEL_1"
    • "HOTEL_5"
    • "HOTEL_15"
    • "HOTEL_25"
    • "HOTEL_50"
    • "HOTEL_100"
    • "WIN_1K"
    • "WIN_10K"
    • "WIN_50K"
    • "WIN_250K"
    • "WIN_1M"
    • "WIN_2_5M"
    • "WORDLE_1"
    • "WORDLE_10"
    • "WORDLE_25"
    • "WORDLE_75"
    • "WORDLE_150"
    • "WORDLE_365"
    • "SCORE_100"
    • "SCORE_500"
    • "SCORE_2500"
    • "SCORE_10K"
    • "SCORE_25K"
    • "SCORE_50K"
    • "HEALTHY_7"
    • "HEALTHY_14"
    • "HEALTHY_30"
    • "HEALTHY_90"
    • "HEALTHY_180"
    • "HEALTHY_365"
    • "MALL_1"
    • "MALL_5"
    • "MALL_10"
    • "MALL_15"
    • "MALL_20"
    • "MALL_ALL"
    • "REFER_10"
    • "REFER_50"
    • "REFER_500"
    • "REFER_2500"
    • "REFER_10K"
    • "REFER_25K"
    • "USE_250"
    • "USE_750"
    • "USE_2500"
    • "USE_10K"
    • "USE_25K"
    • "USE_100K"
    • "ARTLEADERBOARD_5"
    • "ARTLEADERBOARD_10"
    • "ARTLEADERBOARD_15"
  • ChatType
    string

    Type of chat for AI search

      Allowed values:
    • "paal"
    • "crypto"
    • "web"
    • "gecko"
  • HotelTier
    integer

    Tier levels in the hotel (0 = none, 1–3 available)

      Allowed values:
    • 0
    • 1
    • 2
    • 3
  • DurationPurchaseTier
    string

    Duration option for hotel purchase

      Allowed values:
    • "1d"
    • "7d"
    • "30d"
  • TokenType
    string

    Type of token for deposit/withdrawal

      Allowed values:
    • "TOKEN"
    • "ETH"
    • "SOLANA"
  • StakingID
    string

    Identifier for each staking option

      Allowed values:
    • "STAKING_7D"
    • "STAKING_30D"
    • "STAKING_90D"
  • GuildJoinRequestStatus
    string

    Status of a guild join request

      Allowed values:
    • "PENDING"
    • "APPROVED"
    • "REJECTED"
  • GuildAccessType
    string

    Access type for a guild

      Allowed values:
    • "PUBLIC"
    • "PRIVATE"
  • GuildMemberRole
    string

    Role of a member in a guild

      Allowed values:
    • "LEADER"
    • "CO_LEADER"
    • "MODERATOR"
    • "MEMBER"
  • GuildUpgradeType
    string

    Type of upgrade available for a guild.

    Note: Currently, "defense" and "attack" upgrades are not functional and have no effect.

      Allowed values:
    • "maxMembers"
    • "defense"
    • "attack"
  • LoginType
    string

    Type of login method

      Allowed values:
    • "telegram"
    • "privy"
  • object
  • object
  • oneOf
  • object
  • object
  • object
  • object

    Information about a user with their pets

  • object

    Information about a pet

  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • object
  • allOf
  • object