Skip to main content
POST
/
accounts
cURL
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: <x-grid-environment>' \
  --data '{
  "email": "<string>",
  "memo": "<string>",
  "type": "email"
}'
{
  "data": {
    "created_at": "2023-11-07T05:31:56Z",
    "email": "<string>",
    "expires_at": "2023-11-07T05:31:56Z",
    "memo": "<string>",
    "otp_sent": true,
    "status": "<string>",
    "type": "<string>"
  },
  "metadata": {
    "request_id": "<string>",
    "timestamp": "2023-11-07T05:31:56Z"
  }
}
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

Your Grid API key from the Grid Dashboard

Headers

x-grid-environment
string
required

Solana network environment (sandbox, devnet, mainnet)

x-idempotency-key
string | null

Idempotency key to prevent duplicate account creation

Body

application/json
  • Option 1
  • Option 2
email
string
required
type
enum<string>
required
Available options:
email
memo
string | null

Response

Account created successfully

data
object
required
  • Option 1
  • Option 2
metadata
object
required