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

# Create Stake Action

> Create a new action for an existing stake.



## OpenAPI

````yaml /openapi.yaml post /staking/stakes/{stakeId}/actions
openapi: 3.1.0
info:
  version: 1.807.0
  title: Dfns
servers:
  - url: https://api.dfns.io
    description: Default - Europe
  - url: https://api.uae.dfns.io
    description: UAE
  - url: https://api.dfns.ninja
    description: <Deprecated> Staging
security: []
paths:
  /staking/stakes/{stakeId}/actions:
    post:
      tags:
        - Staking
      summary: Create Stake Action
      description: Create a new action for an existing stake.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
            pattern: ^stk-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          required: true
          name: stakeId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - anyOf:
                    - oneOf:
                        - type: object
                          properties:
                            protocol:
                              type: string
                              enum:
                                - Iota
                            kind:
                              type: string
                              enum:
                                - Withdraw
                            amount:
                              type: string
                              pattern: ^\d+$
                          required:
                            - protocol
                            - kind
                            - amount
                          title: IOTA Withdrawal
                        - type: object
                          properties:
                            protocol:
                              type: string
                              enum:
                                - Iota
                            kind:
                              type: string
                              enum:
                                - Deposit
                            amount:
                              type: string
                              pattern: ^\d+$
                            lockedIotas:
                              type: array
                              items:
                                type: string
                                pattern: ^0x[0-9a-fA-F]{64}$
                          required:
                            - protocol
                            - kind
                            - amount
                          title: IOTA Deposit
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Ethereum
                        kind:
                          type: string
                          enum:
                            - Withdraw
                      required:
                        - protocol
                        - kind
                      title: Ethereum Withdrawal
                - type: object
                  properties:
                    externalId:
                      type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Stake'
                  - type: object
                    properties:
                      actions:
                        type: array
                        items:
                          $ref: '#/components/schemas/StakeAction'
                    required:
                      - actions
      security:
        - authenticationToken: []
          userActionSignature: []
components:
  schemas:
    Stake:
      oneOf:
        - type: object
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^stk-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
              example: stk-0pmu3-tog2k-fdtn0teii2i4r13f
            provider:
              type: string
              enum:
                - Figment
              description: The staking infrastructure provider used to manage the stake.
            walletId:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
              description: Wallet id.
              example: wa-5pfuu-9euek-h0odgb6snva8ph3k
            status:
              type: string
              enum:
                - Active
                - Failed
                - Staking
                - Unbonding
                - Unbond
                - Withdrawing
                - Withdrawn
              description: >-
                Status of the stake position.


                | Status | Definition |

                | --- | --- |

                | `Staking` | The stake is being created and funds are being
                delegated to the validator. |

                | `Active` | The stake is active and earning rewards. |

                | `Unbonding` | The stake is in the process of being unbonded
                (cooldown period). |

                | `Unbond` | The stake has been unbonded and is ready for
                withdrawal. |

                | `Withdrawing` | The staked funds are in the process of being
                withdrawn. |

                | `Withdrawn` | The staked funds have been fully withdrawn. |

                | `Failed` | The staking operation failed. |
            requester:
              $ref: '#/components/schemas/Requester'
            requestBody:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Babylon
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        duration:
                          type: number
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                        - duration
                      title: Babylon
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Ethereum
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                      title: Ethereum
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Iota
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        validator:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{64}$
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        lockedIotas:
                          type: array
                          items:
                            type: string
                            pattern: ^0x[0-9a-fA-F]{64}$
                          minItems: 1
                      required:
                        - protocol
                        - walletId
                        - validator
                        - amount
                      title: Iota
                - type: object
                  properties:
                    externalId:
                      type: string
            dateCreated:
              type: string
              format: date-time
              description: >-
                [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date (must be
                UTC). When the stake was created.
              example: '2023-04-14T20:41:28.715Z'
            protocol:
              type: string
              enum:
                - Babylon
            data:
              type: object
              properties:
                finalityProviders:
                  type: array
                  items:
                    type: string
                covenantPubkeys:
                  type: array
                  items:
                    type: string
                magicBytes:
                  type: string
                covenantThreshold:
                  type: number
                minUnbondingTime:
                  type: number
                lockHeight:
                  type: number
              required:
                - finalityProviders
                - covenantPubkeys
                - magicBytes
                - covenantThreshold
                - minUnbondingTime
                - lockHeight
          required:
            - id
            - walletId
            - status
            - requester
            - requestBody
            - dateCreated
            - protocol
            - data
          title: Babylon
        - type: object
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^stk-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
              example: stk-0pmu3-tog2k-fdtn0teii2i4r13f
            provider:
              type: string
              enum:
                - Figment
              description: The staking infrastructure provider used to manage the stake.
            walletId:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
              description: Wallet id.
              example: wa-5pfuu-9euek-h0odgb6snva8ph3k
            status:
              type: string
              enum:
                - Active
                - Failed
                - Staking
                - Unbonding
                - Unbond
                - Withdrawing
                - Withdrawn
              description: >-
                Status of the stake position.


                | Status | Definition |

                | --- | --- |

                | `Staking` | The stake is being created and funds are being
                delegated to the validator. |

                | `Active` | The stake is active and earning rewards. |

                | `Unbonding` | The stake is in the process of being unbonded
                (cooldown period). |

                | `Unbond` | The stake has been unbonded and is ready for
                withdrawal. |

                | `Withdrawing` | The staked funds are in the process of being
                withdrawn. |

                | `Withdrawn` | The staked funds have been fully withdrawn. |

                | `Failed` | The staking operation failed. |
            requester:
              $ref: '#/components/schemas/Requester'
            requestBody:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Babylon
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        duration:
                          type: number
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                        - duration
                      title: Babylon
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Ethereum
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                      title: Ethereum
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Iota
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        validator:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{64}$
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        lockedIotas:
                          type: array
                          items:
                            type: string
                            pattern: ^0x[0-9a-fA-F]{64}$
                          minItems: 1
                      required:
                        - protocol
                        - walletId
                        - validator
                        - amount
                      title: Iota
                - type: object
                  properties:
                    externalId:
                      type: string
            dateCreated:
              type: string
              format: date-time
              description: >-
                [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date (must be
                UTC). When the stake was created.
              example: '2023-04-14T20:41:28.715Z'
            protocol:
              type: string
              enum:
                - Iota
            data:
              type: object
              properties:
                kind:
                  type: string
                  enum:
                    - Iota
                    - LockedIota
                stakedObjects:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                      amount:
                        type: string
                      expirationDate:
                        type: string
                    required:
                      - id
                      - amount
                amount:
                  type: string
                validator:
                  type: string
              required:
                - kind
                - amount
                - validator
          required:
            - id
            - walletId
            - status
            - requester
            - requestBody
            - dateCreated
            - protocol
            - data
          title: Iota
        - type: object
          properties:
            id:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^stk-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
              example: stk-0pmu3-tog2k-fdtn0teii2i4r13f
            provider:
              type: string
              enum:
                - Figment
              description: The staking infrastructure provider used to manage the stake.
            walletId:
              type: string
              minLength: 1
              maxLength: 64
              pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
              description: Wallet id.
              example: wa-5pfuu-9euek-h0odgb6snva8ph3k
            status:
              type: string
              enum:
                - Active
                - Failed
                - Staking
                - Unbonding
                - Unbond
                - Withdrawing
                - Withdrawn
              description: >-
                Status of the stake position.


                | Status | Definition |

                | --- | --- |

                | `Staking` | The stake is being created and funds are being
                delegated to the validator. |

                | `Active` | The stake is active and earning rewards. |

                | `Unbonding` | The stake is in the process of being unbonded
                (cooldown period). |

                | `Unbond` | The stake has been unbonded and is ready for
                withdrawal. |

                | `Withdrawing` | The staked funds are in the process of being
                withdrawn. |

                | `Withdrawn` | The staked funds have been fully withdrawn. |

                | `Failed` | The staking operation failed. |
            requester:
              $ref: '#/components/schemas/Requester'
            requestBody:
              allOf:
                - oneOf:
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Babylon
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        duration:
                          type: number
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                        - duration
                      title: Babylon
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Ethereum
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                      title: Ethereum
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Iota
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        validator:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{64}$
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        lockedIotas:
                          type: array
                          items:
                            type: string
                            pattern: ^0x[0-9a-fA-F]{64}$
                          minItems: 1
                      required:
                        - protocol
                        - walletId
                        - validator
                        - amount
                      title: Iota
                - type: object
                  properties:
                    externalId:
                      type: string
            dateCreated:
              type: string
              format: date-time
              description: >-
                [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date (must be
                UTC). When the stake was created.
              example: '2023-04-14T20:41:28.715Z'
            protocol:
              type: string
              enum:
                - Ethereum
            data:
              type:
                - object
                - 'null'
              properties:
                validator:
                  type: object
                  properties:
                    pubkey:
                      type: string
                    withdrawalAddress:
                      type: string
                  required:
                    - pubkey
                    - withdrawalAddress
              required:
                - validator
          required:
            - id
            - walletId
            - status
            - requester
            - requestBody
            - dateCreated
            - protocol
            - data
          title: Ethereum
    StakeAction:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^stka-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          example: stka-567ui-9g9b7-ftgvpstk8qfa71b4
        stakeId:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^stk-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          example: stk-0pmu3-tog2k-fdtn0teii2i4r13f
        status:
          type: string
          enum:
            - PendingPolicyApproval
            - InProgress
            - Completed
            - Failed
            - Rejected
          description: >-
            Status of the stake action.


            | Status | Definition |

            | --- | --- |

            | `PendingPolicyApproval` | The action is pending approval due to a
            policy applied to the wallet. |

            | `InProgress` | The action has been initiated and is being
            processed. |

            | `Completed` | The action has been successfully completed. |

            | `Failed` | The action has failed. Check failureReason for details.
            |

            | `Rejected` | The action has been rejected by a policy approval
            action. |
        transactionId:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^tx-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          description: Deprecated.
          example: tx-583hu-sp2p7-slvb9nqpa3hd8bus
        signatureId:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^sig-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          description: Deprecated.
          example: sig-4sfvl-f4iha-umighfi3hk4t54dr
        transactionHash:
          type: string
          description: Deprecated.
        kind:
          type: string
          enum:
            - Stake
            - Unbond
            - Deposit
            - Withdraw
          description: >-
            The type of staking action being performed.


            | Kind | Definition |

            | --- | --- |

            | `Stake` | Delegate funds to a validator to begin earning rewards.
            |

            | `Unbond` | Initiate the unbonding process to release staked funds
            (subject to cooldown). |

            | `Deposit` | Add additional funds to an existing stake position. |

            | `Withdraw` | Withdraw unbonded funds from the stake position. |
        requester:
          $ref: '#/components/schemas/Requester'
        requestBody:
          anyOf:
            - allOf:
                - oneOf:
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Babylon
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        duration:
                          type: number
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                        - duration
                      title: Babylon
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Ethereum
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        provider:
                          type: string
                          enum:
                            - Figment
                          description: Staking Provider
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                      required:
                        - protocol
                        - walletId
                        - provider
                        - amount
                      title: Ethereum
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Iota
                        walletId:
                          type: string
                          minLength: 1
                          maxLength: 64
                          pattern: ^wa-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
                          description: Id of the Dfns wallet making the deposit.
                          example: wa-5pfuu-9euek-h0odgb6snva8ph3k
                        validator:
                          type: string
                          pattern: ^0x[0-9a-fA-F]{64}$
                        amount:
                          type: string
                          pattern: ^\d+$
                          description: Transaction amount denominated in min units
                        lockedIotas:
                          type: array
                          items:
                            type: string
                            pattern: ^0x[0-9a-fA-F]{64}$
                          minItems: 1
                      required:
                        - protocol
                        - walletId
                        - validator
                        - amount
                      title: Iota
                - type: object
                  properties:
                    externalId:
                      type: string
            - allOf:
                - anyOf:
                    - oneOf:
                        - type: object
                          properties:
                            protocol:
                              type: string
                              enum:
                                - Iota
                            kind:
                              type: string
                              enum:
                                - Withdraw
                            amount:
                              type: string
                              pattern: ^\d+$
                          required:
                            - protocol
                            - kind
                            - amount
                          title: IOTA Withdrawal
                        - type: object
                          properties:
                            protocol:
                              type: string
                              enum:
                                - Iota
                            kind:
                              type: string
                              enum:
                                - Deposit
                            amount:
                              type: string
                              pattern: ^\d+$
                            lockedIotas:
                              type: array
                              items:
                                type: string
                                pattern: ^0x[0-9a-fA-F]{64}$
                          required:
                            - protocol
                            - kind
                            - amount
                          title: IOTA Deposit
                    - type: object
                      properties:
                        protocol:
                          type: string
                          enum:
                            - Ethereum
                        kind:
                          type: string
                          enum:
                            - Withdraw
                      required:
                        - protocol
                        - kind
                      title: Ethereum Withdrawal
                - type: object
                  properties:
                    externalId:
                      type: string
        failureReason:
          type: string
          description: The failure reason, if any. Only present when status is Failed.
        dateCreated:
          type: string
          format: date-time
          description: >-
            [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date (must be
            UTC). When the stake action was created.
          example: '2023-04-14T20:41:28.715Z'
      required:
        - id
        - stakeId
        - status
        - kind
        - requester
        - requestBody
        - dateCreated
    Requester:
      type: object
      properties:
        userId:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^us-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          description: User id.
          example: us-6b58p-r53sr-rlrd3l5cj3uc4ome
        tokenId:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^to-[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{14,16}$
          description: Token id.
          example: to-202a0-cdo33-o65mbt6q758lvvnt
      required:
        - userId
      description: The user who initiated the request.
  securitySchemes:
    authenticationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        **Bearer Token:** Used to authenticate API requests.

        More details how to generate the token: [Authentication
        flows](https://docs.dfns.co/api-reference/auth/login-flows)
    userActionSignature:
      type: apiKey
      in: header
      name: X-DFNS-USERACTION
      description: >-
        **User Action Signature:** Used to sign the change-inducing API
        requests.

        More details how to generate the token: [User Action Signing
        flows](https://docs.dfns.co/api-reference/auth/signing-flows)

````