# Execute an earn action (stake or unstake)

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/earn/actions/{action}:
    post:
      summary: Execute an earn action (stake or unstake)
      deprecated: false
      description: ''
      operationId: executeAction
      tags:
        - REST API/Endpoints/Earn
        - Earn
      parameters:
        - name: action
          in: path
          description: ''
          required: true
          example: ''
          schema:
            type: string
            enum:
              - STAKE
              - UNSTAKE
      requestBody:
        content:
          application/json:
            schema:
              properties:
                configId:
                  type: string
                  format: uuid
                walletId:
                  type: string
                  format: uuid
                assetAmount:
                  type: number
              required:
                - assetAmount
                - configId
              x-apidog-orders:
                - configId
                - walletId
                - assetAmount
              type: object
      responses:
        '200':
          description: Earn action initiated successfully
          content:
            '*/*':
              schema:
                properties:
                  data:
                    properties:
                      status:
                        type: string
                    x-apidog-orders:
                      - status
                    type: object
                x-apidog-orders:
                  - data
                type: object
          headers: {}
          x-apidog-name: OK
        '400':
          description: Invalid input
          content:
            '*/*':
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                    x-apidog-orders:
                      - code
                x-apidog-orders:
                  - error
          headers: {}
          x-apidog-name: Bad Request
        '404':
          description: Asset config not found
          content:
            '*/*':
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                    x-apidog-orders:
                      - code
                x-apidog-orders:
                  - error
          headers: {}
          x-apidog-name: Record Not Found
        '500':
          description: Internal server error
          content:
            '*/*':
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                    x-apidog-orders:
                      - code
                x-apidog-orders:
                  - error
          headers: {}
          x-apidog-name: ''
      security:
        - x-api-key: []
          x-apidog:
            schemeGroups:
              - id: EI_Aj0LUz2CVzpxAnyxj5
                schemeIds:
                  - x-api-key
            required: true
            use:
              id: EI_Aj0LUz2CVzpxAnyxj5
            scopes:
              EI_Aj0LUz2CVzpxAnyxj5:
                x-api-key: []
      x-apidog-folder: REST API/Endpoints/Earn
      x-apidog-status: released
      x-run-in-apidog: https://app.eu.apidog.com/web/project/365298/apis/api-4375765-run
components:
  schemas: {}
  securitySchemes:
    x-api-key:
      type: apikey
      name: x-api-key
      in: header
servers:
  - url: https://api.public.bitpanda.com
    description: Production
security: []

```