> For the complete documentation index, see [llms.txt](https://docs-legacy.dfns.co/d/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-legacy.dfns.co/d/integrations/staking/api-reference/create-stake.md).

# Create Stake

`POST /staking/stakes`

Creates a new stake.

{% hint style="info" %}

* User action signature required. See [User Action Signing](/d/api-docs/authentication/user-action-signing.md) for more information.
* Request headers required. See [Request Headers](/d/advanced-topics/authentication/request-headers.md) for more information.
* Authentication required. See [Authentication Headers](/d/advanced-topics/authentication/request-headers.md#authentication-headers) for more information.
  {% endhint %}

## Required Permissions

| Name            | Conditions      |
| --------------- | --------------- |
| `Stakes:Create` | Always Required |

## Parameters <a href="#parameters.1" id="parameters.1"></a>

## Body <a href="#request-body" id="request-body"></a>

<table><thead><tr><th width="141">Property</th><th width="121">Required/Optional</th><th width="258.01953125">Description</th><th width="80">Type</th></tr></thead><tbody><tr><td><code>walletId</code> <mark style="color:red;">*</mark></td><td>Required</td><td>Id of the Dfns wallet making the deposit.</td><td>String</td></tr><tr><td><code>amount</code> <mark style="color:red;">*</mark></td><td>Required</td><td>Transaction amount denominated in min units</td><td>String</td></tr><tr><td><code>provider</code></td><td>Optional</td><td>Staking Provider, Eg "Figment"</td><td>String</td></tr><tr><td><code>protocol</code> <mark style="color:red;">*</mark></td><td>Required</td><td>Staking Protocol, Eg "Babylon", "Iota",..</td><td>String</td></tr></tbody></table>

Currently, only two kind are possible: `LockedNative` for vested staking on IOTA and `Native` otherwise.

Depending on the protocol, some arguments are required when creating a stake:\\

#### Babylon

| fields                                       | Type   |
| -------------------------------------------- | ------ |
| `duration`<mark style="color:red;">\*</mark> | number |

#### Iota

| fields                                        | Type      | Remarks            |
| --------------------------------------------- | --------- | ------------------ |
| `validator`<mark style="color:red;">\*</mark> | string    |                    |
| `amount`                                      | string    |                    |
| `lockedIotas`                                 | string\[] | for vested staking |

**Example**

```json
{
  "walletId": "wa-fd328-9v5a8-xxxxxxxxxxxxxxxx",
  "provider": "Figment",
  "protocol": "Babylon",
  "duration": 150,
  "amount": "50000"
}
```

## Response <a href="#response" id="response"></a>

### Response example <a href="#response-example" id="response-example"></a>

```json
{
  "id": "stk-5q230-nl4b0-xxxxxxxxxxxxxxxx",
  "provider": "Figment",
  "providerStakeId": "1dd3b430-729e-4935-8da1-bc7af56a4e7a",
  "walletId": "wa-fd328-9v5a8-xxxxxxxxxxxxxxxx",
  "protocol": "Babylon",
  "status": "Active",
  "requester": {
    "userId": "us-3htce-s75t3-xxxxxxxxxxxxxxxx",
    "tokenId": "to-72305-jh38s-xxxxxxxxxxxxxxxx",
  },
  "requestBody": {
    "amount": "50000",
    "walletId": "wa-fd328-9v5a8-xxxxxxxxxxxxxxxx",
    "provider": "Figment",
    "protocol": "Babylon",
    "duration": 150
  },
  "dateCreated": "2024-11-27T19:05:33.551Z",
  "actions": [
    {
      "id": "stktx-7cmu5-u8pct-xxxxxxxxxxxxxxxx",
      "stakeId": "stk-5q230-nl4b0-xxxxxxxxxxxxxxxx",
      "transactionId": "tx-4j1md-uperm-xxxxxxxxxxxxxxxx",
      "kind": "Stake",
      "requester": {
        "userId": "us-3htce-s75t3-xxxxxxxxxxxxxxxx",
        "tokenId": "to-72305-jh38s-xxxxxxxxxxxxxxxx",
      },
      "requestBody": {
        "amount": "50000",
        "walletId": "wa-fd328-9v5a8-xxxxxxxxxxxxxxxx",
        "provider": "Figment",
        "protocol": "Babylon",
        "duration": 150
      },
      "dateCreated": "2024-11-27T19:05:33.551Z"
    }
  ] 
}
```

## Remarks <a href="#response" id="response"></a>

When creating a stake it will implicitly create a `StakeAction` with kind `Stake`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs-legacy.dfns.co/d/integrations/staking/api-reference/create-stake.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
