# Non-fungible token (NFT) ownership

The `NFTTokenOwnership` entity represents a NFT ownership relation between accounts and contract packages, as well as provides the total tokens number.

### Properties

The `NFTTokenOwnership` entity has the following properties:

| Property                | Type         | Description                                                   |
| ----------------------- | ------------ | ------------------------------------------------------------- |
| `owner_hash`            | `string(64)` | Owner hash represented as a hexadecimal string                |
| `contract_package_hash` | `string(64)` | NFT contract package hash represented as a hexadecimal string |
| `owner_type`            | `uint8`      | NFT token owner type: `0` for account, `1` for contract       |
| `tokens_number`         | `uint32`     | Number of NFTs owned by the owner account                     |

**Example**

```json
{
  "contract_package_hash": "0074557b46c7a7c13e0b178e4463f451325129d845e9e494425d39cfd40e619d",
  "owner_hash": "532402a902ee117a772b2471df237346c906eddeb1580e18fa8b71ea559b9d2f",
  "owner_type": 0,
  "tokens_number": 1
}
```

## Optional properties

Depending on the endpoint some of the following optional properties may be included in the `NFTTokenOwnership` entity:

| Property           | Type                                                     | Description                         |
| ------------------ | -------------------------------------------------------- | ----------------------------------- |
| `contract_package` | [`ContractPackage`](/1.2.x/rest-api/contract-package.md) | NFT contract package                |
| `owner_public_key` | `string(68)`                                             | Owner public key if it's an account |

### Relations

| Entity                                                    | Mapping property        | Description                                                      |
| --------------------------------------------------------- | ----------------------- | ---------------------------------------------------------------- |
| [`Contract package`](/1.2.x/rest-api/contract-package.md) | `contract_package_hash` | NFT token ownership represents NFT contract package token owners |
| [`Account`](/1.2.x/rest-api/account.md)                   | `owner_hash`            | Account can be a token owner                                     |

### Endpoints

The `NFTTokenOwnership` entity has the following endpoints:

* [Get contract package NFT ownerships](/1.2.x/rest-api/non-fungible-token-ownership/get-contract-package-token-ownership.md)
* [Get account NFT ownerships](/1.2.x/rest-api/non-fungible-token-ownership/get-contract-package-token-ownership.md)

### Relation endpoints

None


---

# 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.cspr.cloud/1.2.x/rest-api/non-fungible-token-ownership.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.
