---
title: "Get card PIN"
description: "Retrieve the encrypted card PIN."
protocol: rest
method: GET
endpoint: "/v1/cards/{card_id}/pin"
baseUrl: "https://api.gravv.xyz"
group: "Cards"
auth:
  label: "Api-Key"
  name: "Api-Key"
  in: header
---

# Get card PIN

<Endpoint method="GET" path="/v1/cards/{card_id}/pin" />

Retrieve the encrypted card PIN.

## Headers

<ParamField name="X-Client-Public-Key" header="X-Client-Public-Key" type="string" required>
  Base64-encoded PEM-formatted RSA public key used to encrypt the response. Encode the entire `public.pem` file contents, including the `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----` markers and the newlines between them.
</ParamField>

## Path Parameters

<ParamField name="card_id" path="card_id" type="string" required>
  The ID of the card to retrieve the PIN for
</ParamField>

## Responses

| Status | Description |
| --- | --- |
| `200` | Encrypted card PIN retrieved successfully |

### 200 response

<ResponseField name="data" type="object">

  <Expandable title="properties">
    <ResponseField name="ciphertext" type="string">
      Base64 value that holds the AES-GCM encrypted card PIN and includes integrity protection
    </ResponseField>

    <ResponseField name="encrypted_key" type="string">
      Base64 value of the AES key encrypted with the client's public key
    </ResponseField>

    <ResponseField name="nonce" type="string">
      Base64 value of the nonce required for AES GCM decryption
    </ResponseField>

  </Expandable>
</ResponseField>

<ResponseField name="error" type="null">
</ResponseField>

<ResponseExample>

```json title="Response"
{
  "data": {
    "ciphertext": "/et5daK4NHI4ur84fFo+pIwJZXYXOBvNJgp3tF+eOgv0kKPi4w6dYhLY",
    "encrypted_key": "LukDQ79S1Sq+6cH0pKYbBMrW2XTaGOieDWYQ1c2d/t24waKSEMx6vPYYqjQh2wfoDNc5wderJQI5x2m9rGH6GBTQk0TVHq9RLmZFj+mqJXQev89FuDu6VAPoehtEZGVia7dVuMv1fnQxHCvkNRnyWF6f1HjSDD+XUTNaHoLbwi8M/TZwwTOqc/gLJgZoKFtNxVCYf0HnSgVC4iNuRHeb9A1YODxlQBf8nfhzAm0kXSIOI7OfAZTX/tFPlDO8ksYVJM99U1RVCuLlLTiDJPctGmUzhBoUbBzozYHl+VhYeOQHv9JRIqensLkjVjfD1XZAV7THdSW9JopIL524uA5Xxw==",
    "nonce": "pcepprdxvUnEnPkz"
  },
  "error": null
}
```

</ResponseExample>

## Authorization

- **ApiKeyAuth**
