Clusters
  • Introduction
    • Overview
    • Concepts
      • Cluster Name
      • Wallet Name
    • Features
      • Communities
      • Multichain
      • Wallet Bundles
      • Antisquatting
      • Wallet Generation
      • Selective Wallet Sharing
  • Getting started
    • Javascript
      • Authentication
      • Clusters
      • Address → Cluster Name
      • Cluster Name → Address
      • Registration
        • Communities
      • Event Indexing
    • API
      • v1
        • Authentication
        • Clusters
        • Address → Cluster Name
        • Cluster Name → Address
        • Registration
          • Communities
        • Event Indexing
      • v0.1 (Deprecated)
        • Address → Cluster
        • Cluster → Address
        • Cluster → Metadata
        • Registration
        • Managing Wallets
  • Resources
    • Smart Contracts
    • Address Types
    • Using Clusters for ETH->SOL Airdrops
  • Integration Guides
    • Convert hex address to clusters name
    • Registering a name
      • Ethereum Networks
      • Solana
    • Whitelabel Communities Registration Flow
Powered by GitBook
On this page
  • API Endpoint
  • Authentication
  1. Getting started
  2. API

v1

PreviousAPINextAuthentication

Last updated 1 month ago

API Endpoint

https://api.clusters.xyz/v1

API KEY

You can get an API Key by visiting

If you have an API KEY, you can add it to the request headers like so:

fetch(URL, { headers: { "X-API-KEY": "abc123" } }) 

Authentication

Currently, this is only required for . If you do not need to manage wallets via the API, you can ignore this.

  1. Get signing message

  2. Sign the message with an EVM or Solana wallet

  3. Get authentication key with the signature of the signed message

  4. Using authenticate key with endpoints that require wallet authentication


Get Signing Message

GET /v1/auth/message

Get the signing message used for wallet signature authentication

Example

curl -X GET 'https://api.clusters.xyz/v1/auth/message'

Response

The message to sign and the corresponding signing date

{
  "message": "clusters.xyz verification\n\nBefore interacting with certain functionality, we require a wallet signature for verification.\n\n2024-05-14T19:08:27.985Z",
  "signingDate": "2024-05-14T19:08:27.985Z"
}

Get Authentication Key

POST /v1/auth/token

Authenticate the ownership of a specific wallet

Name
Description

signature

Signed message signature

signingDate

Date given by signing message response

type

evm or solana (wallet type used for signing)

wallet

Wallet that signed the message

Example

curl --request POST \
  --url https://api.clusters.xyz/v1/auth/token \
  --header 'Content-Type: application/json' \
  --data '{
  "signature": "abc123",
  "signingDate": "2024-05-14T19:08:27.985Z",
  "type": "evm",
  "wallet": "0x0000000000000000000000000000000000000000"
}'

Response

The auth key used for authenticated responses

{
  "authenticationKey": "eyJzaWduYXR1cmUiOiJhYmMxMjMiLCJzaWduaW5nRGF0ZSI6IjIwMjQtMDUtMTRUMTk6MDg6MjcuOTg1WiIsInR5cGUiOiJldm0iLCJ3YWxsZXQiOiIweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAifQ=="
}

Validate Authentication Key

POST /v1/auth/validate

Authenticate if a authentication key is valid or not

Name
Description

HEADER X-AUTH-KEY

Authentication key

Example

curl --request GET
--url https://api.clusters.xyz/v1/auth/validate
--header 'X-AUTH-KEY: eyJzaWduYXR1cmUiOiJhYmMxMjMiLCJzaWduaW5nRGF0ZSI6IjIwMjQtMDUtMTRUMTk6MDg6MjcuOTg1WiIsInR5cGUiOiJldm0iLCJ3YWxsZXQiOiIweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAifQ=='

Response

The auth key used for authenticated responses

{
  "signature": "abc123",
  "signingDate": "2024-05-14T19:08:27.985Z",
  "type": "evm",
  "wallet": "0x0000000000000000000000000000000000000000",
  "isValid": false
}
https://clusters.xyz/developer
Managing Wallets