# Auth

## Authentication

## Authenticate user

<mark style="color:blue;">`GET`</mark> `/auth/login`

#### Query Parameters

| Name                                        | Type   | Description                                                                       |
| ------------------------------------------- | ------ | --------------------------------------------------------------------------------- |
| wallet<mark style="color:red;">\*</mark>    | String | The user's wallet address.                                                        |
| chain <mark style="color:red;">\*</mark>    | String | The chain identifier.                                                             |
| nonce<mark style="color:red;">\*</mark>     | String | A non-reusable value provided by the client to prevent replay attacks.            |
| signature<mark style="color:red;">\*</mark> | String | The signature generated by signing the request data using the user's private key. |

{% tabs %}
{% tab title="200 Authentication successfull" %}

```json
{
    "success": true, //  Indicates whether the request was successful or not.
    "nfts":  // An array of NFT objects.
	[
        {
            "contract": {
                "address": Address of the NFT contract,
            },
            "id": {
                "tokenId": Unique identifier of the NFT,
                "tokenMetadata": {
                    "tokenType": Type of the token
                }
            },
            "balance": Balance of the NFT,
            "title": Name of the NFT,
            "description": Description of the NFT,
            "tokenUri": {
                "gateway": Gateway URL for accessing the token URI,
                "raw": Raw token URI
            },
            "media": [
                {
                    "gateway": Gateway URL for accessing the media file,
                    "thumbnail": URL of the thumbnail image associated with the media,
                    "raw": Base64 encoded SVG image data,
                    "format": "svg+xml",
                    "bytes": media size
                }
            ],
            "metadata": {
                "name":  Name of the NFT metadata,
                "description":  Description of the NFT metadata,
                "image": Base64 encoded SVG image data for the NFT metadata,
                "attributes": [
                    {
                        "display_type": "boost_percentage", // Display type of the attribute
                        "value": 3, // Value of the attribute define how much storage is already used
                        "trait_type": "Usage" // Trait type of the attribute.
                    },
                    {
                        "value": "5GB", // Maximum PX Storage NFT capacity
                        "trait_type": "Capacity"
                    }
                ]
            },
            "timeLastUpdated": Timestamp indicating the last update time,
            "contractMetadata": {
                "name": Name of the NFT contract metadata,
                "symbol": Symbol of the NFT contract metadata,
                "tokenType": Type of the token supported by the contract,
                "contractDeployer": Address of the contract deployer,,
                "deployedBlockNumber": Block number at which the contract was deployed,
                "openSea": {
                    "lastIngestedAt": Timestamp indicating the last ingestion time by OpenSea.
                }
            },
            "jwt": JWT (JSON Web Token) for authentication purposes,
            "endpoint": API endpoint for interacting with the PollinationX.
        },
     ],
    "totalCount": Total count of NFTs returned
}
```

{% endtab %}

{% tab title="500: Internal Server Error Authentication failed" %}

```json
{ error: Error message }
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Tip:** This endpoint allows you to authenticate a user and check their PollinationX (PX) storage NFTs without triggering a blockchain transaction or incurring any gas fees.
{% endhint %}

### Auth URL:

{% embed url="<https://6cp0k0.pollinationx.io/auth/login>" %}

The URL link defines which parameters must be sent. The user proves the storage ownership (i.e. PX sNFT) by signing with MetaMask. PX sNFTs are available for minting at the [PX Dashboard](https://wiki.pollinationx.io/developer-section/px-api-reference/broken-reference).
