# Transfer SRR Ownership By RevealHash

### Transfer With Default Collection

<mark style="color:green;">`POST`</mark> `<base_url>/startrail/api/v1/srr/{tokenId}/transferByReveal`

### Transfer With Custom Collection

<mark style="color:green;">`POST`</mark> `<base_url>/startrail/api/v1/srr/{contractAddress}/{tokenId}/transferByReveal`

Please replace `<base_url>` as explained [here](/readme/url-per-environment.md).

Transfer SRR to a new owner providing a reveal hash, the hash of matches the commitment given in the approval stage.

{% hint style="info" %}
Default collection address is not supported in `Transfer With Custom Collection`. Please use `Transfer With Default Collection` instead.
{% endhint %}

#### Path Parameters

| Name                                      | Type   | Description                        |
| ----------------------------------------- | ------ | ---------------------------------- |
| tokenId<mark style="color:red;">\*</mark> | String | Startrail Registry Record Token ID |
| contractAddress                           | String | The address of collection contract |

#### Request Body

| Name                                         | Type    | Description                                                                                         |
| -------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------- |
| revealHash<mark style="color:red;">\*</mark> | String  | The key generated on Port Dashboard in advance for future transfer                                  |
| to<mark style="color:red;">\*</mark>         | String  | Next owner's EOA address. Both lowercase and mixed case which is compatible with EIP55 are accepted |
| isIntermediary                               | Boolean |                                                                                                     |

{% tabs %}
{% tab title="201: Created " %}

```json
{
  "txReceiptId": 0
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "statusCode":400,
<strong>    "message":"hash of revealHash does not match the SRR transferCommitment"
</strong>}
</code></pre>

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "statusCode":400,
    "message":"metadata is invalid. Check it against the metadata JSON schema. Details: should NOT have additional properties ({"additionalProperty":"unknownField"})."
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```json
{
    "statusCode":404,
    "message":"Token 41052230 not found"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Transaction Sending Errors - these errors occur after validation but before the transaction is sent to Ethereum." %}

```json
{
    "statusCode":500,
    "message":"API account is out of funds"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Transaction Sending Errors - these errors occur after validation but before the transaction is sent to Ethereum." %}

```json
{
    "statusCode":500,
    "message":"failed to send transaction toEthereum - internal error"
}
```

{% endtab %}
{% endtabs %}

## Request Body Example

```json
{
  "revealHash": "0x335929a4e59b0860ec04c620c1284dace74c00f7eadaadce7a18d6deba6c544e",
  "to": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
  "isIntermediary": false
}
```

## Swagger Endpoint (Test Environment)

[Swagger to test](https://api-stg.startrail.startbahn.jp/api/#/default/SRRController_transferByReveal)

## Required Permissions

* You need to have a Licensed User

{% hint style="info" %}
You must pass the `revealHash which you generated at` [`approveSRRByCommitment()`](/startrail-sdk-js/startrail-api-methods/approvesrrbycommitment.md) `via Startrail-Sdk-Js in order to complate transfer`
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.startrail.io/startrail-api/transfer-srr-ownership-by-revealhash.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
