> ## 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 Smart Account



## OpenAPI

````yaml POST /smart-accounts
openapi: 3.1.0
info:
  title: Grid API
  description: Grid API Documentation
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://grid.squads.xyz/api/v0/grid
    description: Production Server
security:
  - bearerAuth: []
tags:
  - name: smart-accounts
    description: Smart Accounts
paths:
  /smart-accounts:
    post:
      tags:
        - Smart Accounts
      operationId: handler
      parameters:
        - name: X-Grid-Environment
          in: header
          description: The environment you’re using. Can be `sandbox` or `production`.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSmartAccountRequestPayload'
        required: true
      responses:
        '200':
          description: Smart account created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSmartAccountResponsePayload'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GridError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GridError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GridError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GridError'
components:
  schemas:
    CreateSmartAccountRequestPayload:
      type: object
      required:
        - policies
      properties:
        grid_user_id:
          type:
            - string
            - 'null'
          format: uuid
          description: Optional Grid user ID. If not provided, a new user will be created
        memo:
          type:
            - string
            - 'null'
          description: Optional memo for the smart account
        mpc_provider_info:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/MpcProviderInfo'
              description: Optional MPC provider information for key management
        policies:
          $ref: '#/components/schemas/SmartAccountPolicies'
          description: Smart account policies including authorities and threshold
    CreateSmartAccountResponsePayload:
      type: object
      required:
        - smart_account_address
        - grid_user_id
        - policies
        - created_at
      properties:
        created_at:
          type: string
          format: date-time
          description: UTC timestamp when the smart account was created
          example: '2021-01-01T00:00:00Z'
        grid_user_id:
          type: string
          format: uuid
          description: The Grid user ID associated with the smart account
        policies:
          $ref: '#/components/schemas/SmartAccountPolicies'
          description: The policies configured for the smart account
        smart_account_address:
          type: string
          description: The blockchain address of the created smart account
    GridError:
      type: object
      required:
        - message
        - details
        - timestamp
      properties:
        details:
          type: array
          items:
            $ref: '#/components/schemas/Detail'
        message:
          type: string
        timestamp:
          type: string
    MpcProviderInfo:
      oneOf:
        - type: object
          required:
            - Turnkey
          properties:
            Turnkey:
              type: object
              required:
                - primary_id
                - wallet_id
                - wallet_address
              properties:
                primary_id:
                  type: string
                  description: The primary ID for the MPC provider
                wallet_address:
                  type: string
                  description: The wallet address for the MPC provider
                wallet_id:
                  type: string
                  description: The wallet ID for the MPC provider
    SmartAccountPolicies:
      type: object
      required:
        - authorities
        - threshold
      properties:
        admin_address:
          type:
            - string
            - 'null'
          format: pubkey
          description: Optional admin address that can modify the smart account settings
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        authorities:
          type: array
          items:
            $ref: '#/components/schemas/Signer'
          description: List of authorities that can authorize transactions
        threshold:
          type: integer
          format: int32
          description: Number of required signatures for transactions
          maximum: 10
          minimum: 1
        time_lock:
          type:
            - integer
            - 'null'
          format: int32
          description: Optional time lock in seconds for transactions
          minimum: 0
    Detail:
      type: object
      required:
        - field
        - code
        - message
      properties:
        code:
          type: string
        field:
          type: string
        message:
          type: string
    Signer:
      type: object
      required:
        - address
        - permissions
      properties:
        address:
          type: string
          format: pubkey
          description: The public key of the authority
          example: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
        permissions:
          type: array
          items:
            $ref: '#/components/schemas/Permission'
          description: List of permissions granted to this authority
    Permission:
      type: string
      enum:
        - CAN_INITIATE
        - CAN_VOTE
        - CAN_EXECUTE
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API Key for authentication

````