> This page is for Taurus PROTECT, version v3.58 (default).
> For other versions, use one of these documentation indexes:
> - v3.58 (default): https://taurushq.ferndocs.com/protect-capital/v3.58/llms.txt
> - v3.56: https://taurushq.ferndocs.com/protect-capital/v3.56/llms.txt
> - v3.54: https://taurushq.ferndocs.com/protect-capital/v3.54/llms.txt
> - v3.52: https://taurushq.ferndocs.com/protect-capital/v3.52/llms.txt
> - v3.50: https://taurushq.ferndocs.com/protect-capital/v3.50/llms.txt
> - v3.48: https://taurushq.ferndocs.com/protect-capital/v3.48/llms.txt
> - v3.46: https://taurushq.ferndocs.com/protect-capital/v3.46/llms.txt
> - v3.44: https://taurushq.ferndocs.com/protect-capital/v3.44/llms.txt
> - v3.42: https://taurushq.ferndocs.com/protect-capital/v3.42/llms.txt
> - v3.40: https://taurushq.ferndocs.com/protect-capital/v3.40/llms.txt
> - v3.38: https://taurushq.ferndocs.com/protect-capital/v3.38/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://taurushq.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://taurushq.ferndocs.com/_mcp/server.

# Create pledge

POST https://your-protect-instance.example.com/api/rest/v1/tn/pledges
Content-Type: application/json

This endpoint creates a pledge of funds from an internal address that was previously shared to a Taurus-NETWORK participant. The funds will reserved and can't be spend until they are unpledged or withdrawn by the target participant. The endpoint will create a pledge action that needs to be approved to finalize the pledge and transmit it to the other participant.

Reference: https://taurushq.ferndocs.com/protect-capital/reference/taurus-network-pledges/create

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Body (application/json)

This endpoint expects a tgvalidatordCreatePledgeRequest.

- `sharedAddressID` (string, optional) — The shared address ID representing the internal address where the pledged funds will be held.
- `currencyID` (string, optional)
- `amount` (string, optional) — numeric; Amount in the smallest currency unit, based on the currency decimals. Example: 1500000000000000000 WEI (smallest ETH unit) corresponds to 1.5 ETH (ETH has 18 decimals places)
- `pledgeDurationSetup` (CreatePledgeRequestPledgeDurationSetupRequest, optional)
- `pledgeType` (string, optional) — The type of the pledge regarding the withdrawal rights. Possible values are: 'NO_WITHDRAWALS_RIGHTS', 'PLEDGEE_WITHDRAWALS_RIGHTS', 'PLEDGEE_AUTO_APPROVED_WITHDRAWALS_RIGHTS' 'NO_WITHDRAWALS_RIGHTS' means that the target participant has no right to withdraw from the pledge. 'PLEDGEE_WITHDRAWALS_RIGHTS' means that the target participant can request withdrawals from the pledge that must be approved by the owner participant. 'PLEDGEE_AUTO_APPROVED_WITHDRAWALS_RIGHTS' means that the target participant can request withdrawals from the pledge that are automatically approved without the owner participant approval, if the owner approved the setuped governance rules.
- `keyValueAttributes` (list of tgvalidatordKeyValue, optional) — Optional key-value attributes to attach to the pledge.
- `externalReferenceId` (string, optional) — Reference identifier for the pledge that will be shared to the counter participant.
- `reconciliationNote` (string, optional) — Reconciliation note used internally, not shared to the counter participant.

## Response

### 200

A successful response.

- `result` (tgvalidatordTnPledge, optional)
- `pledgeActionID` (string, optional)

## Errors

### 400 Bad Request Error

Bad Request: indicates that the server cannot or will not process the request due to something that is perceived to be a client error (for example, malformed request syntax, invalid request message framing, or deceptive request routing)

- `any`

### 401 Unauthorized Error

Unauthorized: indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource

- `any`

### 403 Forbidden Error

Forbidden: indicates that the server understands the request but refuses to authorize it

- `any`

### 404 Not Found Error

Not Found: indicates that the server cannot find the requested resource

- `any`

### 500 Internal Server Error

Internal Server Error: indicates that the server encountered an unexpected condition that prevented it from fulfilling the request

- `any`

### 503 Service Unavailable Error

Service Unavailable: indicates that the server is not ready to handle the request.

- `any`

## Types

### CreatePledgeRequestPledgeDurationSetupRequest

- `minimumDuration` (string, optional) — The minimum duration of the pledge. The minimum duration is the time that the pledge must remain active before it can be unpledged. (example 1 month, the owner can't unpledge before one month)You can either set endOfMinimumDurationDate or minimumDuration. If endOfMinimumDurationDate is set, minimumDuration will be inferred from endOfMinimumDurationDate. Example of value: '86400s' for 1 day.
- `endOfMinimumDurationDate` (datetime, optional) — The end date of the minimum duration of the pledge. The minimum duration is the time that the pledge must remain active before it can be unpledged.You can either set endOfMinimumDurationDate or minimumDuration. If endOfMinimumDurationDate is set, minimumDuration will be inferred from endOfMinimumDurationDate.
- `noticePeriodDuration` (string, optional) — The duration of the notice period occuring after doing an unpledge.When an unpledge is performed, the target participant will be able to perform withdrawals until the end of the notice period. (example 48h after the unpledge)When this field is not set, the pledge is considered 'At sight', so the owner can unpledge at anytime and the target can't withdraw anymore. Example of value: '86400s' for 1 day.

### tgvalidatordKeyValue

- `key` (string, optional)
- `value` (string, optional)

### tgvalidatordTnPledge

- `id` (string, optional)
- `sharedAddressID` (string, optional)
- `ownerParticipantID` (string, optional)
- `targetParticipantID` (string, optional)
- `currencyID` (string, optional)
- `blockchain` (string, optional)
- `network` (string, optional)
- `arg1` (string, optional)
- `arg2` (string, optional)
- `amount` (string, optional)
- `status` (string, optional)
- `pledgeType` (string, optional)
- `trails` (list of tgvalidatordTnPledgeTrail, optional)
- `originCreationDate` (datetime, optional)
- `durationSetup` (TnPledgePledgeDurationSetup, optional)
- `unpledgeDate` (datetime, optional)
- `attributes` (list of TnPledgePledgeAttribute, optional)
- `createdAt` (datetime, optional)
- `updatedAt` (datetime, optional)
- `externalReferenceId` (string, optional)
- `reconciliationNote` (string, optional)
- `direction` (string, optional)
- `wladdressID` (string, optional) — Represent the id of a whitelisted address if your participant is the target participant of the pledge. internalAddressID and wladdressID can not be set simultaneously.

### tgvalidatordTnPledgeTrail

- `id` (string, optional)
- `pledgeID` (string, optional)
- `addressCommandID` (string, optional)
- `participantID` (string, optional)
- `pledgeAmount` (string, optional)
- `action` (string, optional)
- `comment` (string, optional)
- `createdAt` (datetime, optional)

### TnPledgePledgeDurationSetup

- `minimumDuration` (string, optional) — The minimum duration of the pledge. The minimum duration is the time that the pledge must remain active before it can be unpledged. (example 1 month, the owner can't unpledge before one month)You can either set endOfMinimumDurationDate or minimumDuration.
- `endOfMinimumDurationDate` (datetime, optional) — The end date of the minimum duration of the pledge. The minimum duration is the time that the pledge must remain active before it can be unpledged.You can either set endOfMinimumDurationDate or minimumDuration.
- `noticePeriodDuration` (string, optional) — The duration of the notice period occuring after doing an unpledge.When an unpledge is performed, the target participant will be able to perform withdrawals until the end of the notice period. (example 48h after the unpledge)When this field is not set, the pledge is considered 'At sight', so the owner can unpledge at anytime and the target can't withdraw anymore.
- `endOfNoticePeriodDate` (datetime, optional) — The end date of the notice period. The notice period is the time that the target participant can perform withdrawals after the unpledge is done by the owner participant.After the end of the notice period, the target participant can't perform withdrawals anymore and the pledge is considered 'UNPLEDGED'. This field is set once an unpledge action is performed.

### TnPledgePledgeAttribute

- `id` (string, optional)
- `key` (string, optional)
- `value` (string, optional)
- `owner` (string, optional)
- `type` (string, optional)
- `subtype` (string, optional)
- `contentType` (string, optional)
- `isTaurusNetworkShared` (boolean, optional)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "result": {
    "id": "string",
    "sharedAddressID": "string",
    "ownerParticipantID": "string",
    "targetParticipantID": "string",
    "currencyID": "string",
    "blockchain": "string",
    "network": "string",
    "arg1": "string",
    "arg2": "string",
    "amount": "string",
    "status": "string",
    "pledgeType": "string",
    "trails": [
      {
        "id": "string",
        "pledgeID": "string",
        "addressCommandID": "string",
        "participantID": "string",
        "pledgeAmount": "string",
        "action": "string",
        "comment": "string",
        "createdAt": "2024-01-15T09:30:00Z"
      }
    ],
    "originCreationDate": "2024-01-15T09:30:00Z",
    "durationSetup": {
      "minimumDuration": "string",
      "endOfMinimumDurationDate": "2024-01-15T09:30:00Z",
      "noticePeriodDuration": "string",
      "endOfNoticePeriodDate": "2024-01-15T09:30:00Z"
    },
    "unpledgeDate": "2024-01-15T09:30:00Z",
    "attributes": [
      {
        "id": "string",
        "key": "string",
        "value": "string",
        "owner": "string",
        "type": "string",
        "subtype": "string",
        "contentType": "string",
        "isTaurusNetworkShared": true
      }
    ],
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "externalReferenceId": "string",
    "reconciliationNote": "string",
    "direction": "string",
    "wladdressID": "string"
  },
  "pledgeActionID": "string"
}
```

**SDK Code**

```python
import requests

url = "https://your-protect-instance.example.com/api/rest/v1/tn/pledges"

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://your-protect-instance.example.com/api/rest/v1/tn/pledges';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://your-protect-instance.example.com/api/rest/v1/tn/pledges"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://your-protect-instance.example.com/api/rest/v1/tn/pledges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://your-protect-instance.example.com/api/rest/v1/tn/pledges")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://your-protect-instance.example.com/api/rest/v1/tn/pledges', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://your-protect-instance.example.com/api/rest/v1/tn/pledges");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://your-protect-instance.example.com/api/rest/v1/tn/pledges")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```