> ## 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.

# Vote and Execute

> Vote to approve and immediately execute a proposal in one operation

Combines voting and execution into a single operation. More efficient than separate vote and execute calls when you want to finalize a proposal immediately.

<Warning>
  At least one signer must have `CAN_EXECUTE` permission (mask includes value 4). Unlike the vote endpoint, this is required.
</Warning>

## How It Works

1. Validates proposal is `Active` or `Approved`
2. Filters signers who already approved
3. Selects minimum signers needed to reach threshold
4. First signer with `CAN_EXECUTE` becomes the executor
5. Returns transaction(s) for signing

## When Threshold Is Already Met

<Note>
  If the proposal already has enough approvals, the voting step becomes a no-op—only execution occurs.
</Note>

```typescript theme={null}
// Proposal has 2/2 approvals (Approved status)
const response = await grid.voteAndExecute(accountAddress, proposalAddress, {
  signers: [executorKey]  // Only needs CAN_EXECUTE
});
// Returns execute transaction only
```

## Permission Requirements

* All signers need `CAN_VOTE` (2)
* At least one signer needs `CAN_EXECUTE` (4)

## Transaction Output

Returns 1-2 transactions depending on size:

* **Single transaction**: Vote + execute fit within 1232 bytes
* **Two transactions**: Submit vote first, then execute

```typescript theme={null}
const response = await grid.voteAndExecute(accountAddress, proposalAddress, {
  signers: [signerWithExecute],
  fee_config: { currency: "SOL", payer_address: payerKey }
});

// Sign and submit in order
for (const tx of response.transactions) {
  await signAndSubmit(tx);
}
```

## When to Use Vote vs Vote-and-Execute

| Use Case                         | Endpoint         |
| -------------------------------- | ---------------- |
| Approve and execute immediately  | Vote-and-Execute |
| Approve without executing        | Vote             |
| Reject or cancel                 | Vote             |
| No CAN\_EXECUTE signer available | Vote             |

## Related Endpoints

* [Vote on Proposal](/grid/v1/api-reference/endpoint/proposals/vote) — Vote without executing
* [Get Proposal](/grid/v1/api-reference/endpoint/proposals/get) — Check current state


## OpenAPI

````yaml POST /api/grid/v1/accounts/{address}/proposals/{proposal_address}/vote-and-execute
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/{address}/proposals/{proposal_address}/vote-and-execute:
    post:
      tags:
        - proposals
      operationId: handler
      parameters:
        - name: address
          in: path
          description: Smart account address (Solana public key)
          required: true
          schema:
            type: string
        - name: proposal_address
          in: path
          description: Proposal address (Solana public key)
          required: true
          schema:
            type: string
        - name: x-grid-environment
          in: header
          description: Target Solana environment
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoteAndExecuteRequest'
        required: true
      responses:
        '200':
          description: Vote and execute transaction(s) created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GridApiResponse_VoteAndExecuteResponse'
        '400':
          description: Invalid request parameters
        '404':
          description: Smart account or proposal not found
      security:
        - bearer_auth: []
components:
  schemas:
    VoteAndExecuteRequest:
      type: object
      required:
        - signers
      properties:
        feeConfig:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/FeeConfigV2'
        signers:
          type: array
          items:
            type: string
    GridApiResponse_VoteAndExecuteResponse:
      type: object
      required:
        - data
        - metadata
      properties:
        data:
          type: object
          required:
            - transactions
            - signers
          properties:
            signers:
              type: array
              items:
                type: string
            transactions:
              type: array
              items:
                type: string
        metadata:
          $ref: '#/components/schemas/Metadata'
    FeeConfigV2:
      type: object
      required:
        - currency
        - payer_address
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        payer_address:
          type: string
        self_managed_fees:
          type:
            - boolean
            - 'null'
    Metadata:
      type: object
      required:
        - request_id
        - timestamp
      properties:
        request_id:
          type: string
        timestamp:
          type: string
          format: date-time
    Currency:
      oneOf:
        - $ref: '#/components/schemas/StandardCurrency'
        - $ref: '#/components/schemas/CustomCurrency'
    StandardCurrency:
      type: string
      enum:
        - sol
        - usdc
        - usdt
        - pyusd
        - eurc
    CustomCurrency:
      type: object
      required:
        - mint
        - decimals
      properties:
        decimals:
          type: integer
          format: int32
          minimum: 0
        mint:
          type: string
        symbol:
          type:
            - string
            - 'null'
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: Your Grid API key from the Grid Dashboard

````