Skip to main content
POST
/
accounts
Create account
curl --request POST \
  --url https://grid.squads.xyz/api/grid/v1/accounts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-grid-environment: <api-key>' \
  --data '{
  "type": "email",
  "email": "user@example.com",
  "memo": "Personal trading account"
}'
{
  "data": {
    "type": "email",
    "email": "user@example.com",
    "status": "pending_verification",
    "otp_sent": true,
    "created_at": "2023-07-15T14:30:00.000Z",
    "expires_at": "2023-07-15T14:40:00.000Z",
    "memo": "Personal trading account"
  },
  "metadata": {
    "request_id": "123e4567-e89b-12d3-a456-426614174002",
    "timestamp": "2023-07-15T14:30:00.000Z"
  }
}
There are two types of accounts that can be created with this endpoint:
  • Email-based accounts
  • Signer-based accounts
Learn more about the different authentication methods in the Authentication Methods guide.
Using the Grid API directly requires advanced configurations. Grid SDK is the recommended way to create accounts. It handles account creation, key management, authentication, automatic failover, and transaction signing. Learn more about the Grid SDK in the Grid SDK guide.

Implementation Guide

Email-based Accounts Creation Flow

1

Initiate account creation

Use this endpoint to create the account specifying the email address of the user.
2

Verify your user's email to complete account creation

Call the Verify Account OTP endpoint to complete the account creation process.
Grid accounts do not have the same address in sandbox and production. DO NOT send funds to the same address in both environments. Create unique accounts for each environment and ensure you use the correct address for your environment.

Signer-based Accounts Creation Flow

1

Create Account

Specify your own ed25519 public keys and the threshold for the account. Signer based accounts are imediately created and return the account address in the response.
{
  "type": "signers",
  "signers": ["publicKey1", "publicKey2", "..."],
  "threshold": 2
}
Grid accounts do not have the same address in sandbox and production. DO NOT send funds to the same address in both environments. Create unique accounts for each environment and ensure you use the correct address for your environment.

Authorizations

Authorization
string
header
required

API key authentication with Bearer token. Include the API key in the Authorization header as 'Bearer YOUR_API_KEY'

x-grid-environment
string
header
required

Environment identifier for the Grid API. Use 'sandbox' for testing on devnet or 'production' for production on mainnet.

Headers

x-idempotency-key
string<uuid>

Unique key to ensure idempotent operations

Body

application/json
type
enum<string>
required

Account creation type:

  • email: Use when you want Grid to automatically generate ed25519 keypairs based on your email address. Perfect for simple integrations where you don't need to manage your own keys.
  • signers: Use when you want to provide your own ed25519 public keys and manage your own signing infrastructure. Ideal for advanced users who need full control over their cryptographic keys.
Available options:
email,
signers
email
string<email>

Email address for the account. Required when type is "email". Grid will generate ed25519 keypairs automatically.

memo
string

Optional memo for the account

Maximum length: 256

Response

Account created successfully

data
object
required

The actual response payload

metadata
object
required
I