> ## Documentation Index
> Fetch the complete documentation index at: https://developers.squads.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Account

> Create a new Grid account using either email authentication or signer-based policies

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](/grid/v1/accounts/authentication-methods) guide.

<Warning>
  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](/grid/v1/sdk-reference) guide.
</Warning>

## Implementation Guide

### Email-based Accounts Creation Flow

<Steps>
  <Step title="Initiate account creation">
    Use this endpoint to create the account specifying the email address of the
    user.
  </Step>

  <Step title="Verify your user's email to complete account creation">
    Call the [Verify Account
    OTP](/grid/v1/api-reference/endpoint/account-management/verify) endpoint to
    complete the account creation process.

    <Danger>
      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.
    </Danger>
  </Step>
</Steps>

### Signer-based Accounts Creation Flow

<Steps>
  <Step title="Create Account">
    Specify your own ed25519 public keys and the threshold for the account. Signer based accounts are immediately created and return the account address in the response.

    ```json theme={null}
    {
      "type": "signers",
      "signers": ["publicKey1", "publicKey2", "..."],
      "threshold": 2
    }
    ```

    <Danger>
      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.
    </Danger>
  </Step>
</Steps>


## OpenAPI

````yaml POST /api/grid/v1/accounts
openapi: 3.1.0
info:
  title: Grid v1 API
  description: Grid v1 REST API for Solana-based smart account system
  contact:
    name: Grid API Support
    url: https://squads.so
    email: support@squads.so
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://grid.squads.xyz
    description: Production server
security:
  - bearer_auth: []
tags:
  - name: accounts
    description: Smart account management operations
  - name: spending-limits
    description: Spending limit management
  - name: standing-orders
    description: Standing order operations
  - name: transactions
    description: Transaction management
  - name: trade
    description: Trade operations and management
  - name: payments
    description: Payment intent operations
  - name: passkeys
    description: Passkey management
  - name: kyc
    description: Know Your Customer operations
  - name: external-accounts
    description: External bank account management
  - name: virtual-accounts
    description: Virtual account management
  - name: auth
    description: Authentication operations
  - name: proposals
    description: Proposal management for multi-sig operations
  - name: compliance
    description: Compliance entity management and KYB/KYC operations
paths:
  /api/grid/v1/accounts:
    post:
      tags:
        - accounts
      operationId: handler
      parameters:
        - name: x-grid-environment
          in: header
          description: Solana network environment (sandbox, devnet, mainnet)
          required: true
          schema:
            type: string
          example: sandbox
        - name: x-idempotency-key
          in: header
          description: Idempotency key to prevent duplicate account creation
          required: false
          schema:
            type:
              - string
              - 'null'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAccountRequestPayload'
        required: true
      responses:
        '201':
          description: Account created successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GridApiResponse_CreateAccountResponsePayload
        '202':
          description: Account creation initiated, waiting for OTP verification
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GridApiResponse_CreateAccountResponsePayload
        '400':
          description: Invalid request parameters
        '500':
          description: Internal server error
      security:
        - bearer_auth: []
components:
  schemas:
    CreateAccountRequestPayload:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/EmailPayload'
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - email
        - allOf:
            - $ref: '#/components/schemas/SignersPayload'
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - signers
    GridApiResponse_CreateAccountResponsePayload:
      type: object
      required:
        - data
        - metadata
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/EmailResponse'
            - $ref: '#/components/schemas/SignersResponse'
        metadata:
          $ref: '#/components/schemas/Metadata'
    EmailPayload:
      type: object
      required:
        - email
      properties:
        email:
          type: string
        memo:
          type:
            - string
            - 'null'
    SignersPayload:
      type: object
      required:
        - policies
      properties:
        memo:
          type:
            - string
            - 'null'
        policies:
          $ref: '#/components/schemas/AccountPolicies'
    EmailResponse:
      type: object
      required:
        - type
        - email
        - status
        - otp_sent
        - created_at
        - expires_at
      properties:
        created_at:
          type: string
          format: date-time
        email:
          type: string
        expires_at:
          type: string
          format: date-time
        memo:
          type:
            - string
            - 'null'
        otp_sent:
          type: boolean
        status:
          type: string
        type:
          type: string
    SignersResponse:
      type: object
      required:
        - type
        - address
        - policies
        - grid_user_id
      properties:
        address:
          type: string
        grid_user_id:
          type: string
          format: uuid
        memo:
          type:
            - string
            - 'null'
        policies:
          $ref: '#/components/schemas/AccountPolicies'
        type:
          type: string
    Metadata:
      type: object
      required:
        - request_id
        - timestamp
      properties:
        request_id:
          type: string
        timestamp:
          type: string
          format: date-time
    AccountPolicies:
      type: object
      required:
        - signers
        - threshold
      properties:
        admin_address:
          type:
            - string
            - 'null'
        signers:
          type: array
          items:
            $ref: '#/components/schemas/AccountSigner'
        threshold:
          type: integer
          format: int32
          minimum: 0
        time_lock:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
    AccountSigner:
      type: object
      required:
        - address
        - role
        - permissions
      properties:
        address:
          type: string
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
        provider:
          $ref: '#/components/schemas/GridMPCProvider'
        role:
          $ref: '#/components/schemas/GridSignerRole'
    Permission:
      type: string
      enum:
        - CAN_INITIATE
        - CAN_VOTE
        - CAN_EXECUTE
    GridMPCProvider:
      type: string
      enum:
        - privy
        - dynamic
        - passkey
        - turnkey
        - external
    GridSignerRole:
      type: string
      enum:
        - primary
        - backup
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: Your Grid API key from the Grid Dashboard

````