JustaName
API ReferenceSDK Reference
API Reference
API Reference
  • Overview
  • API reference
    • Siwe
      • Request challenge
      • Verify message
      • Mapp
        • Add permission
        • Append field
        • Revoke permission
    • Subname
      • Accept
      • Reserve
      • Add
      • Update
      • Revoke
      • Reject
      • Subname
      • Ens
      • Address
      • Records
      • Available
      • Search
      • Ens list
    • Primary name
      • Address
      • Set primary name
  • Specification
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. API reference
  2. Subname

Update

PreviousAddNextRevoke

Was this helpful?

Update Subname

post

Update the specified subname's data

Header parameters
x-signaturestringRequired

The signature.

x-messagestringRequired

The Message.

x-addressstringRequired

The Address.

Body
usernamestringRequired

The username

Example: dev
ensDomainstringRequired

The second-level domain

Example: jan.eth
chainIdnumberRequired

Chain id, we only support Ethereum Mainnet and Sepolia Testnet (1 for mainnet, 11155111 for sepolia)

Example: 11155111
contentHashstringOptional

The new contentHash of the subdomain

Example: ipfs://QmRAQB6YaCyidP37UdDnjFY5vQuiBrcqdyoW1CuDgwxkD4
Responses
default
The Subname was updated successfully.
application/json
post
POST /ens/v1/subname/update HTTP/1.1
Host: api.justaname.id
x-signature: text
x-message: text
x-address: text
Content-Type: application/json
Accept: */*
Content-Length: 372

{
  "username": "dev",
  "ensDomain": "jan.eth",
  "chainId": 11155111,
  "addresses": [
    {
      "address": "0xb965a5f3a0fC18D84E68883ccAd508445a7917A8",
      "coinType": 60
    },
    {
      "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
      "coinType": 0
    }
  ],
  "text": [
    {
      "key": "twitter.com",
      "value": "justaname_id"
    },
    {
      "key": "youtube.com",
      "value": "justaname"
    }
  ],
  "contentHash": "ipfs://QmRAQB6YaCyidP37UdDnjFY5vQuiBrcqdyoW1CuDgwxkD4"
}
default

The Subname was updated successfully.

{
  "statusCode": 200,
  "result": {
    "data": {
      "ens": "user.justan.id",
      "isClaimed": true,
      "claimedAt": "2024-05-22T11:55:29.000Z",
      "isJAN": true,
      "records": {
        "resolverAddress": "0x48De002d3c64e4cFD130A87A35ECD960c01954bc",
        "texts": [
          {
            "key": "com.twitter",
            "value": "justaname_id"
          }
        ],
        "coins": [
          {
            "id": 60,
            "name": "eth",
            "value": "0x1FA89227d0F42960eb5f5693fAFCF58e255A4dfa"
          }
        ],
        "contentHash": {
          "protocolType": "ipfs",
          "decoded": "bafybeiafwq5iqeyk73or3dmzyjyqaauyzdwi3xtync7h6kp64umwvsiumi"
        }
      }
    },
    "error": "text"
  }
}