> For the complete documentation index, see [llms.txt](https://docs.cspr.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cspr.cloud/documentation/highlights/resolving-cspr-name.md).

# Resolving CSPR.name

CSPR.cloud REST API provides the possibility to resolve CSPR.name names either directly by calling the [CSPR.name Resolution API](/rest-api/cspr-name-resolution.md) or by including CSPR.name names as [optional properties](/documentation/overview/optional-properties.md).

At the moment of writing this page (August 27th, 2024), the CSPR.name is not launched yet. That's why we added a test CSPR.name for the Faucet account to allow developers to implement and test their CSPR.name integration before the launch.

Direct CSPR.name to account hash resolution can be done using the [Get CSPR.name resolution API](/rest-api/cspr-name-resolution/get-cspr-name-resolution.md) and is recommended for the situations when you receive the name outside CSPR.cloud and want to resolve it to the corresponding account hash:

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/cspr-name-resolutions/faucet.cspr' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": {
    "name_token_id": "0000000000000000000000000000000000000000000000000000000000000000",
    "name": "faucet.cspr",
    "resolved_hash": "b383c7cc23d18bc1b42406a1b2d29fc8dba86425197b6f553d7fd61375b5e446",
    "expires_at": "2124-08-27T12:00:00Z"
  }
}
```

In situations, when you want to resolve account hashes to the corresponding CSPR.name names, in most of the cases it's possible to do by requesting CSPR.name as [optional property](/documentation/overview/optional-properties.md) in the `includes` query parameter:

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/deploys/872394dcb8ac58b61f543e6fa0e3425b1db6b83a03d9d46cbf55c9d4b736624f?includes=caller_cspr_name' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": {
    "args": {
      "amount": {
        "cl_type": "U512",
        "parsed": "1000000000000"
      },
      "target": {
        "cl_type": {
          "ByteArray": 32
        },
        "parsed": "3234c6a8e17a19976300d18d6dcc444839ff981c5bfcd0d8724e3a0c018f61f3"
      }
    },
    "block_hash": "b8e7c74faed73e54be402a5f575a6cd8adf7382ed58bdb0ed48271464a122415",
    "block_height": 3618748,
    "caller_cspr_name": "faucet.cspr",
    "caller_public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02",
    "contract_hash": null,
    "contract_package_hash": null,
    "cost": "2976291766",
    "deploy_hash": "872394dcb8ac58b61f543e6fa0e3425b1db6b83a03d9d46cbf55c9d4b736624f",
    "entry_point_id": null,
    "error_message": null,
    "execution_type_id": 1,
    "payment_amount": "4000000000",
    "status": "processed",
    "timestamp": "2024-08-26T14:34:56Z"
  }
}
```

If you want to find the primary CSPR.name for an account, you can include it in the [Get account API](/rest-api/account/get-account.md):

```bash
curl -X 'GET' \
  'https://api.testnet.cspr.cloud/accounts/018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02?includes=cspr_name' \
  -H 'accept: application/json' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": {
    "account_hash": "b383c7cc23d18bc1b42406a1b2d29fc8dba86425197b6f553d7fd61375b5e446",
    "balance": 9516302858997050000,
    "cspr_name": "faucet.cspr",
    "deployment_threshold": 1,
    "key_management_threshold": 1,
    "main_purse_uref": "uref-b06a1ab0cfb52b5d4f9a08b68a5dbe78e999de0b0484c03e64f5c03897cf637b-007",
    "public_key": "018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02"
  }
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cspr.cloud/documentation/highlights/resolving-cspr-name.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
